include: one folder per subsystem, and includes that name it

Sixty-five headers sat side by side in include/, so `#include "irq.h"`
said nothing about where irq.h was or what it belonged to, and errno.h,
stat.h and fcntl.h at the top shadowed the system's for any host tool
built with -I./include. They are in folders now -- arch/ core/ fs/
dev/ gfx/ net/ uapi/ (and ldls/ for the Linux driver layer) -- and
every include names the folder, as Linux's do: "core/proc.h".

Done mechanically and checked the hard way: the kernel built from this
tree disassembles identically to the one built from the tree before
it. The full image boots, and userland is the same set of programs.
Paths in docs and comments follow; docs/guides/layout.md has a table
of what is where, and tools/fix-includes.py rewrites old-style
includes from the folders in the tree, for code written before this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S1giNvrHTrPMPw7V6x1kQ4
This commit is contained in:
Nexoniarz 2026-10-23 15:05:12 +02:00
commit a1c965da1e
267 changed files with 1560 additions and 1440 deletions

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
//
// What the kernel uses AML for. See include/acpi.h.
// What the kernel uses AML for. See include/dev/acpi.h.
//
// Interrupt routing is the reason this exists. A PCI device's config space
// names an interrupt line, but that number is the 8259's: the firmware
@ -16,15 +16,15 @@
// power button powers it off cleanly, and power-off and reset go through the
// firmware's own registers rather than an emulator's magic ports.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "x86.h"
#include "spinlock.h"
#include "pci.h"
#include "irq.h"
#include "acpi.h"
#include "fat.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/x86.h"
#include "core/spinlock.h"
#include "dev/pci.h"
#include "core/irq.h"
#include "dev/acpi.h"
#include "fs/fat.h"
#include <uacpi/uacpi.h>
#include <uacpi/utilities.h>

View file

@ -17,18 +17,18 @@
// uacpi_kernel_schedule_work(), from interrupt context, where AML must not
// run. That is the "acpi" kernel thread's whole job.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "x86.h"
#include "spinlock.h"
#include "proc.h"
#include "irq.h"
#include "dma.h"
#include "kmem.h"
#include "acpi.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "arch/x86.h"
#include "core/spinlock.h"
#include "core/proc.h"
#include "core/irq.h"
#include "core/dma.h"
#include "core/kmem.h"
#include "dev/acpi.h"
#include <uacpi/kernel_api.h>

View file

@ -16,17 +16,17 @@
// Written from the ACPI specification. No table layout here is copied from
// another kernel; they are all in chapter 5 of the published standard.
#include "types.h"
#include "hwinfo.h"
#include "defs.h"
#include "schboot.h" // SCHBOOT_RSDP_ADDR: the loader/kernel hand-off
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "x86.h"
#include "irq.h"
#include "acpi.h"
#include "core/types.h"
#include "core/hwinfo.h"
#include "core/defs.h"
#include "arch/schboot.h" // SCHBOOT_RSDP_ADDR: the loader/kernel hand-off
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "arch/x86.h"
#include "core/irq.h"
#include "dev/acpi.h"
extern struct cpu cpus[NCPU];
extern int ncpu;

View file

@ -12,12 +12,12 @@
// use -- and leaves the result in low memory. stage2main.c already parses it to
// print detected RAM on the splash. The kernel simply never read it.
#include "types.h"
#include "defs.h"
#include "memlayout.h"
#include "mmu.h"
#include "dma.h" // DMA_ARENA_BYTES: the top of PHYSTOP must be able to hold it
#include "hwinfo.h"
#include "core/types.h"
#include "core/defs.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/dma.h" // DMA_ARENA_BYTES: the top of PHYSTOP must be able to hold it
#include "core/hwinfo.h"
// Set before kinit1() and never again. Starts at the old constant so that a
// crash between entry and e820_init() behaves the way it always did rather
@ -29,13 +29,13 @@ uint64 phystop = PHYSTOP_FALLBACK;
// map and all a 32-bit device can reach.
uint64 lowtop = PHYSTOP_FALLBACK;
#include "schboot.h" /* the hand-off block */
#include "arch/schboot.h" /* the hand-off block */
#define E820_USABLE 1
#define E820_MAXENTRIES SCHBOOT_E820_MAX
// Every usable region, page aligned inwards and clipped to PHYSTOP_MAX.
// kinit1() frees these; see include/memlayout.h for why a list and not just a
// kinit1() frees these; see include/arch/memlayout.h for why a list and not just a
// top address.
struct memregion mem_usable[MEMREGION_MAX];
int nmem_usable;

View file

@ -26,8 +26,8 @@
#define mboot_magic 0x1badb002
#define mboot_flags 0x00010000
#include "mmu.h"
#include "schboot.h"
#include "arch/mmu.h"
#include "arch/schboot.h"
/* A second entry point, for firmware that has already put us in long mode.
*

View file

@ -1,6 +1,6 @@
#include "asm.h"
#include "memlayout.h"
#include "mmu.h"
#include "arch/asm.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
# Each non-boot CPU ("AP") is started up in response to a STARTUP
# IPI from the boot CPU. Section B.4.2 of the Multi-Processor

View file

@ -2,14 +2,14 @@
// http://www.intel.com/design/chipsets/datashts/29056601.pdf
// See also picirq.c.
#include "types.h"
#include "defs.h"
#include "traps.h"
#include "memlayout.h"
#include "mmu.h"
#include "mp.h"
#include "param.h"
#include "proc.h"
#include "core/types.h"
#include "core/defs.h"
#include "arch/traps.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "arch/mp.h"
#include "core/param.h"
#include "core/proc.h"
#define REG_ID 0x00 // Register index: ID
@ -88,7 +88,7 @@ ioapicroute(int irq, int cpunum, int level_low)
{
uint lo = T_IRQ0 + irq;
// A mode from include/irq.h; 1, the PCI case, is what `level_low` meant
// A mode from include/core/irq.h; 1, the PCI case, is what `level_low` meant
// when it was a flag.
if(level_low == 1 || level_low == 2)
lo |= INT_LEVEL;

View file

@ -1,11 +1,11 @@
// The TSS I/O permission bitmap. See include/ioperm.h for why.
// The TSS I/O permission bitmap. See include/arch/ioperm.h for why.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "mmu.h"
#include "proc.h"
#include "ioperm.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "arch/ioperm.h"
// The 64-bit TSS, written out rather than indexed.
//

View file

@ -1,15 +1,15 @@
// The local APIC manages internal (non-I/O) interrupts.
// See Chapter 8 & Appendix C of Intel processor manual volume 3.
#include "param.h"
#include "types.h"
#include "defs.h"
#include "date.h"
#include "memlayout.h"
#include "traps.h"
#include "mmu.h"
#include "x86.h"
#include "proc.h" // ncpu
#include "core/param.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/date.h"
#include "arch/memlayout.h"
#include "arch/traps.h"
#include "arch/mmu.h"
#include "arch/x86.h"
#include "core/proc.h" // ncpu
// Local APIC registers, divided by 4 for use as uint[] indices.
#define ID (0x0020/4) // ID

View file

@ -2,14 +2,14 @@
// Search memory for MP description structures.
// http://developer.intel.com/design/pentium/datashts/24201606.pdf
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mp.h"
#include "x86.h"
#include "mmu.h"
#include "proc.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mp.h"
#include "arch/x86.h"
#include "arch/mmu.h"
#include "core/proc.h"
struct cpu cpus[NCPU];
// Processors the firmware says exist.

View file

@ -1,14 +1,14 @@
#include "types.h"
#include "defs.h"
#include "irq.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "x86.h"
#include "traps.h"
#include "spinlock.h"
#include "posix.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/irq.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "arch/x86.h"
#include "arch/traps.h"
#include "core/spinlock.h"
#include "uapi/posix.h"
uint *idt;
extern addr_t vectors[];
@ -139,7 +139,7 @@ trap(struct trapframe *tf)
// interrupts used to be listed here one case at a time, which cannot work
// for anything found on the PCI bus: a driver does not know its line
// until it reads the device's config space at probe time, so there is no
// constant to write a case label for. See include/irq.h.
// constant to write a case label for. See include/core/irq.h.
if(tf->trapno >= T_IRQ0 && tf->trapno < T_IRQ0 + NIRQ){
irq_dispatch(tf->trapno - T_IRQ0);
lapiceoi();

View file

@ -9,7 +9,7 @@
# on EXIT to user (sysretq or iretq), write proc->fs_base to MSR.
#
# proc->fs_base is at byte offset 0x18 (24) inside struct proc.
# proc pointer is at %gs:24 (PERCPU_PROC in include/proc.h); cpu is at %gs:16.
# proc pointer is at %gs:24 (PERCPU_PROC in include/core/proc.h); cpu is at %gs:16.
# -----------------------------------------------------------------------
# Helper macro: write kernel_fs_base to IA32_FS_BASE.
@ -49,9 +49,9 @@
# Clobbers %rax, %rcx, %rdx. Caller must save them if needed.
# -----------------------------------------------------------------------
.macro WRITE_USER_FS
# proc, from the per-CPU block at %gs:24 (PERCPU_PROC in include/proc.h).
# proc, from the per-CPU block at %gs:24 (PERCPU_PROC in include/core/proc.h).
# This used to be %fs:(-8), the __thread slot, which no longer exists --
# see the comment in include/proc.h for why those stopped being __thread.
# see the comment in include/core/proc.h for why those stopped being __thread.
movq %gs:24, %rax # proc pointer
movq 0x18(%rax), %rax # proc->fs_base (offset 24 = 0x18)
movq %rax, %rdx

View file

@ -1,13 +1,13 @@
#include "param.h"
#include "types.h"
#include "defs.h"
#include "gfx.h"
#include "x86.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "ioperm.h"
#include "vmap.h"
#include "core/param.h"
#include "core/types.h"
#include "core/defs.h"
#include "gfx/gfx.h"
#include "arch/x86.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "arch/ioperm.h"
#include "arch/vmap.h"
int mappages(pml4e_t *pgdir, void *va, addr_t size, addr_t pa, int perm);
static pte_t * walkpgdir(pml4e_t *pml4, const void *va, int alloc);
@ -15,7 +15,7 @@ static pte_t * walkpgdir(pml4e_t *pml4, const void *va, int alloc);
// `cpu` and `proc` are no longer __thread variables; they live at fixed offsets
// in the per-CPU block and are read through %gs at each use. See the long
// comment in include/proc.h for why -- the short version is that __thread means
// comment in include/core/proc.h for why -- the short version is that __thread means
// per *thread*, the compiler caches the thread pointer across calls on that
// basis, and a kernel thread changes CPU at every sched().
@ -113,7 +113,7 @@ seginit(void)
gdt = (struct segdesc*) local;
// The TSS moved out of this page. It now carries an I/O permission bitmap
// (include/ioperm.h) which does not fit here, and it has to be one object
// (include/arch/ioperm.h) which does not fit here, and it has to be one object
// with it. ioperm_tss() returns it and the descriptor limit that reaches the
// end of the bitmap.
tss = (uint*) ioperm_tss(cpunum(), &tsslim);
@ -136,7 +136,7 @@ seginit(void)
*(uint64 *) kernel_fs_base = kernel_fs_base;
// Clear the per-CPU slots before anything can read them. Their offsets are
// the PERCPU_* constants in include/proc.h and are shared with trapasm.S,
// the PERCPU_* constants in include/core/proc.h and are shared with trapasm.S,
// which reads %gs:24 for proc on the way out to user mode and parks three
// registers at %gs:32..48 across the FS_BASE swap on the way in.
((uint64 *) kernel_fs_base)[2] = 0; // struct cpu * (PERCPU_CPU)
@ -339,7 +339,7 @@ ioremap(uint64 pa, uint64 size)
// --- write-combining, and big buffers -----------------------------------------
//
// See include/vmap.h. The console used to draw straight into the framebuffer
// See include/arch/vmap.h. The console used to draw straight into the framebuffer
// through the direct map, which is uncached across the whole PCI hole: every
// store was its own bus transaction and every read -- a scroll is a memmove,
// so a read for every byte on screen -- waited on the card. In QEMU that is

View file

@ -27,16 +27,16 @@
// has moved. Worst case a watchpoint takes one tick to cover a CPU, and the
// cost when nothing has changed is one comparison per tick.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "x86.h"
#include "proc.h"
#include "traps.h"
#include "sbuf.h"
#include "dbg.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "arch/x86.h"
#include "core/proc.h"
#include "arch/traps.h"
#include "core/sbuf.h"
#include "core/dbg.h"
#define NWATCH 4 // DR0..DR3, and there are no more

View file

@ -1,25 +1,25 @@
#include <stdarg.h>
#include "types.h"
#include "defs.h"
#include "klog.h"
#include "dbg.h"
#include "vt.h"
#include "kbd.h" /* KBD_VT_SWITCH -- the terminal-switch chords */
#include "gfx.h"
#include "theme.h"
#include "irq.h"
#include "param.h"
#include "traps.h"
#include "errno.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "posix.h"
#include "x86.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/klog.h"
#include "core/dbg.h"
#include "dev/vt.h"
#include "dev/kbd.h" /* KBD_VT_SWITCH -- the terminal-switch chords */
#include "gfx/gfx.h"
#include "gfx/theme.h"
#include "core/irq.h"
#include "core/param.h"
#include "arch/traps.h"
#include "uapi/errno.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "uapi/posix.h"
#include "arch/x86.h"
void consputc(int);
// Set by panic() once the crash screen has been painted: after that, consputc
@ -268,7 +268,7 @@ consputc(int c)
// Every kernel message passes through here, which is what makes this the
// one hook the log needs: cprintf, panic's report, a driver's complaint at
// three in the morning. See include/klog.h.
// three in the morning. See include/core/klog.h.
klog_putc(c);
// Held back from the screen and the wire, kept in the log. See kinfo().
@ -584,7 +584,7 @@ consoleintr(int (*getc)(void))
// three-byte character, so a reader decoding UTF-8 swallowed the next two
// keys waiting for continuations that never came -- every arrow key
// corrupted the two keystrokes after it. The keycodes now sit above
// U+10FFFF where nothing can collide with them; see include/kbd.h.
// U+10FFFF where nothing can collide with them; see include/dev/kbd.h.
//
// What a terminal sends is `ESC [ A`, and what makes zsh's line editor
// work is receiving that. The sequences below are the DEC/xterm ones that

View file

@ -1,14 +1,14 @@
// Physically contiguous memory for devices. See include/dma.h.
// Physically contiguous memory for devices. See include/core/dma.h.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "spinlock.h"
#include "dma.h"
#include "sbuf.h"
#include "dbg.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/spinlock.h"
#include "core/dma.h"
#include "core/sbuf.h"
#include "core/dbg.h"
#define DMA_GRAIN 64 // one cache line; also xHCI's ring alignment
#define NEXTENT 64 // free extents we can track

View file

@ -2,14 +2,14 @@
// memory for user processes, kernel stacks, page table pages,
// and pipe buffers. Allocates 4096-byte pages.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "spinlock.h"
#include "sbuf.h"
#include "dbg.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/spinlock.h"
#include "core/sbuf.h"
#include "core/dbg.h"
void freerange(void *vstart, void *vend);
extern char end[]; // first address after kernel loaded from ELF file

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
//
// The kernel log that outlives the kernel. See include/klog.h.
// The kernel log that outlives the kernel. See include/core/klog.h.
//
// Two properties are worth reading the code for, because both are easy to
// write and easy to get subtly wrong:
@ -20,12 +20,12 @@
// early output goes into a small static array and is flushed into the ring the
// moment there is one.
#include "types.h"
#include "defs.h"
#include "memlayout.h"
#include "klog.h"
#include "sbuf.h"
#include "dbg.h"
#include "core/types.h"
#include "core/defs.h"
#include "arch/memlayout.h"
#include "core/klog.h"
#include "core/sbuf.h"
#include "core/dbg.h"
// consputc()'s cursor-movement escape, from kernel/core/console.c.
#define BACKSPACE 0x100

View file

@ -1,4 +1,4 @@
// Small-object allocation. See include/kmem.h for what this is for.
// Small-object allocation. See include/core/kmem.h for what this is for.
//
// A slab is one page from kalloc(), with a header at the front and objects
// packed after it. Free objects hold the free list in their own first eight
@ -35,15 +35,15 @@ static void acquire(struct spinlock *l) { (void)l; }
static void release(struct spinlock *l) { (void)l; }
#define PGROUNDDOWN(a) (((uint64)(a)) & ~((uint64)PGSIZE - 1))
#else
#include "types.h"
#include "defs.h"
#include "param.h"
#include "mmu.h"
#include "spinlock.h"
#include "sbuf.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/mmu.h"
#include "core/spinlock.h"
#include "core/sbuf.h"
#endif
#include "kmem.h"
#include "core/kmem.h"
// Objects are 16-byte aligned. Eight would be enough for the free list, but
// sixteen is what the ABI wants for anything that might hold a long double or

View file

@ -14,8 +14,8 @@
// checks that rather than trusting it, by listing the text symbols of both
// passes and refusing to build if they differ.
#include "types.h"
#include "defs.h"
#include "core/types.h"
#include "core/defs.h"
// Weak, and the reason is worth stating: the first link pass has no table --
// it is the input to the program that writes one. An undefined weak symbol

View file

@ -1,19 +1,19 @@
#include "types.h"
#include "defs.h"
#include "vt.h"
#include "gfx.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "x86.h"
#include "irq.h"
#include "dma.h"
#include "klog.h"
#include "usb.h"
#include "acpi.h"
#include "vmap.h"
#include "hwinfo.h"
#include "core/types.h"
#include "core/defs.h"
#include "dev/vt.h"
#include "gfx/gfx.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "arch/x86.h"
#include "core/irq.h"
#include "core/dma.h"
#include "core/klog.h"
#include "dev/usb.h"
#include "dev/acpi.h"
#include "arch/vmap.h"
#include "core/hwinfo.h"
static void *klog_base; // the persistent log, just above the kernel image
@ -37,7 +37,7 @@ int boot_debug;
// Must match SCHBOOT_VERBOSE_FLAG in boot/bios/stage2main.c exactly: just past
// the VBE info block, not 0x7000 (startothers() below uses that address for
// the AP boot trampoline).
#include "schboot.h"
#include "arch/schboot.h"
// Bootstrap processor starts running C code here.
// Allocate a real stack and switch to it, first
@ -174,7 +174,7 @@ kmain(uint32 fb_addr)
// kalloc's free list makes no such promise -- two pages from it are adjacent
// only by chance. Taking it first is the only way to be sure the region
// exists; asking for it later would mean asking kalloc for something it
// fundamentally cannot provide. See include/dma.h.
// fundamentally cannot provide. See include/core/dma.h.
// Before anything touches PHYSTOP, which is now a variable read from the
// firmware's memory map rather than a constant asserting 224 MB exists.
e820_init();
@ -295,7 +295,7 @@ kmain(uint32 fb_addr)
//
// main() names no display driver. Whichever one owns the boot framebuffer
// publishes it there as this kernel's scanout, and the console and crash
// screen draw on that; see include/gfx.h.
// screen draw on that; see include/gfx/gfx.h.
//
// No splash drawing here on purpose. The loader owns the splash, logo and
// all, and bringing the framebuffer up deliberately does not clear it -- so
@ -357,7 +357,7 @@ kmain(uint32 fb_addr)
// every entry from user mode, so both CPUs shared one per-CPU block.
// 4. `cpu` and `proc` were __thread. That means per *thread*, so the compiler
// cached the thread pointer across calls -- but %fs here is per *CPU*, and
// a kernel thread changes CPU at every sched(). See include/proc.h.
// a kernel thread changes CPU at every sched(). See include/core/proc.h.
// 5. The new per-CPU slots collided with syscall_entry's scratch word at
// %fs:(8), which is the same memory as %gs:8.
//

View file

@ -26,25 +26,25 @@
// what tools/bootcheck.ps1 reads, and it is what you get when the crash happens
// before there is a framebuffer at all.
#include "types.h"
#include "kbd.h"
#include "x86.h"
#include "defs.h"
#include "gfx.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "x86.h"
#include "proc.h"
#include "spinlock.h"
#include "core/types.h"
#include "dev/kbd.h"
#include "arch/x86.h"
#include "core/defs.h"
#include "gfx/gfx.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "arch/x86.h"
#include "core/proc.h"
#include "core/spinlock.h"
// Purple, because the name says so, and white on it because nothing else is
// legible at every brightness a monitor might be set to. The palette lives in
// theme.h with everything else; this file used to keep its own copy under the
// same names but with different values, which meant theme.h described a crash
// screen nobody had ever seen.
#include "theme.h"
#include "logo.h" /* LOGO_H -- the mark's height, for the layout below */
#include "qr.h"
#include "gfx/theme.h"
#include "gfx/logo.h" /* LOGO_H -- the mark's height, for the layout below */
#include "gfx/qr.h"
extern uint ticks;
extern int panicked;
@ -431,7 +431,7 @@ paint(char *reason, addr_t *pcs, int npcs)
if (y + LOGO_H + ch * 2 + body > foot)
logo = 0;
// Shift, the system's own mark, from the same include/logo.h the loader
// Shift, the system's own mark, from the same include/gfx/logo.h the loader
// splash and the boot console draw. It replaces Guru, a chamfered face that
// lived only here and was drawn from primitives a few lines up this file.
//
@ -494,7 +494,7 @@ paint(char *reason, addr_t *pcs, int npcs)
//
// What replaces it is the thing nobody would guess: **this screen is no
// longer the only copy.** The log survives into the next boot (see
// include/klog.h), so the right instruction on a crash screen is now
// include/core/klog.h), so the right instruction on a crash screen is now
// "restart and read it" rather than "photograph this".
//
// Kept under about 45 characters each: the QR card is on the right, and the

View file

@ -1,4 +1,4 @@
// QR encoder. See include/qr.h for why it exists and why it is this small.
// QR encoder. See include/gfx/qr.h for why it exists and why it is this small.
//
// Freestanding on purpose: no allocation, no floating point, no libc beyond
// memset/memmove. It has to run in panic context, where the heap may be exactly
@ -21,11 +21,11 @@
#ifdef QR_HOST
#include <string.h>
#else
#include "types.h"
#include "defs.h"
#include "core/types.h"
#include "core/defs.h"
#endif
#include "qr.h"
#include "gfx/qr.h"
// ---------------------------------------------------------------------------
// Version table

View file

@ -1,10 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-or-later
//
// The bounded string builder. See include/sbuf.h for what it is and why it
// The bounded string builder. See include/core/sbuf.h for what it is and why it
// moved out of kernel/dev/procfs.c.
#include "types.h"
#include "sbuf.h"
#include "core/types.h"
#include "core/sbuf.h"
void
sb_putc(struct sbuf *sb, char c)

View file

@ -1,14 +1,14 @@
// Sleeping locks
#include "types.h"
#include "defs.h"
#include "param.h"
#include "x86.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/x86.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
void
initsleeplock(struct sleeplock *lk, char *name)

View file

@ -1,11 +1,11 @@
#include "types.h"
#include "defs.h"
#include "param.h"
#include "x86.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "spinlock.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/x86.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "core/spinlock.h"
void
initlock(struct spinlock *lk, char *name)

View file

@ -1,5 +1,5 @@
#include "types.h"
#include "x86.h"
#include "core/types.h"
#include "arch/x86.h"
void*
memset(void *dst, int c, uint64 n)

View file

@ -17,12 +17,12 @@
// mid-update) so reading it on every gettimeofday would be absurd; and `ticks`
// is a perfectly good interval clock once it has something to count from.
#include "types.h"
#include "defs.h"
#include "x86.h"
#include "date.h"
#include "param.h"
#include "spinlock.h"
#include "core/types.h"
#include "core/defs.h"
#include "arch/x86.h"
#include "core/date.h"
#include "core/param.h"
#include "core/spinlock.h"
extern uint ticks;

View file

@ -1,4 +1,4 @@
// User-memory access helpers — see include/uaccess.h for the rules.
// User-memory access helpers — see include/core/uaccess.h for the rules.
//
// Everything here validates against the *current* process's page table
// (myproc()->pgdir), which is also the live CR3 while a syscall runs, so a
@ -6,14 +6,14 @@
// code for the remainder of the syscall (single-threaded processes can't
// unmap it out from under us mid-call).
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "errno.h"
#include "uaccess.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "uapi/errno.h"
#include "core/uaccess.h"
int
access_ok(addr_t uaddr, uint64 size)

View file

@ -1,22 +1,22 @@
// AudioEngine: the audio class, and /dev/dsp above it.
//
// See include/audio.h for what this is and what it deliberately is not. In
// See include/dev/audio.h for what this is and what it deliberately is not. In
// short: a program opens /dev/dsp, says what its samples are, writes them, and
// stops. Everything here is either the class vtable's thin wrapper or the part
// of "play this" that is not specific to a chip.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "device.h"
#include "audio.h"
#include "proc.h"
#include "uaccess.h"
#include "errno.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "dev/device.h"
#include "dev/audio.h"
#include "core/proc.h"
#include "core/uaccess.h"
#include "uapi/errno.h"
static struct spinlock audio_lock;
static int audio_lock_init;

View file

@ -18,19 +18,19 @@
// * B_DIRTY: the buffer data has been modified
// and needs to be written to disk.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "x86.h"
#include "fsstat.h"
#include "blkdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#include "arch/x86.h"
#include "fs/fsstat.h"
#include "fs/blkdev.h"
#include "kmem.h"
#include "hwinfo.h"
#include "core/kmem.h"
#include "core/hwinfo.h"
struct fsstat fsstat;
@ -199,7 +199,7 @@ bdevrw_inner(struct buf *b)
return;
}
// SATA, NVMe and every partition: registered at probe time rather than
// known at build time. See include/blkdev.h.
// known at build time. See include/fs/blkdev.h.
if(b->dev >= BLKDEV_FIRST){
blkdev_rw(b);
return;

View file

@ -1,16 +1,16 @@
// SPDX-License-Identifier: GPL-2.0-or-later
//
// The block device registry, and the partition tables on what is in it.
// See include/blkdev.h.
// See include/fs/blkdev.h.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "blkdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#include "fs/blkdev.h"
struct blkdev {
int used;

View file

@ -1,12 +1,12 @@
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "x86.h"
#include "errno.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "arch/x86.h"
#include "uapi/errno.h"
extern int consoleread(struct inode*, uint64, char*, int);
extern int consolewrite(struct inode*, uint64, char*, int);
@ -203,14 +203,14 @@ struct devsw devsw[] = {
[8] = { diskread, diskwrite },
// /dev/pci (major 9) -- PCI devices reachable from userspace, for drivers
// that do not live in the kernel. Registers arrive through mmap and
// everything else through ioctl; see include/pciuser.h.
// everything else through ioctl; see include/dev/pciuser.h.
[9] = { pciuser_read, pciuser_write },
// /dev/dbg (major 10) -- ask the kernel a question. Write a line, read the
// answer; see include/dbg.h and docs/architecture/debugging.md.
// answer; see include/core/dbg.h and docs/architecture/debugging.md.
[10] = { dbg_read, dbg_write },
// /dev/netdev (major 11) -- a process, being a network interface. The
// reverse of major 9: that hands a device to a process, this lets a process
// be one. See include/netuser.h.
// be one. See include/net/netuser.h.
[11] = { netuser_read, netuser_write, netuser_ready },
// /dev/dsp (major 12) -- UNIX audio, kernel/dev/audio.c. Write PCM to it.
// The close hook plays out what is still queued: a program that writes a

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
//
// /dev/dbg -- asking the kernel a question. See include/dbg.h.
// /dev/dbg -- asking the kernel a question. See include/core/dbg.h.
//
// The device is a conversation: write a line, read the answer.
//
@ -17,18 +17,18 @@
// other's. Making it per-open would mean a struct file hook for something that
// has exactly one user.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "errno.h"
#include "sbuf.h"
#include "memlayout.h"
#include "mmu.h"
#include "dbg.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "uapi/errno.h"
#include "core/sbuf.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/dbg.h"
#define NVIEW 24
#define DBGBUF (16 * 1024)

View file

@ -1,4 +1,4 @@
// The device model. See include/device.h for why it exists.
// The device model. See include/dev/device.h for why it exists.
//
// A fixed table rather than a linked list: this is populated once during boot
// by whichever bus found each device, and read afterwards. Nothing is removed
@ -10,19 +10,19 @@
// enumerates at runtime -- USB hotplug is the obvious one -- this needs a
// spinlock, and the reader in procfs needs to take it.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "device.h"
#include "display.h"
#include "netdev.h"
#include "theme.h"
#include "text.h"
#include "spinlock.h"
#include "gfx.h"
#include "pci.h"
#include "mmu.h"
#include "memlayout.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "dev/device.h"
#include "gfx/display.h"
#include "dev/netdev.h"
#include "gfx/theme.h"
#include "gfx/text.h"
#include "core/spinlock.h"
#include "gfx/gfx.h"
#include "dev/pci.h"
#include "arch/mmu.h"
#include "arch/memlayout.h"
static struct device devices[NDEVICE];
static int ndevices;
@ -187,7 +187,7 @@ display_present(int x, int y, int w, int h)
// Where this display's pixels actually end up. 0 when the driver does not say,
// which callers must read as "assume it is the console's" -- see the comment
// on scanout_phys in include/display.h.
// on scanout_phys in include/gfx/display.h.
uint64
display_scanout_phys(void)
{
@ -229,7 +229,7 @@ display_wait_vblank(void)
//
// The second is the one worth having. It is also the one that only works
// because the userspace driver said in advance where it was scanning out --
// see PCIIOC_PANICFB in include/pciuser.h.
// see PCIIOC_PANICFB in include/dev/pciuser.h.
// Copy the console framebuffer into a surface, with the same rules vgpud's
// mirror uses: the overlap, centred if the surface is larger, top-left if it
@ -546,7 +546,7 @@ text_selftest(void)
}
// ---------------------------------------------------------------------------
// The network class. See include/netdev.h.
// The network class. See include/dev/netdev.h.
//
// Plural where the display class is singular: a machine with two NICs is
// ordinary, and "the network" is not a thing a stack can ask for the way a

View file

@ -21,16 +21,16 @@
// own copy. That is inherent to a raw device and not a defect -- but it is why
// an installer must target a disk it has not mounted.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "file.h"
#include "errno.h"
#include "blkdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#include "fs/file.h"
#include "uapi/errno.h"
#include "fs/blkdev.h"
// The byte offset is 64-bit, all the way from struct file's off through the
// devsw signature to bread's block number. It used to narrow to a 32-bit uint

View file

@ -13,11 +13,11 @@
// handed over by the UEFI loader from the configuration table, or found by the
// BIOS-era scan of 0xF0000-0xFFFFF when it was not.
#include "types.h"
#include "defs.h"
#include "memlayout.h"
#include "schboot.h"
#include "hwinfo.h"
#include "core/types.h"
#include "core/defs.h"
#include "arch/memlayout.h"
#include "arch/schboot.h"
#include "core/hwinfo.h"
static int tried;
static uint64 ep_pa; static uint32 ep_len;

View file

@ -11,19 +11,19 @@
// what makes the device inspectable from a shell, which is worth a great deal
// while there is no GUI yet to inspect it with.
#include "types.h"
#include "defs.h"
#include "gfx.h"
#include "param.h"
#include "mmu.h"
#include "proc.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "fb.h"
#include "uaccess.h"
#include "errno.h"
#include "core/types.h"
#include "core/defs.h"
#include "gfx/gfx.h"
#include "core/param.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "gfx/fb.h"
#include "core/uaccess.h"
#include "uapi/errno.h"
// Describe one colour channel. A channel that does not exist gets length 0,
// which is how callers are supposed to detect "no alpha" rather than by

View file

@ -1,4 +1,4 @@
// Drawing and the text console, on whatever display is bound. See include/gfx.h
// Drawing and the text console, on whatever display is bound. See include/gfx/gfx.h
// for why this is not a driver and does not name one.
//
// It was kernel/dev/vga.c, and the name was the problem: panic.c called
@ -11,20 +11,20 @@
// out of the boot block here. That is the whole of the inversion: a driver
// publishes what it owns, and this file draws on it without knowing what it is.
#include "types.h"
#include "x86.h"
#include "memlayout.h"
#include "defs.h"
#include "theme.h"
#include "logo.h"
#include "device.h"
#include "display.h"
#include "gfx.h"
#include "vt.h"
#include "text.h"
#include "schboot.h"
#include "ttf.h"
#include "vmap.h"
#include "core/types.h"
#include "arch/x86.h"
#include "arch/memlayout.h"
#include "core/defs.h"
#include "gfx/theme.h"
#include "gfx/logo.h"
#include "dev/device.h"
#include "gfx/display.h"
#include "gfx/gfx.h"
#include "dev/vt.h"
#include "gfx/text.h"
#include "arch/schboot.h"
#include "gfx/ttf.h"
#include "arch/vmap.h"
#define BACKSPACE 0x100
#define COLOR_BG SCH_BG

View file

@ -1,18 +1,18 @@
// Simple PIO-based (non-DMA) IDE driver code.
#include "types.h"
#include "defs.h"
#include "irq.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "x86.h"
#include "traps.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/irq.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "arch/x86.h"
#include "arch/traps.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#define SECTOR_SIZE 512
#define IDE_BSY 0x80

View file

@ -9,17 +9,17 @@
// grabs the pointer and leaves the keyboard alone, or the other way round, and
// merging them into a single stream makes that impossible to express.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "mmu.h"
#include "proc.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "input.h"
#include "errno.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "dev/input.h"
#include "uapi/errno.h"
#define NEVENT 256 // per device; ~10 seconds of frantic typing

View file

@ -1,12 +1,12 @@
// Hardware interrupt registration. See include/irq.h for why this exists.
// Hardware interrupt registration. See include/core/irq.h for why this exists.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "traps.h"
#include "spinlock.h"
#include "irq.h"
#include "x86.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/traps.h"
#include "core/spinlock.h"
#include "core/irq.h"
#include "arch/x86.h"
struct irq_action {
irq_handler_t fn;
@ -53,7 +53,7 @@ irq_init(void)
// vectors that xv6 numbered as though they were. The error vector used to be
// 19, which *is* a pin: one of the four an Intel chipset wires its PCI
// interrupts to, so a device there would have been refused. It is 30 now,
// above every pin; see include/traps.h.
// above every pin; see include/arch/traps.h.
static int
reserved(int irq)
{

View file

@ -1,16 +1,16 @@
#include "types.h"
#include "x86.h"
#include "defs.h"
#include "kbd.h"
#include "posix.h"
#include "vt.h" /* NVT -- how many terminals the chords reach */
#include "input.h"
#include "keymap.h"
#include "core/types.h"
#include "arch/x86.h"
#include "core/defs.h"
#include "dev/kbd.h"
#include "uapi/posix.h"
#include "dev/vt.h" /* NVT -- how many terminals the chords reach */
#include "dev/input.h"
#include "dev/keymap.h"
// The chord, settable at run time through VT_SETCHORD.
//
// AltGr+F1..F6 by default. Every other candidate is taken by the host, by
// applications, or by the keyboard layout -- see include/kbd.h -- and AltGr
// applications, or by the keyboard layout -- see include/dev/kbd.h -- and AltGr
// with a function key is taken by none of the three: a Polish layout wants
// AltGr+*letter*, which still reaches the shell untouched, and no window
// manager binds AltGr with an F-key.
@ -172,4 +172,4 @@ kbdintr(void)
// match, and the only symptom would be a key that does nothing.
_Static_assert(VTC_SHIFT == SHIFT && VTC_CTRL == CTL &&
VTC_ALT == ALT && VTC_RALT == RALT,
"include/posix.h VTC_* must mirror include/kbd.h modifiers");
"include/uapi/posix.h VTC_* must mirror include/dev/kbd.h modifiers");

View file

@ -1,4 +1,4 @@
// Keyboard layouts. See include/keymap.h for the interface and its limits.
// Keyboard layouts. See include/dev/keymap.h for the interface and its limits.
//
// Every table is indexed by set-1 scancode, with the E0-prefixed keys folded
// into 0x80..0xFF by kbd.c before the lookup -- the same numbering the single
@ -9,10 +9,10 @@
// exists: `ą` is U+0105 and does not fit in a byte, and a Polish layout that
// cannot type `ą` is not one.
#include "types.h"
#include "defs.h"
#include "kbd.h"
#include "keymap.h"
#include "core/types.h"
#include "core/defs.h"
#include "dev/kbd.h"
#include "dev/keymap.h"
// Shared by every layout that does not move the navigation block, which is
// all of them -- the arrow keys are not a national matter. Merged into each
@ -101,7 +101,7 @@ static const uint32 pl_shiftaltgr[256] = {
// keyboard does not have at all -- carries < > |.
//
// The acute (0x0D) and circumflex (0x29) keys are dead on a real German
// layout. Here they type the accent on its own. See include/keymap.h.
// layout. Here they type the accent on its own. See include/dev/keymap.h.
static const uint32 de_plain[256] = {
NO, 0x1B, '1', '2', '3', '4', '5', '6', // 0x00

View file

@ -1,13 +1,13 @@
#include "types.h"
#include "defs.h"
#include "gfx.h"
#include "irq.h"
#include "x86.h"
#include "traps.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "core/types.h"
#include "core/defs.h"
#include "gfx/gfx.h"
#include "core/irq.h"
#include "arch/x86.h"
#include "arch/traps.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#define KBD_S_STAT 0x64
#define KBD_S_DATA 0x60

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
//
// /dev/netdev -- a network interface whose backend is a process.
// See include/netuser.h.
// See include/net/netuser.h.
//
// The shape is `/dev/pci`'s, deliberately, and for the same reasons. One
// device, one owner, claimed and released, and the kernel takes it back when
@ -13,23 +13,23 @@
// and the process is the driver, so the queues run the other way and the
// vtable is ours rather than theirs.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "errno.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "uaccess.h"
#include "device.h"
#include "netdev.h"
#include "sbuf.h"
#include "dbg.h"
#include "netuser.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "uapi/errno.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "core/uaccess.h"
#include "dev/device.h"
#include "dev/netdev.h"
#include "core/sbuf.h"
#include "core/dbg.h"
#include "net/netuser.h"
struct frame {
int len;

View file

@ -12,23 +12,23 @@
// not there, and it cannot tell you which bridge a device sits behind -- and
// that matters as soon as interrupt routing does.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "x86.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "pci.h"
#include "sbuf.h"
#include "dbg.h"
#include "device.h"
#include "traps.h"
#include "irq.h"
#include "acpi.h"
#include "memlayout.h"
#include "proc.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/x86.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "dev/pci.h"
#include "core/sbuf.h"
#include "core/dbg.h"
#include "dev/device.h"
#include "arch/traps.h"
#include "core/irq.h"
#include "dev/acpi.h"
#include "arch/memlayout.h"
#include "core/proc.h"
static struct pci_dev devs[NPCI];
static int ndevs;

View file

@ -2,7 +2,7 @@
//
// /dev/pci -- PCI devices, reachable from userspace.
//
// See include/pciuser.h for what this is and why the interface is about PCI
// See include/dev/pciuser.h for what this is and why the interface is about PCI
// rather than about drivers. This file is the kernel half: enumeration, the
// claim, the check that makes mmap safe, and DMA memory a device can be
// pointed at.
@ -14,24 +14,24 @@
// have been told to let go first -- which for now means "do not claim a device
// the kernel is driving", enforced below rather than assumed.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "ioperm.h"
#include "pci.h"
#include "errno.h"
#include "uaccess.h"
#include "irq.h"
#include "pciuser.h"
#include "sbuf.h"
#include "dbg.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "arch/ioperm.h"
#include "dev/pci.h"
#include "uapi/errno.h"
#include "core/uaccess.h"
#include "core/irq.h"
#include "dev/pciuser.h"
#include "core/sbuf.h"
#include "core/dbg.h"
int mappages(pml4e_t *pgdir, void *va, uint64 size, uint64 pa, int perm);
// Who holds each device, or 0. Indexed the same way pci_get() is, because the
@ -50,7 +50,7 @@ static struct proc *owner[NPCI];
static const struct pci_driver *released_drv[NPCI];
// Where a userspace display driver is scanning out, so panic() can put the
// report there. See PCIIOC_PANICFB in include/pciuser.h.
// report there. See PCIIOC_PANICFB in include/dev/pciuser.h.
struct panicfb {
uint64 paddr;
uint32 width, height, stride;
@ -539,7 +539,7 @@ do_claim(uint64 argp)
// e1000's reset path issues `out` directly, because on an 82540 that is the
// only way the chip will acknowledge the write. So a process holding a
// device gets that device's I/O BARs and nothing else -- see
// include/ioperm.h. PCI_CMD_IO goes with them for the same reason memory
// include/arch/ioperm.h. PCI_CMD_IO goes with them for the same reason memory
// space goes with the mapping above.
{
int granted = 0;

View file

@ -15,33 +15,33 @@
// kernel/fs/procfs.c; this file only generates the *content* of the global
// files. `ps` and `top` work through the former.
#include "types.h"
#include "defs.h"
#include "klog.h"
#include "irq.h"
#include "x86.h"
#include "device.h"
#include "display.h"
#include "netdev.h"
#include "param.h"
#include "memlayout.h"
#include "hwinfo.h"
#include "mmu.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "file.h"
#include "proc.h"
#include "uaccess.h"
#include "errno.h"
#include "fsstat.h"
#include "schfs.h"
#include "sbuf.h"
#include "kmem.h"
#include "dbg.h"
#include "blkdev.h"
#include "fat.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/klog.h"
#include "core/irq.h"
#include "arch/x86.h"
#include "dev/device.h"
#include "gfx/display.h"
#include "dev/netdev.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "core/hwinfo.h"
#include "arch/mmu.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#include "fs/file.h"
#include "core/proc.h"
#include "core/uaccess.h"
#include "uapi/errno.h"
#include "fs/fsstat.h"
#include "fs/schfs.h"
#include "core/sbuf.h"
#include "core/kmem.h"
#include "core/dbg.h"
#include "fs/blkdev.h"
#include "fs/fat.h"
// Every generated file is rendered whole into one buffer and then sliced, so
// this is the largest any of them can be. It was 2048, which a 24-processor
@ -73,7 +73,7 @@ proc_genbuf_put(void)
}
// The formatting helpers these files are built out of now live in
// include/sbuf.h, because the debugger's introspection registry needs exactly
// include/core/sbuf.h, because the debugger's introspection registry needs exactly
// the same thing and two copies would have drifted. See docs/architecture/debugging.md.
// --- the files -------------------------------------------------------------

View file

@ -15,15 +15,15 @@
// Enabled by building with RAMROOT=1. Without it this file still compiles, the
// device reports zero size, and the kernel boots from the IDE disk as before.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#ifdef RAMDISK_ROOT
// Supplied by `ld -r -b binary` over build/fs-ram.img, renamed by objcopy.

View file

@ -1,19 +1,19 @@
// Text rendering. See include/text.h for what this replaces and why.
// Text rendering. See include/gfx/text.h for what this replaces and why.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "text.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "gfx/text.h"
// Included, now that this is the only file that reads it.
//
// It used to be `extern unsigned char font_data[256][16];` with a note
// explaining that include/font.h *defines* the array rather than declaring
// explaining that include/gfx/font.h *defines* the array rather than declaring
// it, so a second includer would break the link. The second includer was
// gfx.c, which walked the bitmap itself when there was no TrueType face --
// and that was the duplicate glyph path. With it gone, the header can live
// with its one user.
#include "font.h"
#include "gfx/font.h"
// --- UTF-8 -----------------------------------------------------------------

View file

@ -1,4 +1,4 @@
// TrueType outlines. See include/ttf.h for scope.
// TrueType outlines. See include/gfx/ttf.h for scope.
//
// Written from Apple's TrueType Reference Manual and the OpenType
// specification. Nothing here is derived from FreeType or stb_truetype.
@ -11,13 +11,13 @@ typedef unsigned short uint16;
typedef unsigned int uint32;
typedef signed short int16;
#else
#include "types.h"
#include "defs.h"
#include "param.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#endif
#include "text.h"
#include "ttf.h"
#include "gfx/text.h"
#include "gfx/ttf.h"
// Every multi-byte field in an sfnt file is big-endian, whatever the machine
// is. Read them byte by byte rather than casting: the file is not guaranteed

View file

@ -1,17 +1,17 @@
// Intel 8250 serial port (UART).
#include "types.h"
#include "defs.h"
#include "irq.h"
#include "param.h"
#include "traps.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "mmu.h"
#include "proc.h"
#include "x86.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/irq.h"
#include "core/param.h"
#include "arch/traps.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "arch/x86.h"
#define COM1 0x3f8

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
//
// Virtual terminals. See include/vt.h for why this exists at all; the short
// Virtual terminals. See include/dev/vt.h for why this exists at all; the short
// version is that switching needs a backing store, and the console drew
// straight into the framebuffer.
//
@ -11,15 +11,15 @@
// spreads "am I on screen" through the escape parser, and then a terminal
// that was switched away mid-sequence comes back wrong.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "posix.h"
#include "theme.h"
#include "gfx.h"
#include "vt.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "uapi/posix.h"
#include "gfx/theme.h"
#include "gfx/gfx.h"
#include "dev/vt.h"
int vt_active = 0;

View file

@ -20,21 +20,21 @@
// not a matter of starting it and walking away; it is a matter of keeping LVI
// ahead of CIV, which is what queue() does.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "x86.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "memlayout.h"
#include "mmu.h"
#include "pci.h"
#include "device.h"
#include "audio.h"
#include "dma.h"
#include "irq.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/x86.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "dev/pci.h"
#include "dev/device.h"
#include "dev/audio.h"
#include "core/dma.h"
#include "core/irq.h"
// --- NAM, the mixer ---------------------------------------------------------

View file

@ -19,19 +19,19 @@
// scheduler, so a driver that waited for an interrupt during probe would wait
// forever. Interrupts are for later, when a device is delivering data.
#include "types.h"
#include "defs.h"
#include "irq.h"
#include "dma.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "pci.h"
#include "usb.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/irq.h"
#include "core/dma.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "dev/pci.h"
#include "dev/usb.h"
#include "xhci.h"
#define RING_TRBS 64 // TRBs per ring, including the link

View file

@ -5,22 +5,22 @@
// library, and the text console -- and only the first is a driver. The other
// two are now kernel/dev/gfx.c and do not name any driver at all, so the crash
// screen and the console draw on whatever hardware is bound rather than on
// this one by name. See include/gfx.h.
// this one by name. See include/gfx/gfx.h.
//
// What stays here is everything that knows *where the pixels are*: the mode the
// loader programmed and handed over in the boot block, the aperture it lives
// in, and the display class vtable that presents all of it as one of possibly
// several displays.
#include "types.h"
#include "x86.h"
#include "memlayout.h"
#include "defs.h"
#include "device.h"
#include "display.h"
#include "gfx.h"
#include "dma.h"
#include "schboot.h" /* the hand-off block */
#include "core/types.h"
#include "arch/x86.h"
#include "arch/memlayout.h"
#include "core/defs.h"
#include "dev/device.h"
#include "gfx/display.h"
#include "gfx/gfx.h"
#include "core/dma.h"
#include "arch/schboot.h" /* the hand-off block */
static volatile uchar *fb;
// Physical base of the linear framebuffer, as reported by VBE. Everything that
@ -115,7 +115,7 @@ vga_fb_init(uint64 phys_addr)
// --- display class implementation ------------------------------------------
//
// See include/display.h. The VBE framebuffer presenting itself as a generic
// See include/gfx/display.h. The VBE framebuffer presenting itself as a generic
// display, so a compositor is written against the class rather than against
// this file.

View file

@ -17,16 +17,16 @@
// shown up first on hardware where the guess was wrong, and until now there
// was nothing in the kernel capable of noticing it.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "x86.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "pci.h"
#include "display.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/x86.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "dev/pci.h"
#include "gfx/display.h"
// The framebuffer lives in the first memory BAR big enough to hold a screen.
// Display controllers commonly expose two apertures -- the framebuffer and a

View file

@ -1,6 +1,6 @@
// virtio-gpu, 2D. Written from the OASIS virtio 1.1 specification.
//
// This is the second implementation of the display class (include/display.h),
// This is the second implementation of the display class (include/gfx/display.h),
// and the first one that is a real GPU driver rather than a flat framebuffer.
// The difference that matters for a compositor: presenting is an explicit
// operation. With VBE you write pixels and hope the scanout is not looking;
@ -12,23 +12,23 @@
// FEATURES_OK stuck, set up queues, DRIVER_OK. A device that finds the sequence
// wrong is entitled to simply refuse, and it will not say why.
#include "types.h"
#include "defs.h"
#include "irq.h"
#include "param.h"
#include "x86.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "mmu.h"
#include "memlayout.h"
#include "pci.h"
#include "device.h"
#include "display.h"
#include "dma.h"
#include "virtio.h"
#include "gfx.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/irq.h"
#include "core/param.h"
#include "arch/x86.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "arch/mmu.h"
#include "arch/memlayout.h"
#include "dev/pci.h"
#include "dev/device.h"
#include "gfx/display.h"
#include "core/dma.h"
#include "dev/virtio.h"
#include "gfx/gfx.h"
// One control queue is enough for 2D: there is also a cursor queue, which is
// only worth having once there is a hardware cursor to move.
@ -79,7 +79,7 @@ static struct vgpu gpus[VGPU_MAX];
// The instance behind a device, or 0. Every op goes through this rather than a
// file-static, which is what makes the second adapter possible at all. See
// include/netdev.h and the e1000 for the same arrangement on the network side.
// include/dev/netdev.h and the e1000 for the same arrangement on the network side.
static struct vgpu *
vgpu_of(struct device *d)
{
@ -782,7 +782,7 @@ static const struct pci_match virtio_gpu_match[] = {
// Hang the instance on the device the bus has just published. probe() runs
// before device_add(), so there is nothing to attach it to in there -- see the
// comment on `attached` in include/pci.h.
// comment on `attached` in include/dev/pci.h.
static void
vgpu_attached(struct pci_dev *d, struct device *dev)
{

View file

@ -3,7 +3,7 @@
// What it provides the rest of the system is a struct netdev_ops and nothing
// else: a station address, a transmit path and a receive ring. It does not
// know that lwIP exists, and lwIP does not know that it does -- see
// include/netdev.h for why that boundary is where it is. Adding a second NIC
// include/dev/netdev.h for why that boundary is where it is. Adding a second NIC
// means writing another driver that fills in the same four function pointers,
// and touching no file outside its own directory.
//
@ -13,21 +13,21 @@
// receiver whose ring base is still zero makes the device DMA into physical
// address 0, which on this kernel is the boot page table.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "x86.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "mmu.h"
#include "memlayout.h"
#include "pci.h"
#include "device.h"
#include "netdev.h"
#include "dma.h"
#include "irq.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/x86.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "arch/mmu.h"
#include "arch/memlayout.h"
#include "dev/pci.h"
#include "dev/device.h"
#include "dev/netdev.h"
#include "core/dma.h"
#include "core/irq.h"
#include "e1000.h"
struct e1000 {
@ -477,7 +477,7 @@ e1000_release(struct pci_dev *d)
}
// Hang the instance on the device the bus has just published. See the comment
// on `attached` in include/pci.h for why this cannot happen inside probe().
// on `attached` in include/dev/pci.h for why this cannot happen inside probe().
static void
e1000_attached(struct pci_dev *d, struct device *dev)
{

View file

@ -20,21 +20,21 @@
// is Linux's: this is a descriptor-ring driver in the same shape as the e1000
// beside it, because that is the shape this kernel's netdev class wants.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "x86.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "memlayout.h"
#include "mmu.h"
#include "pci.h"
#include "device.h"
#include "netdev.h"
#include "dma.h"
#include "irq.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/x86.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "dev/pci.h"
#include "dev/device.h"
#include "dev/netdev.h"
#include "core/dma.h"
#include "core/irq.h"
// --- registers --------------------------------------------------------------

View file

@ -12,21 +12,21 @@
// and it is the one Realtek part QEMU emulates, so unlike the 8169 beside it
// every line of this has been run.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "x86.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "memlayout.h"
#include "mmu.h"
#include "pci.h"
#include "device.h"
#include "netdev.h"
#include "dma.h"
#include "irq.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/x86.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "dev/pci.h"
#include "dev/device.h"
#include "dev/netdev.h"
#include "core/dma.h"
#include "core/irq.h"
// --- registers --------------------------------------------------------------

View file

@ -16,17 +16,17 @@
// pci_driver, declare it here, and add it to the array and to the Makefile's
// KERN_DRIVERS.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "pci.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "dev/pci.h"
#include "usb.h"
#include "device.h"
#include "dev/usb.h"
#include "dev/device.h"
extern const struct pci_driver vga_pci_driver;
extern const struct pci_driver xhci_driver;

View file

@ -21,18 +21,18 @@
// few milliseconds, so the cost is that, spent spinning, and it is yielded
// once a wait goes long.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "x86.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "proc.h"
#include "pci.h"
#include "dma.h"
#include "blkdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/x86.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "core/proc.h"
#include "dev/pci.h"
#include "core/dma.h"
#include "fs/blkdev.h"
// --- HBA registers (section 3.1) ---------------------------------------------
@ -345,7 +345,7 @@ port_init(volatile uint8 *hba, int port, uint32 cap)
return;
}
// Without S64A the HBA cannot see above 4 GB. The DMA arena is below it
// (see include/dma.h), so this holds, and says so if that ever changes.
// (see include/core/dma.h), so this holds, and says so if that ever changes.
if (!(cap & CAP_S64A) && dma_phys(p->xfer) + BSIZE > 0xFFFFFFFFULL) {
cprintf("ahci: DMA memory above 4 GB and the HBA is 32-bit\n");
return;

View file

@ -19,18 +19,18 @@
// A flash read completes in tens of microseconds, so the spin is short, and
// it is yielded once a wait goes long.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "x86.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "proc.h"
#include "pci.h"
#include "dma.h"
#include "blkdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/x86.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "core/proc.h"
#include "dev/pci.h"
#include "core/dma.h"
#include "fs/blkdev.h"
// --- controller registers (section 3.1) --------------------------------------

View file

@ -7,15 +7,15 @@
// part of USB that is the same for every device ever made: read the
// configuration, choose one, look at the interface, find someone who wants it.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "spinlock.h"
#include "dma.h"
#include "usb.h"
#include "hwinfo.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/spinlock.h"
#include "core/dma.h"
#include "dev/usb.h"
#include "core/hwinfo.h"
// A staging buffer for control transfers.
//
@ -130,7 +130,7 @@ parse_config(struct usb_dev *dev, int nth)
}
// One usb_dev for every interface after the first. See `base` in
// include/usb.h. A fixed pool, like everything else here. It was sixteen,
// include/dev/usb.h. A fixed pool, like everything else here. It was sixteen,
// which a dock -- hub, Ethernet, audio, card reader, each two or three
// interfaces -- and a couple of receivers already reach. 672 bytes each.
#define NIFDEV 64

View file

@ -17,14 +17,14 @@
// in the descriptor is stepped over. A boot mouse whose descriptor makes no
// sense is still driven, in boot protocol, as before.
#include "types.h"
#include "defs.h"
#include "gfx.h"
#include "param.h"
#include "spinlock.h"
#include "dma.h"
#include "usb.h"
#include "input.h"
#include "core/types.h"
#include "core/defs.h"
#include "gfx/gfx.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/dma.h"
#include "dev/usb.h"
#include "dev/input.h"
#define NHID 8

View file

@ -15,12 +15,12 @@
// translator rather than against the device. So this driver's real job is
// less "operate the hub" than "tell the controller what shape the tree is".
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "dma.h"
#include "usb.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/dma.h"
#include "dev/usb.h"
#define MAX_PORTS 15 // per hub; more than any real bus hub has
#define NHUB 8

View file

@ -14,18 +14,18 @@
// below (INQUIRY, READ CAPACITY, READ(10), WRITE(10)) are the same ones a
// SCSI drive answered in 1990.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "dma.h"
#include "usb.h"
#include "blkdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#include "core/dma.h"
#include "dev/usb.h"
#include "fs/blkdev.h"
#define CBW_SIGNATURE 0x43425355 // "USBC"
#define CSW_SIGNATURE 0x53425355 // "USBS"

View file

@ -27,17 +27,17 @@
// fileread/filewrite see T_DEV and dispatch through devsw themselves -- which
// is why there is no read op below that does anything.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "stat.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "proc.h"
#include "fs.h"
#include "file.h"
#include "errno.h"
#include "blkdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "uapi/stat.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "core/proc.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "uapi/errno.h"
#include "fs/blkdev.h"
// Inode numbering. Two directories and a flat table of nodes, so the number is
// either a directory id or an index into devnodes[] offset past them.
@ -99,10 +99,10 @@ static const struct devnode devnodes[] = {
// a flag, because the minor is the one piece of per-open state a character
// device already sees -- so which one you opened *is* the permission, and
// nothing has to be remembered between the write and the read. See
// include/dbg.h and cmd/schdbgd.
// include/core/dbg.h and cmd/schdbgd.
{ "dbgro", 10, 1, D_ROOT },
{ "netdev", 11, 0, D_ROOT },
// Audio, spelled the way UNIX spells it. See include/audio.h.
// Audio, spelled the way UNIX spells it. See include/dev/audio.h.
{ "dsp", 12, 0, D_ROOT },
{ "mouse", 3, 1, D_ROOT },

View file

@ -1,21 +1,21 @@
#include "types.h"
#include "traps.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "defs.h"
#include "x86.h"
#include "elf.h"
#include "fcntl.h"
#include "errno.h"
#include "x86.h"
#include "fsstat.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "uaccess.h"
#include "core/types.h"
#include "arch/traps.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "core/defs.h"
#include "arch/x86.h"
#include "core/elf.h"
#include "uapi/fcntl.h"
#include "uapi/errno.h"
#include "arch/x86.h"
#include "fs/fsstat.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "core/uaccess.h"
// Binaries with entry points at 0x100000+ are musl/Linux-ABI.
// SchOS-native binaries (init) are linked at 0x4000.

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
//
// FAT12, FAT16 and FAT32, with VFAT long file names. See include/fat.h.
// FAT12, FAT16 and FAT32, with VFAT long file names. See include/fs/fat.h.
//
// Written from Microsoft's FAT specification (the "FAT32 File System
// Specification", 1.03) and matching Linux's vfat where the specification
@ -41,18 +41,18 @@
// Every operation that changes anything writes its dirty lines back before it
// returns, so a stick pulled out between two commands holds both of them.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "stat.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "proc.h"
#include "fs.h"
#include "file.h"
#include "errno.h"
#include "blkdev.h"
#include "fat.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "uapi/stat.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "core/proc.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "uapi/errno.h"
#include "fs/blkdev.h"
#include "fs/fat.h"
#define LINE 4096
#define NLINE 64 // 256 KB of cache per volume

View file

@ -1,15 +1,15 @@
#include "types.h"
#include "defs.h"
#include "stat.h"
#include "param.h"
#include "fs.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "file.h"
#include "fsstat.h"
#include "posix.h"
#include "errno.h"
#include "kmem.h"
#include "core/types.h"
#include "core/defs.h"
#include "uapi/stat.h"
#include "core/param.h"
#include "fs/fs.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/file.h"
#include "fs/fsstat.h"
#include "uapi/posix.h"
#include "uapi/errno.h"
#include "core/kmem.h"
extern struct devsw devsw[];

View file

@ -31,21 +31,21 @@
// removed.
// This FS is a joke lol, suck my dick chinese people lol
#include "types.h"
#include "x86.h"
#include "defs.h"
#include "param.h"
#include "stat.h"
#include "spinlock.h"
#include "proc.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "fsstat.h"
#include "file.h"
#include "fat.h"
#include "errno.h"
#include "kmem.h"
#include "core/types.h"
#include "arch/x86.h"
#include "core/defs.h"
#include "core/param.h"
#include "uapi/stat.h"
#include "core/spinlock.h"
#include "core/proc.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#include "fs/fsstat.h"
#include "fs/file.h"
#include "fs/fat.h"
#include "uapi/errno.h"
#include "core/kmem.h"
extern uint uptime(void);

View file

@ -1,10 +1,10 @@
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
// Simple logging that allows concurrent FS system calls.
//

View file

@ -1,15 +1,15 @@
#include "types.h"
#include "defs.h"
#include "param.h"
#include "mmu.h"
#include "proc.h"
#include "fs.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "file.h"
#include "kmem.h"
#include "posix.h"
#include "errno.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "fs/fs.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/file.h"
#include "core/kmem.h"
#include "uapi/posix.h"
#include "uapi/errno.h"
#define PIPESIZE 512

View file

@ -19,21 +19,21 @@
// reads over. That split is deliberate -- the generators are about content and
// this file is about namespace, and they change for different reasons.
#include "types.h"
#include "defs.h"
#include "klog.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "kmem.h"
#include "stat.h"
#include "uaccess.h"
#include "errno.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/klog.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "core/kmem.h"
#include "uapi/stat.h"
#include "core/uaccess.h"
#include "uapi/errno.h"
// ---------------------------------------------------------------------------
// Inode numbering
@ -96,7 +96,7 @@ static const struct global_file globals[] = {
// "quiet" or "verbose" -- how this machine was booted. See cmd/schinitd.
{ "bootmode", 19 },
{ "bootdebug", 30 },
// What the slab allocator is holding. See include/kmem.h.
// What the slab allocator is holding. See include/core/kmem.h.
{ "slab", 20 },
// Disks and partitions, in Linux's format. See blkdev_info().
{ "partitions", 21 },

View file

@ -27,8 +27,8 @@
#ifdef SCHFS_HOSTED
#include <string.h>
#else
#include "types.h"
#include "defs.h"
#include "core/types.h"
#include "core/defs.h"
#endif
/* ------------------------------------------------------------------ */

View file

@ -22,8 +22,8 @@
#ifdef SCHFS_HOSTED
#include <string.h>
#else
#include "types.h"
#include "defs.h"
#include "core/types.h"
#include "core/defs.h"
#endif
/* ------------------------------------------------------------------ */

View file

@ -19,7 +19,7 @@
#ifndef SCHFS_BTREE_H
#define SCHFS_BTREE_H
#include "schfs.h"
#include "fs/schfs.h"
// Block device the tree lives on. The kernel supplies one backed by the buffer
// cache; the test harness supplies one backed by a plain file or by memory.

View file

@ -48,20 +48,20 @@
// for a bracket to save. Deferral is what makes batching worth anything, and
// batching is what makes deferral worth anything. Neither pays alone.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "proc.h" /* myproc() — transaction brackets are per-process */
#include "fs.h"
#include "buf.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "core/proc.h" /* myproc() — transaction brackets are per-process */
#include "fs/fs.h"
#include "fs/buf.h"
#include "file.h" /* SCHFS_DEV, SCHFS_SNAP_DEV */
#include "errno.h" /* mounting reports why it failed, not just that it did */
#include "x86.h"
#include "fsstat.h"
#include "blkdev.h" /* bgetblk */
#include "fs/file.h" /* SCHFS_DEV, SCHFS_SNAP_DEV */
#include "uapi/errno.h" /* mounting reports why it failed, not just that it did */
#include "arch/x86.h"
#include "fs/fsstat.h"
#include "fs/blkdev.h" /* bgetblk */
#include "schfs_int.h"
// How many buffer-cache blocks one filesystem block spans. BSIZE was 1024 when

View file

@ -19,8 +19,8 @@
#ifdef SCHFS_HOSTED
#include <string.h>
#else
#include "types.h"
#include "defs.h"
#include "core/types.h"
#include "core/defs.h"
#endif
// Point a cursor at the volume's current tree, keeping the caller's block

View file

@ -28,8 +28,8 @@
#ifdef SCHFS_HOSTED
#include <string.h>
#else
#include "types.h"
#include "defs.h"
#include "core/types.h"
#include "core/defs.h"
#endif
/* ------------------------------------------------------------------ */

View file

@ -39,8 +39,8 @@
#ifdef SCHFS_HOSTED
#include <string.h>
#else
#include "types.h"
#include "defs.h"
#include "core/types.h"
#include "core/defs.h"
#endif
/* ------------------------------------------------------------------ */

View file

@ -27,19 +27,19 @@
// names left. Two pieces of code counting links independently is precisely how
// a filesystem loses a file that is still referenced.
#include "types.h"
#include "x86.h"
#include "defs.h"
#include "param.h"
#include "stat.h"
#include "spinlock.h"
#include "proc.h" /* `proc` — copyin/copyout need the current pgdir */
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "file.h"
#include "errno.h"
#include "fsstat.h"
#include "core/types.h"
#include "arch/x86.h"
#include "core/defs.h"
#include "core/param.h"
#include "uapi/stat.h"
#include "core/spinlock.h"
#include "core/proc.h" /* `proc` — copyin/copyout need the current pgdir */
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#include "fs/file.h"
#include "uapi/errno.h"
#include "fs/fsstat.h"
#include "schfs_int.h"

View file

@ -18,8 +18,8 @@
#ifdef SCHFS_HOSTED
#include <string.h>
#else
#include "types.h"
#include "defs.h"
#include "core/types.h"
#include "core/defs.h"
#endif
// Checksum an uberblock with its own crc field zeroed, the same convention the

View file

@ -24,22 +24,22 @@
// from the live tables when asked, so a USB stick appears in /sys the moment
// the hot-plug thread attaches it.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "kmem.h"
#include "uaccess.h"
#include "errno.h"
#include "stat.h"
#include "pci.h"
#include "usb.h"
#include "hwinfo.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "core/kmem.h"
#include "core/uaccess.h"
#include "uapi/errno.h"
#include "uapi/stat.h"
#include "dev/pci.h"
#include "dev/usb.h"
#include "core/hwinfo.h"
// ---------------------------------------------------------------------------
// Inode numbers: kind, index, file -- the whole identity, since iget gives

View file

@ -47,17 +47,17 @@
// in the ones with nothing to do, and a per-socket channel would have to be
// torn down carefully in close() against callbacks that can still arrive.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "proc.h"
#include "fs.h" /* NDIRECT, which file.h's struct inode needs */
#include "file.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "core/proc.h"
#include "fs/fs.h" /* NDIRECT, which file.h's struct inode needs */
#include "fs/file.h"
#define _KERNEL_SOCKET_INTERNALS
#include "socket.h"
#include "errno.h"
#include "net/socket.h"
#include "uapi/errno.h"
#include "lwip/opt.h"
#include "lwip/tcp.h"

View file

@ -10,8 +10,8 @@
#ifndef LWIP_ARCH_CC_H
#define LWIP_ARCH_CC_H
#include "types.h"
#include "defs.h"
#include "core/types.h"
#include "core/defs.h"
// There is no libc under the kernel, so every header lwIP would normally reach
// for has to be switched off and its contents supplied here instead. That is

View file

@ -7,18 +7,18 @@
// driver, and this file knows only that a network device can transmit a frame,
// receive a frame and state its MAC address. It was `netif_e1000.c` and called
// `e1000_transmit` directly, which meant the second NIC driver would have
// arrived with a second near-identical copy of this file. See include/netdev.h.
// arrived with a second near-identical copy of this file. See include/dev/netdev.h.
//
// One netif per bound interface, up to NETIF_MAX. Two NICs is an ordinary
// machine -- a laptop with Ethernet and the virtual one QEMU adds is already
// two -- and the limit exists only because a fixed array is simpler than
// allocation for something enumerated once at boot.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "device.h"
#include "netdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "dev/device.h"
#include "dev/netdev.h"
#include "lwip/opt.h"
#include "lwip/netif.h"

View file

@ -24,12 +24,12 @@
// It is recursive by necessity: lwIP brackets small critical sections inside
// larger ones and expects nesting to be free.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "proc.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "core/proc.h"
#include "lwip/opt.h"
#include "lwip/sys.h"

View file

@ -10,7 +10,7 @@
// register -- and this thread polls.
//
// Nothing here names a driver. Interfaces come from the netdev class
// (include/netdev.h): every bound network device is attached, and a machine
// (include/dev/netdev.h): every bound network device is attached, and a machine
// with two NICs gets two interfaces without a line changing in this file.
//
// Polling costs a wakeup every few milliseconds when the link is idle. The
@ -18,14 +18,14 @@
// later; it is deliberately not the first version, because a receive path that
// is woken from an interrupt is much harder to debug than one that is asked.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "proc.h"
#include "device.h"
#include "netdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "core/proc.h"
#include "dev/device.h"
#include "dev/netdev.h"
#include "lwip/opt.h"
#include "lwip/init.h"

View file

@ -18,24 +18,24 @@
// musl passes -- is trivially honoured.
//
// The information is not this file's. Interfaces come from the netdev class
// (include/netdev.h) and addresses from lwIP's netifs, exactly as /proc/netif
// (include/dev/netdev.h) and addresses from lwIP's netifs, exactly as /proc/netif
// reads them. Nothing here knows what an e1000 is.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "mmu.h"
#include "proc.h"
#include "fs.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "file.h"
#include "errno.h"
#include "device.h"
#include "netdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "fs/fs.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/file.h"
#include "uapi/errno.h"
#include "dev/device.h"
#include "dev/netdev.h"
#define _KERNEL_SOCKET_INTERNALS
#include "socket.h"
#include "net/socket.h"
#include "lwip/netif.h"
#include "lwip/ip4_addr.h"

View file

@ -25,22 +25,22 @@
// socket path failing with ENOENT. Both are worth fixing when the VFS next
// gets opened up; neither blocks anything.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "mmu.h"
#include "proc.h"
#include "fs.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "file.h"
#include "posix.h"
#include "errno.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "fs/fs.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/file.h"
#include "uapi/posix.h"
#include "uapi/errno.h"
#define _KERNEL_SOCKET_INTERNALS
#include "socket.h"
#include "sbuf.h"
#include "dbg.h"
#include "net/socket.h"
#include "core/sbuf.h"
#include "core/dbg.h"
static struct {
struct spinlock lock;

View file

@ -1,20 +1,20 @@
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "x86.h"
#include "traps.h"
#include "proc.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "sbuf.h"
#include "dbg.h"
#include "fs.h"
#include "file.h"
#include "posix.h"
#include "errno.h"
#include "blkdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "arch/x86.h"
#include "arch/traps.h"
#include "core/proc.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "core/sbuf.h"
#include "core/dbg.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "uapi/posix.h"
#include "uapi/errno.h"
#include "fs/blkdev.h"
// Verify myproc()->fs_base offset matches the hardcoded 0x688 in trapasm.S.
_Static_assert(__builtin_offsetof(struct proc, fs_base) == 0x18,

View file

@ -11,8 +11,8 @@
// The map is now generated from kernel/sys/table.inc, which carries the Linux
// number alongside the native one. There is nothing to hand-edit here.
#include "types.h"
#include "syscall.h"
#include "core/types.h"
#include "core/syscall.h"
#define LINUX_NSYSCALL NSYSCALLS

View file

@ -2,19 +2,19 @@
// These are stubs or thin wrappers that make musl and ksh happy
// without implementing full semantics.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "traps.h"
#include "proc.h"
#include "x86.h"
#include "syscall.h"
#include "posix.h"
#include "uaccess.h"
#include "errno.h"
#include "klog.h" /* KLOG_BYTES, for syslog(2) action 10 */
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "arch/traps.h"
#include "core/proc.h"
#include "arch/x86.h"
#include "core/syscall.h"
#include "uapi/posix.h"
#include "core/uaccess.h"
#include "uapi/errno.h"
#include "core/klog.h" /* KLOG_BYTES, for syslog(2) action 10 */
extern int linux_syscall_map[];
extern int linux_syscall_map_size;

View file

@ -1,26 +1,26 @@
#include "types.h"
#include "defs.h"
#include "param.h"
#include "stat.h"
#include "mmu.h"
#include "memlayout.h"
#include "proc.h"
#include "fs.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "file.h"
#include "fcntl.h"
#include "posix.h"
#include "syscall.h"
#include "uaccess.h"
#include "errno.h"
#include "schfs.h" /* SCHFS_BLKSIZE, SCHFS_NAME_MAX — statfs reports them */
#include "gfx.h" /* gfx_cols/gfx_rows — TIOCGWINSZ reports them */
#include "vt.h" /* the terminals the TIOC and VT_ ioctls act on */
#include "pciuser.h"
#include "keymap.h" /* KB_*LAYOUT — the keyboard layout catalogue */
#include "netuser.h"
#include "fat.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "uapi/stat.h"
#include "arch/mmu.h"
#include "arch/memlayout.h"
#include "core/proc.h"
#include "fs/fs.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/file.h"
#include "uapi/fcntl.h"
#include "uapi/posix.h"
#include "core/syscall.h"
#include "core/uaccess.h"
#include "uapi/errno.h"
#include "fs/schfs.h" /* SCHFS_BLKSIZE, SCHFS_NAME_MAX — statfs reports them */
#include "gfx/gfx.h" /* gfx_cols/gfx_rows — TIOCGWINSZ reports them */
#include "dev/vt.h" /* the terminals the TIOC and VT_ ioctls act on */
#include "dev/pciuser.h"
#include "dev/keymap.h" /* KB_*LAYOUT — the keyboard layout catalogue */
#include "net/netuser.h"
#include "fs/fat.h"
// -----------------------------------------------------------------------
// Linux-ABI-compatible struct stat (x86_64 "struct stat" from
@ -1548,7 +1548,7 @@ addr_t sys_ioctl(void)
return 0;
}
// Which chord the kernel switches on. SchOS's own ioctl -- see the long
// comment in include/kbd.h for why this has to be settable at all.
// comment in include/dev/kbd.h for why this has to be settable at all.
if (request == VT_SETCHORD) {
struct vt_chord *c = (struct vt_chord*)user_ptr(argp, sizeof(*c));
if (!c) return -EFAULT;

View file

@ -1,24 +1,24 @@
#include "types.h"
#include "defs.h"
#include "gfx.h"
#include "param.h"
#include "stat.h"
#include "memlayout.h"
#include "mmu.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "proc.h"
#include "fs.h"
#include "file.h"
#include "syscall.h"
#include "errno.h"
#include "uaccess.h"
#include "posix.h"
#include "pciuser.h"
#include "core/types.h"
#include "core/defs.h"
#include "gfx/gfx.h"
#include "core/param.h"
#include "uapi/stat.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "core/proc.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "core/syscall.h"
#include "uapi/errno.h"
#include "core/uaccess.h"
#include "uapi/posix.h"
#include "dev/pciuser.h"
extern int mappages(pml4e_t *pgdir, void *va, uint64 size, uint64 pa, int perm);
/* MAP_* and PROT_* now live in include/posix.h, so userspace and the kernel
/* MAP_* and PROT_* now live in include/uapi/posix.h, so userspace and the kernel
compare the same numbers. */
// Reject user mapping requests that fall outside user space. Without this,

View file

@ -11,21 +11,21 @@
// EAFNOSUPPORT rather than EINVAL, because a program that probes for IPv6 and
// falls back to IPv4 needs to tell "not here" from "you passed nonsense".
#include "types.h"
#include "defs.h"
#include "param.h"
#include "mmu.h"
#include "proc.h"
#include "fs.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "stat.h"
#include "file.h"
#include "posix.h"
#include "syscall.h"
#include "uaccess.h"
#include "errno.h"
#include "socket.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "fs/fs.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "uapi/stat.h"
#include "fs/file.h"
#include "uapi/posix.h"
#include "core/syscall.h"
#include "core/uaccess.h"
#include "uapi/errno.h"
#include "net/socket.h"
// Pull the sun_path out of a user `struct sockaddr_un`, NUL-terminated.
//

Some files were not shown because too many files have changed in this diff Show more