Uapi.lean
Shared UAPI Helpers & Syscall Table Dispatcher (Arm64.)
-
Layer / Role:
Arm64Trusted Computing Base (Role::Spec, definitions only, 0 theorems). -
Linux
7.3Upstream Sources:-
arch/(arm64/ kernel/ syscall.c:55 el0_svc_common: readsX8syscall number,X0..X5args, writes return value toX0) -
include/(AArch64 generic syscall numbering)uapi/ asm-generic/ unistd.h
-
-
Purpose & Key Exports: Single-thread process/thread ID (
SIM_TID), 48-bit user virtual address space ceiling (USER_VA_LIMIT), per-call transfer cap (MAX_RW_COUNT), little-endian byte encoders (leBytes32,leBytes64), and explicit(nr, handler)table dispatch (Syscall.).dispatch
@[expose] public sectionnamespace Arm64def SIM_TID
Deterministic process and thread ID (1) returned by single-thread identity syscalls ([INTENTIONAL_SCOPE]: kernel/ sys_getpid, kernel/ sys_gettid).
def SIM_TID : BitVec 64 := 1#64def USER_VA_LIMIT
Upper bound of the 48-bit Linux AArch64 user virtual address space (TASK_SIZE_64 = 2 ^ 48 under CONFIG_ARM64_VA_BITS=48 / TCR_EL1. with 4 KiB pages, arch/, include/ __access_ok; [INTENTIONAL_SCOPE]: assumes a VA_BITS=48 kernel rather than 39/42/47-bit VA configurations where access_ok rejects addresses in [2 ^ VA_BITS, 2 ^ 48) with -EFAULT).
def USER_VA_LIMIT : Nat := 2 ^ 48def MAX_RW_COUNT
Largest byte count a single read or write transfers (MAX_RW_COUNT = INT_MAX & PAGE_MASK = 0x7ffff000, include/).
def MAX_RW_COUNT : Nat := 0x7ffff000def leBytes32
Serialize a 32-bit unsigned integer into 4 little-endian bytes.
def leBytes32 (v : BitVec 32) : List (BitVec 8) :=
[v.extractLsb' 0 8, v.extractLsb' 8 8, v.extractLsb' 16 8, v.extractLsb' 24 8]def leBytes64
Serialize a 64-bit unsigned integer into 8 little-endian bytes.
def leBytes64 (v : BitVec 64) : List (BitVec 8) :=
[v.extractLsb' 0 8, v.extractLsb' 8 8, v.extractLsb' 16 8, v.extractLsb' 24 8,
v.extractLsb' 32 8, v.extractLsb' 40 8, v.extractLsb' 48 8, v.extractLsb' 56 8]namespace Syscalldef dispatch
Dispatch a Linux AArch64 supervisor call (SVC #0, arch/ el0_svc_common) on X8 over an explicit (nr, handler) table.
-
[INTENTIONAL_SCOPE]: Any syscall number absent fromtablefails closed with .Exception"unmodeled syscall (svc)".
end Syscallend Arm64