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:
parent
0e39e711f1
commit
a1c965da1e
267 changed files with 1560 additions and 1440 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue