Skip to content

Agent KB_headers_p4

grisun0 edited this page Oct 23, 2026 · 12 revisions

Subsystem: headers (page 4 of 6)

Previous: KB_headers_p3.md

headers/sanitize.h

  • Doc: Docstring: sanitize.h -- Single choke point for syscall argument checks.
  • Layer: utility
  • Language: h
  • Symbols:
    • SANITIZE_H (macro, line 2) #define SANITIZE_H
    • SANITIZE_LEN_NEG (macro, line 32) #define SANITIZE_LEN_NEG(var)
    • SANITIZE_RANGE (macro, line 37) #define SANITIZE_RANGE(ptr, len)
    • SANITIZE_STR (macro, line 43) #define SANITIZE_STR(ptr, maxlen)
    • SANITIZE_COPY_IN (macro, line 49) #define SANITIZE_COPY_IN(kbuf, uptr, count, elemsz)
  • Imported by: kernel/proc_sec.c, kernel/syscalls.c, kernel/syscalls_proc.c, tests/test_sanitize.c

headers/sb16.h

  • Doc: Sound Blaster 16 DMA audio driver contract.
  • Layer: utility
  • Language: h
  • Symbols:
    • sb16_stream_t (struct, line 46)
    • sb16_counters_t (struct, line 55)
    • sb16_init (function, line 65) int sb16_init(void);
    • sb16_present (function, line 66) int sb16_present(void);
    • sb16_tone (function, line 67) void sb16_tone(unsigned freq);
    • sb16_irq (function, line 68) void sb16_irq(void);
    • sb16_poll (function, line 69) void sb16_poll(void);
    • sb16_pcm_open (function, line 73) void sb16_pcm_open(void);
    • sb16_pcm_submit (function, line 74) int sb16_pcm_submit(const unsigned char *pcm, unsigned len);
    • sb16_pcm_close (function, line 75) void sb16_pcm_close(void);
    • sb16_pump (function, line 76) void sb16_pump(void);
    • sb16_stream_open (function, line 79) int sb16_stream_open(void);
    • sb16_stream_close (function, line 80) void sb16_stream_close(int id);
    • sb16_stream_submit (function, line 81) int sb16_stream_submit(int id, const unsigned char *pcm, unsigned len);
    • sb16_stream_volume (function, line 82) void sb16_stream_volume(int id, unsigned char vol);
    • sb16_stream_count (function, line 83) int sb16_stream_count(void);
    • sb16_ring_free (function, line 85) unsigned sb16_ring_free(void);
    • sb16_mode_active (function, line 86) int sb16_mode_active(void);
    • sb16_legacy_busy (function, line 91) int sb16_legacy_busy(void);
    • sb16_counters (function, line 93) void sb16_counters(sb16_counters_t *out);
    • SB16_H (macro, line 2) #define SB16_H
    • SB16_PCM_BUF (macro, line 32) #define SB16_PCM_BUF
    • SB16_PCM_RATE (macro, line 33) #define SB16_PCM_RATE
    • SB16_SLOTS (macro, line 34) #define SB16_SLOTS
    • SB16_RING_CAP (macro, line 35) #define SB16_RING_CAP
    • SB16_ARM_PERIOD_MS (macro, line 36) #define SB16_ARM_PERIOD_MS
    • SB16_STREAMS (macro, line 42) #define SB16_STREAMS
    • SB16_STREAM_BUF (macro, line 43) #define SB16_STREAM_BUF
  • Imported by: drivers/pcm2.c, drivers/sb16.c, kernel.c, kernel/sched.c, kernel/shell.c, kernel/syscalls.c

headers/sched.h

  • Doc: Forward: full view lives in kernel.h (needs KFILE first); the PCB
  • Layer: utility
  • Language: h
  • Symbols:
    • cpu (struct, line 268)
    • ctx_regs_t (struct, line 33)
    • proc_t (struct, line 50)
    • syscall_frame_t (struct, line 235)
    • kfd_view_t (type_alias, line 11) typedef struct kfd_view kfd_view_t;
    • limit (type_alias, line 375) typedef struct __attribute__((packed)) { uint16_t limit;
    • __attribute__ (function, line 375) typedef struct __attribute__((packed))
    • group (function, line 108) * process is its own group (tgid == pid);
    • entry (function, line 135) * private view with one KFILE ref per live entry (0 on OOM), release * drops the view at reap, cloexec closes marked...
    • kfd_view_copy (function, line 138) int kfd_view_copy(proc_t *child, proc_t *parent);
    • kfd_view_release (function, line 139) void kfd_view_release(proc_t *p);
    • kfd_view_cloexec (function, line 140) void kfd_view_cloexec(void);
    • kfd_view_root (function, line 141) kfd_view_t *kfd_view_root(void);
    • bytes (function, line 173) * RLIM_AS total user bytes (brk growth + mmap) beyond the load base * RLIM_CPU timer ticks of CPU time, then...
    • first (function, line 232) * address first (SYSCALL_FRAME_WORDS in syscall_asm.h). It ends exactly at * the saved top (sc_top_save[pid]);
    • syscall_frame_current (function, line 245) const syscall_frame_t *syscall_frame_current(void);
    • sched_idle_on_kernel_cr3 (function, line 359) int sched_idle_on_kernel_cr3(int cpu);
    • sched_init (function, line 379) void sched_init(void);
    • kstack_report (function, line 380) void kstack_report(void);
    • schedtop_report (function, line 381) void schedtop_report(void);
    • irqstat_report (function, line 382) void irqstat_report(void);
    • gdb_regs_report (function, line 383) void gdb_regs_report(int pid);
    • gdb_dump_report (function, line 384) void gdb_dump_report(unsigned long addr, unsigned long len);
    • tss_init_ap (function, line 388) void tss_init_ap(int cpu);
    • smp_ap_idle_loop (function, line 389) void smp_ap_idle_loop(void);
    • proc_create (function, line 390) int proc_create(const char *name, int parent_pid);
    • proc_get (function, line 391) proc_t *proc_get(int pid);
    • schedule (function, line 392) void schedule(void);
    • sched_set_nice (function, line 393) int sched_set_nice(int pid, int nice);
    • seccomp_deny_one (function, line 394) int seccomp_deny_one(int pid, int n);
    • seccomp_allow_one (function, line 395) int seccomp_allow_one(int pid, int n);
    • seccomp_denied (function, line 396) int seccomp_denied(int pid, int n);
    • rlimit_cpu_exceeded (function, line 397) int rlimit_cpu_exceeded(int pid);
    • rlimit_cpu_tick (function, line 398) void rlimit_cpu_tick(int pid);
    • switch_to (function, line 399) void switch_to(proc_t *prev, proc_t *next);
    • switch_to_notrap (function, line 400) void switch_to_notrap(proc_t *prev, proc_t *next);
    • switch_save_only (function, line 401) void switch_save_only(proc_t *prev);
    • resume_iretq (function, line 408) void resume_iretq(void);
    • yield (function, line 409) void yield(void);
    • do_exit (function, line 410) void do_exit(int code);
    • do_clone (function, line 411) long do_clone(long flags, long newsp);
    • do_fork (function, line 412) long do_fork(void);
    • do_fork_ex (function, line 413) long do_fork_ex(uint64_t set_tid, uint64_t clear_tid);
    • do_linux_clone (function, line 414) long do_linux_clone(unsigned long flags, unsigned long newsp, unsigned long ptid, unsigned long ctid, unsigned long...
    • do_group_exit (function, line 416) void do_group_exit(int code);
    • mm_view_claim_current (function, line 417) void mm_view_claim_current(void);
    • do_kill_code (function, line 418) int do_kill_code(int pid, int code);
    • fork_child_settid (function, line 421) void fork_child_settid(void);
    • aslr_stack_bytes (function, line 431) unsigned long aslr_stack_bytes(void);
    • aslr_brk_pages (function, line 432) unsigned long aslr_brk_pages(void);
    • aslr_mmap_pages (function, line 433) unsigned long aslr_mmap_pages(void);
    • aslr_dyn_base (function, line 434) unsigned long aslr_dyn_base(void);
    • failure (function, line 439) * failure (negative errno);
    • do_execve (function, line 440) long do_execve(char *kpath, int kargc, char **kargv);
    • do_thread_spawn (function, line 441) long do_thread_spawn(unsigned long fn, unsigned long stack, unsigned long arg);
    • do_waitpid (function, line 443) int do_waitpid(int pid);
    • do_waitpid_nb (function, line 444) int do_waitpid_nb(int pid);
    • shell_reap_nb (function, line 445) int shell_reap_nb(int *pid_out, int *code_out);
    • shell_reap_one (function, line 446) int shell_reap_one(int pid, int *code_out);
    • shell_nchildren (function, line 447) int shell_nchildren(void);
    • do_waitpid_linux (function, line 451) int do_waitpid_linux(int pid, int nohang, int *found);
    • do_kill (function, line 452) int do_kill(int pid);
    • timer_tick (function, line 453) void timer_tick(void);
    • pt_clone_user (function, line 456) uint64_t pt_clone_user(uint64_t parent_cr3);
    • pt_free_user (function, line 457) void pt_free_user(uint64_t cr3);
    • caller (function, line 462) * caller (shell mrun) reaps it with do_waitpid. Returns pid or -1. * Programs using mmap/VMA or expecting a shared...
    • cpus (variable, line 294) extern cpu_t cpus[MAX_CPUS];
    • cpu_count (variable, line 295) extern int cpu_count;
    • procs (variable, line 333) extern proc_t procs[MAX_PROCS];
    • proc_count (variable, line 334) extern int proc_count;
    • sys_ticks (variable, line 335) extern volatile uint64_t sys_ticks;
    • user_program_active (variable, line 336) extern volatile int user_program_active;
    • sched_lock (variable, line 337) extern spinlock_t sched_lock;
    • sched_ready (variable, line 338) extern volatile int sched_ready;
    • ap_idle_proc (variable, line 356) extern proc_t ap_idle_proc[MAX_CPUS];
    • smp_dispatches (variable, line 360) extern volatile unsigned long smp_dispatches[MAX_CPUS];
    • smp_idle_polls (variable, line 361) extern volatile unsigned long smp_idle_polls[MAX_CPUS];
    • cpu_idle_ticks (variable, line 364) extern volatile unsigned long cpu_idle_ticks[MAX_CPUS];
    • smp_dbg_bad_gs (variable, line 367) extern volatile unsigned smp_dbg_bad_gs;
    • bsp_idtr (variable, line 376) extern idtr_t bsp_idtr;
    • isr_cnt_kbd (variable, line 385) extern volatile unsigned long isr_cnt_kbd;
    • isr_cnt_mouse (variable, line 386) extern volatile unsigned long isr_cnt_mouse;
    • isr_cnt_sb16 (variable, line 387) extern volatile unsigned long isr_cnt_sb16;
    • SCHED_H (macro, line 2) #define SCHED_H
    • PROC_FREE (macro, line 14) #define PROC_FREE
    • PROC_READY (macro, line 15) #define PROC_READY
    • PROC_RUNNING (macro, line 16) #define PROC_RUNNING
    • PROC_BLOCKED (macro, line 17) #define PROC_BLOCKED
    • PROC_ZOMBIE (macro, line 18) #define PROC_ZOMBIE
    • PROC_SWITCHING (macro, line 22) #define PROC_SWITCHING
    • MAX_PROCS (macro, line 25) #define MAX_PROCS
    • PROC_KSTACK_SZ (macro, line 26) #define PROC_KSTACK_SZ
    • MAX_CPUS (macro, line 29) #define MAX_CPUS
    • BOOT_CPU (macro, line 30) #define BOOT_CPU
    • CTX_RBP_OFF (macro, line 44) #define CTX_RBP_OFF
    • CTX_RIP_OFF (macro, line 45) #define CTX_RIP_OFF
    • CTX_RSP_OFF (macro, line 46) #define CTX_RSP_OFF
    • CTX_RFLAGS_OFF (macro, line 47) #define CTX_RFLAGS_OFF
    • PROC_T_SIZE (macro, line 132) #define PROC_T_SIZE
    • PROC_KSTACK_OFF (macro, line 142) #define PROC_KSTACK_OFF
    • PROC_FPU_OFF (macro, line 147) #define PROC_FPU_OFF
    • PROC_PID_OFF (macro, line 154) #define PROC_PID_OFF
    • PROC_FSBASE_OFF (macro, line 155) #define PROC_FSBASE_OFF
    • FPU_SAVE_SZ (macro, line 157) #define FPU_SAVE_SZ
    • FPU_MXCSR_OFF (macro, line 158) #define FPU_MXCSR_OFF
    • FPU_MXCSR_DEFAULT (macro, line 159) #define FPU_MXCSR_DEFAULT
    • SECCOMP_MIN (macro, line 163) #define SECCOMP_MIN
    • SECCOMP_MAX (macro, line 164) #define SECCOMP_MAX
    • SECCOMP_BIT (macro, line 165) #define SECCOMP_BIT(n)
    • SECCOMP_OP_DENY_ONE (macro, line 168) #define SECCOMP_OP_DENY_ONE
    • SECCOMP_OP_ALLOW_ONE (macro, line 169) #define SECCOMP_OP_ALLOW_ONE
    • SECCOMP_OP_DENY_ALL (macro, line 170) #define SECCOMP_OP_DENY_ALL
    • RLIM_OP_SET (macro, line 177) #define RLIM_OP_SET
    • RLIM_OP_GET (macro, line 178) #define RLIM_OP_GET
    • RLIM_AS (macro, line 179) #define RLIM_AS
    • RLIM_CPU (macro, line 180) #define RLIM_CPU
    • RLIM_NOFILE (macro, line 181) #define RLIM_NOFILE
    • RLIM_EXIT_CPU (macro, line 182) #define RLIM_EXIT_CPU
    • NICE_MIN (macro, line 184) #define NICE_MIN
    • NICE_MAX (macro, line 185) #define NICE_MAX
    • NICE_DEFAULT (macro, line 186) #define NICE_DEFAULT
    • SCHED_BASE_QUANTUM (macro, line 191) #define SCHED_BASE_QUANTUM
    • SCHED_NICE_MULT_KEY (macro, line 192) #define SCHED_NICE_MULT_KEY
    • SCHED_NICE_MULT_CHARGE (macro, line 193) #define SCHED_NICE_MULT_CHARGE
    • SCHED_NICE_OFFSET (macro, line 194) #define SCHED_NICE_OFFSET
    • CLONE_VM (macro, line 197) #define CLONE_VM
    • CLONE_FILES (macro, line 198) #define CLONE_FILES
    • LINUX_CLONE_SIGNAL_MASK (macro, line 200) #define LINUX_CLONE_SIGNAL_MASK
    • LINUX_CLONE_VM (macro, line 201) #define LINUX_CLONE_VM
    • LINUX_CLONE_FS (macro, line 202) #define LINUX_CLONE_FS
    • LINUX_CLONE_FILES (macro, line 203) #define LINUX_CLONE_FILES
    • LINUX_CLONE_SIGHAND (macro, line 204) #define LINUX_CLONE_SIGHAND
    • LINUX_CLONE_PIDFD (macro, line 205) #define LINUX_CLONE_PIDFD
    • LINUX_CLONE_PTRACE (macro, line 206) #define LINUX_CLONE_PTRACE
    • LINUX_CLONE_VFORK (macro, line 207) #define LINUX_CLONE_VFORK
    • LINUX_CLONE_PARENT (macro, line 208) #define LINUX_CLONE_PARENT
    • LINUX_CLONE_THREAD (macro, line 209) #define LINUX_CLONE_THREAD
    • LINUX_CLONE_NEWNS (macro, line 210) #define LINUX_CLONE_NEWNS
    • LINUX_CLONE_SYSVSEM (macro, line 211) #define LINUX_CLONE_SYSVSEM
    • LINUX_CLONE_SETTLS (macro, line 212) #define LINUX_CLONE_SETTLS
    • LINUX_CLONE_PARENT_SETTID (macro, line 213) #define LINUX_CLONE_PARENT_SETTID
    • LINUX_CLONE_CHILD_CLEARTID (macro, line 214) #define LINUX_CLONE_CHILD_CLEARTID
    • LINUX_CLONE_DETACHED (macro, line 215) #define LINUX_CLONE_DETACHED
    • LINUX_CLONE_UNTRACED (macro, line 216) #define LINUX_CLONE_UNTRACED
    • LINUX_CLONE_CHILD_SETTID (macro, line 217) #define LINUX_CLONE_CHILD_SETTID
    • LINUX_CLONE_NEWNS_MASK (macro, line 218) #define LINUX_CLONE_NEWNS_MASK
    • LINUX_CLONE_IO (macro, line 219) #define LINUX_CLONE_IO
    • LINUX_SIGCHLD (macro, line 220) #define LINUX_SIGCHLD
    • LINUX_CLONE_THREAD_OK (macro, line 223) #define LINUX_CLONE_THREAD_OK
    • LINUX_CLONE_FORK_OK (macro, line 228) #define LINUX_CLONE_FORK_OK
    • current_pid (macro, line 312) #define current_pid
    • DESKTOP_TICK_INTERVAL (macro, line 316) #define DESKTOP_TICK_INTERVAL
    • TSS_SEL (macro, line 372) #define TSS_SEL(cpu)
    • USER_FAULT_SIGNAL (macro, line 420) #define USER_FAULT_SIGNAL
    • EXECVE_MAX_ARGS (macro, line 424) #define EXECVE_MAX_ARGS
    • EXECVE_MAX_ARG (macro, line 425) #define EXECVE_MAX_ARG
    • WAITPID_NONE (macro, line 448) #define WAITPID_NONE
    • WAITPID_NOCHILD (macro, line 450) #define WAITPID_NOCHILD
  • Depends on: headers/spinlock.h, headers/vma.h
  • Imported by: drivers/kbd.c, drivers/pcm2.c, headers/futex.h, headers/percpu_rq.h, headers/rcu.h, headers/spawn.h, headers/sync.h, kernel.c, kernel/console.c, kernel/exec.c, kernel/loader.c, kernel/minifetch.c, kernel/mm.c, kernel/mm/cow.c, kernel/mm/tlb.c, kernel/panic.c, kernel/proc_sec.c, kernel/sched.c, kernel/serial.c, kernel/shell.c, kernel/spawn.c, kernel/syscalls.c, kernel/syscalls_proc.c, kernel/vga_fb.c, net/net.c, net/rtl8139.c, progs/src/lxabi.c, smp.c

headers/seccomp_bpf.h

  • Doc: Docstring: seccomp_bpf.h -- classic BPF checker and interpreter for
  • Layer: utility
  • Language: h
  • Symbols:
    • sbpf_insn (struct, line 15)
    • sbpf_data (struct, line 23)
    • sbpf_check (function, line 95) int sbpf_check(const sbpf_insn *prog, unsigned len, unsigned short *scratch);
    • sbpf_run (function, line 100) unsigned int sbpf_run(const sbpf_insn *prog, unsigned len, const sbpf_data *d);
    • sbpf_action_rank (function, line 104) int sbpf_action_rank(unsigned int action);
    • SECCOMP_BPF_H (macro, line 12) #define SECCOMP_BPF_H
    • SBPF_MAX_INSNS (macro, line 30) #define SBPF_MAX_INSNS
    • SBPF_DATA_SIZE (macro, line 31) #define SBPF_DATA_SIZE
    • SBPF_MEMWORDS (macro, line 32) #define SBPF_MEMWORDS
    • SBPF_WORD (macro, line 33) #define SBPF_WORD
    • SBPF_SHIFT_MAX (macro, line 34) #define SBPF_SHIFT_MAX
    • SBPF_ERR_INVALID (macro, line 35) #define SBPF_ERR_INVALID
    • SBPF_RET_KILL_PROCESS (macro, line 38) #define SBPF_RET_KILL_PROCESS
    • SBPF_RET_KILL_THREAD (macro, line 39) #define SBPF_RET_KILL_THREAD
    • SBPF_RET_TRAP (macro, line 40) #define SBPF_RET_TRAP
    • SBPF_RET_ERRNO (macro, line 41) #define SBPF_RET_ERRNO
    • SBPF_RET_USER_NOTIF (macro, line 42) #define SBPF_RET_USER_NOTIF
    • SBPF_RET_TRACE (macro, line 43) #define SBPF_RET_TRACE
    • SBPF_RET_LOG (macro, line 44) #define SBPF_RET_LOG
    • SBPF_RET_ALLOW (macro, line 45) #define SBPF_RET_ALLOW
    • SBPF_RET_ACTION_FULL (macro, line 46) #define SBPF_RET_ACTION_FULL
    • SBPF_RET_DATA (macro, line 47) #define SBPF_RET_DATA
    • SBPF_AUDIT_ARCH_X86_64 (macro, line 49) #define SBPF_AUDIT_ARCH_X86_64
    • SBPF_CLASS (macro, line 52) #define SBPF_CLASS(c)
    • SBPF_LD (macro, line 53) #define SBPF_LD
    • SBPF_LDX (macro, line 54) #define SBPF_LDX
    • SBPF_ST (macro, line 55) #define SBPF_ST
    • SBPF_STX (macro, line 56) #define SBPF_STX
    • SBPF_ALU (macro, line 57) #define SBPF_ALU
    • SBPF_JMP (macro, line 58) #define SBPF_JMP
    • SBPF_RET (macro, line 59) #define SBPF_RET
    • SBPF_MISC (macro, line 60) #define SBPF_MISC
    • SBPF_W (macro, line 61) #define SBPF_W
    • SBPF_IMM (macro, line 62) #define SBPF_IMM
    • SBPF_ABS (macro, line 63) #define SBPF_ABS
    • SBPF_MEM (macro, line 64) #define SBPF_MEM
    • SBPF_LEN (macro, line 65) #define SBPF_LEN
    • SBPF_ADD (macro, line 66) #define SBPF_ADD
    • SBPF_SUB (macro, line 67) #define SBPF_SUB
    • SBPF_MUL (macro, line 68) #define SBPF_MUL
    • SBPF_DIV (macro, line 69) #define SBPF_DIV
    • SBPF_OR (macro, line 70) #define SBPF_OR
    • SBPF_AND (macro, line 71) #define SBPF_AND
    • SBPF_LSH (macro, line 72) #define SBPF_LSH
    • SBPF_RSH (macro, line 73) #define SBPF_RSH
    • SBPF_NEG (macro, line 74) #define SBPF_NEG
    • SBPF_MOD (macro, line 75) #define SBPF_MOD
    • SBPF_XOR (macro, line 76) #define SBPF_XOR
    • SBPF_JA (macro, line 77) #define SBPF_JA
    • SBPF_JEQ (macro, line 78) #define SBPF_JEQ
    • SBPF_JGT (macro, line 79) #define SBPF_JGT
    • SBPF_JGE (macro, line 80) #define SBPF_JGE
    • SBPF_JSET (macro, line 81) #define SBPF_JSET
    • SBPF_K (macro, line 82) #define SBPF_K
    • SBPF_X (macro, line 83) #define SBPF_X
    • SBPF_A (macro, line 84) #define SBPF_A
    • SBPF_TAX (macro, line 85) #define SBPF_TAX
    • SBPF_TXA (macro, line 86) #define SBPF_TXA
  • Imported by: kernel/proc_sec.c, kernel/seccomp_bpf.c, tests/test_seccomp_bpf.c

headers/select_map.h

  • Doc: Docstring: select_map.h -- fd_set <-> pollfd translation for select(2).
  • Layer: utility
  • Language: h
  • Symbols:
    • select_pollfd_t (struct, line 31)
    • select_fd_isset (function, line 37) static inline int select_fd_isset(const unsigned char *set, int fd)
    • select_fd_put (function, line 41) static inline void select_fd_put(unsigned char *set, int fd)
    • select_poll_count (function, line 46) static inline unsigned select_poll_count(const unsigned char *r, ...
    • select_poll_build (function, line 66) static inline unsigned select_poll_build(select_pollfd_t *pfd, ...
    • select_poll_result (function, line 95) static inline unsigned select_poll_result(unsigned char *rout, ...
    • select_poll_badfd (function, line 131) static inline int select_poll_badfd(const select_pollfd_t *pfd, ...
    • SELECT_MAP_H (macro, line 2) #define SELECT_MAP_H
    • SELECT_FD_SETSIZE (macro, line 20) #define SELECT_FD_SETSIZE
    • SELECT_FD_SET_BYTES (macro, line 21) #define SELECT_FD_SET_BYTES
    • SELECT_POLLIN (macro, line 24) #define SELECT_POLLIN
    • SELECT_POLLPRI (macro, line 25) #define SELECT_POLLPRI
    • SELECT_POLLOUT (macro, line 26) #define SELECT_POLLOUT
    • SELECT_POLLERR (macro, line 27) #define SELECT_POLLERR
    • SELECT_POLLHUP (macro, line 28) #define SELECT_POLLHUP
    • SELECT_POLLNVAL (macro, line 29) #define SELECT_POLLNVAL
  • Imported by: kernel/syscalls.c, tests/test_select_map.c

headers/shell.h

  • Doc: shared shell constants and the line reader/parser reused by
  • Layer: utility
  • Language: h
  • Symbols:
    • shell_readline_buf (function, line 18) void shell_readline_buf(char *buf, int size);
    • shell_parse (function, line 21) int shell_parse(char *line, char **argv, int max_args);
    • shell_parse_long (function, line 29) int shell_parse_long(const char *s, long *out);
    • shell_parse_pid (function, line 34) int shell_parse_pid(const char *s, int min_pid, int *out);
    • shell_cmd_sh (function, line 39) int shell_cmd_sh(int argc, char **argv);
    • SHELL_H (macro, line 2) #define SHELL_H
    • CMD_BUF_SZ (macro, line 13) #define CMD_BUF_SZ
    • MAX_ARGS (macro, line 14) #define MAX_ARGS
  • Depends on: headers/kernel.h, headers/kernel/console_in.h
  • Imported by: kernel/editor.c, kernel/shell.c, kernel/syscalls.c

headers/sign.h

  • Doc: Docstring: sign.h -- MiniOS binary signing contract.
  • Layer: utility
  • Language: h
  • Symbols:
    • ed_sha (struct, line 61)
    • sign_pubkey (function, line 47) static inline const unsigned char *sign_pubkey(unsigned id)
    • ed_sha512_init (function, line 69) void ed_sha512_init(ed_sha *c);
    • ed_sha512_update (function, line 70) void ed_sha512_update(ed_sha *c, const unsigned char *data, unsigned long len);
    • ed_sha512_final (function, line 71) void ed_sha512_final(ed_sha *c, unsigned char out[64]);
    • ed25519_verify (function, line 75) int ed25519_verify(const unsigned char sig[64], const unsigned char *msg, unsigned long msglen, const unsigned char...
    • SIGN_H (macro, line 17) #define SIGN_H
    • SIGN_KEY_DEV (macro, line 19) #define SIGN_KEY_DEV
    • SIGN_KEY_PROD (macro, line 20) #define SIGN_KEY_PROD
    • SIGN_KEYS (macro, line 21) #define SIGN_KEYS
    • SIGN_PUB_BYTES (macro, line 22) #define SIGN_PUB_BYTES
    • SIGN_SIG_BYTES (macro, line 23) #define SIGN_SIG_BYTES
    • SIGN_DESC_BYTES (macro, line 24) #define SIGN_DESC_BYTES
    • SIGN_NOTE_TYPE (macro, line 25) #define SIGN_NOTE_TYPE
  • Imported by: kernel/ed25519.c, kernel/loader.c, tests/test_sign.c

headers/smp.h

  • Doc: SMP bring-up: wake the application processors (APs) via the LAPIC INIT/SIPI
  • Layer: utility
  • Language: h
  • Symbols:
    • smp_init (function, line 41) void smp_init(void);
    • smp_ap_entry (function, line 42) void smp_ap_entry(void);
    • smp_ipi_broadcast (function, line 43) void smp_ipi_broadcast(int vector);
    • smp_nmi_broadcast (function, line 44) void smp_nmi_broadcast(void);
    • smp_lock (variable, line 25) extern spinlock_t smp_lock;
    • smp_dbg_svr (variable, line 30) extern volatile unsigned smp_dbg_svr;
    • smp_dbg_lvt (variable, line 31) extern volatile unsigned smp_dbg_lvt;
    • smp_dbg_ipis (variable, line 32) extern volatile unsigned smp_dbg_ipis;
    • smp_dbg_sent (variable, line 33) extern volatile unsigned smp_dbg_sent;
    • lapic_cal_10ms (variable, line 38) extern unsigned lapic_cal_10ms;
    • lapic_cal_valid (variable, line 39) extern int lapic_cal_valid;
    • SMP_H (macro, line 2) #define SMP_H
  • Depends on: headers/spinlock.h
  • Imported by: kernel.c, kernel/mm/tlb.c, kernel/sched.c, kernel/shell.c, smp.c

headers/spawn.h

  • Doc: Docstring: Scalar shared-window view saved across a child run.
  • Layer: utility
  • Language: h
  • Symbols:
    • spawn_ctx_t (struct, line 9)
    • spawn_backup (function, line 28) int spawn_backup(spawn_ctx_t *ctx);
    • spawn_restore (function, line 31) void spawn_restore(spawn_ctx_t *ctx);
    • spawn_validate_argv (function, line 34) int spawn_validate_argv(int argc, const char **uargv);
    • spawn_copy_argv (function, line 39) char **spawn_copy_argv(int argc, const char **uargv);
    • spawn_free_argv (function, line 42) void spawn_free_argv(char **kargv, int argc);
    • spawn_load_image (function, line 45) unsigned char *spawn_load_image(const char *resolved, unsigned *size_out);
    • spawn_execute (function, line 48) int spawn_execute(const char *resolved, const char *redirect, unsigned char *data, unsigned data_size, int argc...
    • SPAWN_H (macro, line 2) #define SPAWN_H
  • Depends on: headers/kernel.h, headers/sched.h, headers/vma.h
  • Imported by: kernel/sched.c, kernel/shell.c, kernel/spawn.c, kernel/syscalls.c

headers/spinlock.h

  • Doc: Lightweight spinlock for MiniOS kernel.
  • Layer: utility
  • Language: h
  • Symbols:
    • spinlock_t (struct, line 38)
    • irqflags_t (type_alias, line 41) typedef unsigned long irqflags_t;
    • spin_init (function, line 46) static inline void spin_init(spinlock_t *lock)
    • spin_save_irq (function, line 56) static inline irqflags_t spin_save_irq(void)
    • spin_restore_irq (function, line 57) static inline void spin_restore_irq(irqflags_t flags)
    • spin_lock (function, line 58) static inline void spin_lock(spinlock_t *lock)
    • spin_unlock (function, line 64) static inline void spin_unlock(spinlock_t *lock)
    • spin_lock_irqsave (function, line 68) static inline void spin_lock_irqsave(spinlock_t *lock, irqflags_t *flags)
    • spin_unlock_irqrestore (function, line 75) static inline void spin_unlock_irqrestore(spinlock_t *lock, irqflags_t flags)
    • spin_unlock_keep_irq (function, line 80) static inline void spin_unlock_keep_irq(spinlock_t *lock)
    • spin_trylock (function, line 84) static inline int spin_trylock(spinlock_t *lock)
    • spin_save_irq (function, line 92) static inline irqflags_t spin_save_irq(void)
    • spin_restore_irq (function, line 99) static inline void spin_restore_irq(irqflags_t flags)
    • spin_lock (function, line 107) static inline void spin_lock(spinlock_t *lock)
    • spin_unlock (function, line 118) static inline void spin_unlock(spinlock_t *lock)
    • spin_unlock_keep_irq (function, line 130) static inline void spin_unlock_keep_irq(spinlock_t *lock)
    • spin_unlock_irqrestore (function, line 150) static inline void spin_unlock_irqrestore(spinlock_t *lock, irqflags_t flags)
    • SPINLOCK_H (macro, line 2) #define SPINLOCK_H
    • SPINLOCK_INIT (macro, line 44) #define SPINLOCK_INIT
  • Imported by: drivers/pcm2.c, headers/futex.h, headers/kernel.h, headers/percpu_rq.h, headers/rcu.h, headers/sched.h, headers/smp.h, headers/sync.h, kernel/mm/tlb.c

headers/sync.h

  • Doc: Blocking synchronization primitives (roadmap Phase 3.1).
  • Layer: utility
  • Language: h
  • Symbols:
    • wait_queue_t (struct, line 42)
    • mutex_t (struct, line 63)
    • sem_t (struct, line 81)
    • cond_t (struct, line 97)
    • rwlock_t (struct, line 114)
    • wq_init (function, line 50) void wq_init(wait_queue_t *q);
    • sleep_on (function, line 51) void sleep_on(wait_queue_t *q);
    • wake_up (function, line 52) int wake_up(wait_queue_t *q);
    • wake_up_all (function, line 53) int wake_up_all(wait_queue_t *q);
    • inheritance (function, line 56) * Priority inheritance (thesis correction 3): a low-priority holder that * blocks a high-priority waiter is boosted...
    • mutex_init (function, line 72) void mutex_init(mutex_t *m);
    • mutex_lock (function, line 73) void mutex_lock(mutex_t *m);
    • mutex_unlock (function, line 74) void mutex_unlock(mutex_t *m);
    • mutex_trylock (function, line 75) int mutex_trylock(mutex_t *m);
    • mutex_note_waiter (function, line 76) void mutex_note_waiter(mutex_t *m, int waiter);
    • pi_set_base (function, line 77) void pi_set_base(int pid, int prio);
    • pi_get_eff (function, line 78) int pi_get_eff(int pid);
    • sem_init (function, line 89) void sem_init(sem_t *s, int value);
    • sem_wait (function, line 90) void sem_wait(sem_t *s);
    • sem_post (function, line 91) void sem_post(sem_t *s);
    • cond_init (function, line 103) void cond_init(cond_t *c);
    • cond_wait (function, line 104) void cond_wait(cond_t *c, mutex_t *m);
    • cond_signal (function, line 105) void cond_signal(cond_t *c);
    • cond_broadcast (function, line 106) void cond_broadcast(cond_t *c);
    • rwlock_init (function, line 124) void rwlock_init(rwlock_t *rw);
    • rwlock_read_lock (function, line 125) void rwlock_read_lock(rwlock_t *rw);
    • rwlock_read_unlock (function, line 126) void rwlock_read_unlock(rwlock_t *rw);
    • rwlock_write_lock (function, line 127) void rwlock_write_lock(rwlock_t *rw);
    • rwlock_write_unlock (function, line 128) void rwlock_write_unlock(rwlock_t *rw);
    • now (function, line 130) * available right now (a reader never takes it while a writer waits). */ int rwlock_read_trylock(rwlock_t *rw);
    • rwlock_write_trylock (function, line 132) int rwlock_write_trylock(rwlock_t *rw);
    • SYNC_H (macro, line 2) #define SYNC_H
    • WQ_NONE (macro, line 39) #define WQ_NONE
    • WAIT_QUEUE_INIT (macro, line 48) #define WAIT_QUEUE_INIT
    • MUTEX_INIT (macro, line 70) #define MUTEX_INIT
    • SEM_INIT (macro, line 87) #define SEM_INIT(n)
    • COND_INIT (macro, line 101) #define COND_INIT
    • RWLOCK_INIT (macro, line 122) #define RWLOCK_INIT
  • Depends on: headers/sched.h, headers/spinlock.h
  • Imported by: drivers/sb16.c, headers/futex.h, kernel/futex.c, kernel/sched.c, kernel/sync.c, kernel/syscalls.c, tests/test_sync.c

headers/syscall_asm.h

  • Doc: numeric contract for arch/x86/syscall_entry.S.
  • Layer: utility
  • Language: h
  • Symbols:
    • SYSCALL_ASM_H (macro, line 2) #define SYSCALL_ASM_H
    • SYSCALL_USER_WIN_LO (macro, line 15) #define SYSCALL_USER_WIN_LO
    • SYSCALL_USER_WIN_HI (macro, line 16) #define SYSCALL_USER_WIN_HI
    • SYSCALL_PROC_T_SIZE (macro, line 17) #define SYSCALL_PROC_T_SIZE
    • SYSCALL_PROC_KSTACK_OFF (macro, line 18) #define SYSCALL_PROC_KSTACK_OFF
    • SYSCALL_MAX_PROCS (macro, line 19) #define SYSCALL_MAX_PROCS
    • SYSCALL_CPU_CUR_PID_OFF (macro, line 20) #define SYSCALL_CPU_CUR_PID_OFF
    • SYSCALL_CPU_SC_N_OFF (macro, line 21) #define SYSCALL_CPU_SC_N_OFF
    • SYSCALL_CPU_SC_RIP_OFF (macro, line 22) #define SYSCALL_CPU_SC_RIP_OFF
    • SYSCALL_CPU_SC_PID_OFF (macro, line 23) #define SYSCALL_CPU_SC_PID_OFF
    • SYSCALL_CPU_SC_RET_OFF (macro, line 24) #define SYSCALL_CPU_SC_RET_OFF
    • SYSCALL_CPU_SC_TMP_OFF (macro, line 25) #define SYSCALL_CPU_SC_TMP_OFF
    • SYSCALL_FRAME_WORDS (macro, line 29) #define SYSCALL_FRAME_WORDS
  • Imported by: arch/x86/syscall_entry.S, kernel.c

Next: KB_headers_p5.md

Start

Wiki

Agent Docs

Recipes

Clone this wiki locally