🔧 include上级文件夹时,统一采用<>来指定文件

This commit is contained in:
fslongjin 2022-07-17 15:41:19 +08:00
parent d53c7bd1c7
commit d0ddb73788
39 changed files with 140 additions and 102 deletions

View File

@ -104,7 +104,10 @@
"spinlock.h": "c", "spinlock.h": "c",
"stat.h": "c", "stat.h": "c",
"video.h": "c", "video.h": "c",
"libm.h": "c" "libm.h": "c",
"ahci.h": "c",
"slab.h": "c",
"boot_info.h": "c"
}, },
"C_Cpp.errorSquiggles": "Enabled", "C_Cpp.errorSquiggles": "Enabled",
"esbonio.sphinx.confDir": "" "esbonio.sphinx.confDir": ""

View File

@ -11,8 +11,8 @@
#pragma once #pragma once
#include "../../common/kprint.h" #include <common/kprint.h>
#include "../../driver/interrupt/apic/apic.h" #include <driver/interrupt/apic/apic.h>
/** /**
* @brief ipi消息 * @brief ipi消息

View File

@ -3,9 +3,9 @@
// //
#include "printk.h" #include "printk.h"
#include "kprint.h" #include "kprint.h"
#include "../driver/multiboot2/multiboot2.h" #include <driver/multiboot2/multiboot2.h>
#include "../mm/mm.h" #include <mm/mm.h>
#include "../process/spinlock.h" #include <process/spinlock.h>
#include <driver/uart/uart.h> #include <driver/uart/uart.h>
#include <driver/video/video.h> #include <driver/video/video.h>

View File

@ -1,8 +1,8 @@
#include "acpi.h" #include "acpi.h"
#include "../../common/printk.h" #include <common/printk.h>
#include "../../common/kprint.h" #include <common/kprint.h>
#include "../multiboot2/multiboot2.h" #include <driver/multiboot2/multiboot2.h>
#include "../../mm/mm.h" #include <mm/mm.h>
#define acpi_get_RSDT_entry_vaddr(phys_addr) (ACPI_DESCRIPTION_HEDERS_BASE + (phys_addr)-acpi_RSDT_entry_phys_base) // 获取RSDT entry的虚拟地址 #define acpi_get_RSDT_entry_vaddr(phys_addr) (ACPI_DESCRIPTION_HEDERS_BASE + (phys_addr)-acpi_RSDT_entry_phys_base) // 获取RSDT entry的虚拟地址
// #define acpi_get_XSDT_entry_vaddr(phys_addr) (ACPI_DESCRIPTION_HEDERS_BASE + (phys_addr)-acpi_XSDT_entry_phys_base) // 获取XSDT entry的虚拟地址 // #define acpi_get_XSDT_entry_vaddr(phys_addr) (ACPI_DESCRIPTION_HEDERS_BASE + (phys_addr)-acpi_XSDT_entry_phys_base) // 获取XSDT entry的虚拟地址

View File

@ -4,8 +4,8 @@
#pragma once #pragma once
#include "../../common/glib.h" #include <common/glib.h>
#include "../../mm/mm.h" #include <mm/mm.h>
#define ACPI_ICS_TYPE_PROCESSOR_LOCAL_APIC 0 #define ACPI_ICS_TYPE_PROCESSOR_LOCAL_APIC 0
#define ACPI_ICS_TYPE_IO_APIC 1 #define ACPI_ICS_TYPE_IO_APIC 1

View File

@ -1,6 +1,6 @@
#include "ahci.h" #include "ahci.h"
#include "../../../common/kprint.h" #include <common/kprint.h>
#include "../../../mm/slab.h" #include <mm/slab.h>
#include <syscall/syscall.h> #include <syscall/syscall.h>
#include <syscall/syscall_num.h> #include <syscall/syscall_num.h>
@ -23,6 +23,7 @@ static int ahci_find_cmdslot(HBA_PORT *port);
// 计算HBA_MEM的虚拟内存地址 // 计算HBA_MEM的虚拟内存地址
#define cal_HBA_MEM_VIRT_ADDR(device_num) (AHCI_MAPPING_BASE + (ul)(((struct pci_device_structure_general_device_t *)(ahci_devs[device_num]))->BAR5 - ((((struct pci_device_structure_general_device_t *)(ahci_devs[0]))->BAR5) & PAGE_2M_MASK))) #define cal_HBA_MEM_VIRT_ADDR(device_num) (AHCI_MAPPING_BASE + (ul)(((struct pci_device_structure_general_device_t *)(ahci_devs[device_num]))->BAR5 - ((((struct pci_device_structure_general_device_t *)(ahci_devs[0]))->BAR5) & PAGE_2M_MASK)))
/** /**
* @brief ahci模块 * @brief ahci模块
* *

View File

@ -1,8 +1,8 @@
#pragma once #pragma once
#include "../block_device.h" #include <driver/disk/block_device.h>
#include "../../pci/pci.h" #include <driver/pci/pci.h>
#include "../../../mm/mm.h" #include <mm/mm.h>
/** /**
* @todo io调度器 * @todo io调度器

View File

@ -1,6 +1,6 @@
#include "ata.h" #include "ata.h"
#include "../../common/kprint.h" #include <common/kprint.h>
#include "../interrupt/apic/apic.h" #include <driver/interrupt/apic/apic.h>
struct apic_IO_APIC_RTE_entry entry; struct apic_IO_APIC_RTE_entry entry;

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../../common/glib.h" #include <common/glib.h>
// ======== PIO端口定义 ======== // ======== PIO端口定义 ========
#define PORT_DISK0_DATA 0x1f0 // 数据 #define PORT_DISK0_DATA 0x1f0 // 数据

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../../common/glib.h" #include <common/glib.h>
#include "stdint.h" #include "stdint.h"
#include <process/semaphore.h> #include <process/semaphore.h>

View File

@ -1,7 +1,7 @@
#include "8259A.h" #include "8259A.h"
#include "../../../common/printk.h" #include <common/printk.h>
#include "../../../common/kprint.h" #include <common/kprint.h>
#include "../../../exception/gate.h" #include <exception/gate.h>
// 导出定义在irq.c中的中段门表 // 导出定义在irq.c中的中段门表
extern void (*interrupt_table[24])(void); extern void (*interrupt_table[24])(void);

View File

@ -11,8 +11,8 @@
#pragma once #pragma once
#include "../../../common/glib.h" #include <common/glib.h>
#include "../../../exception/irq.h" #include <exception/irq.h>
#define PIC_EOI 0x20 #define PIC_EOI 0x20
#define PIC_master 0x20 /* IO base address for master PIC */ #define PIC_master 0x20 /* IO base address for master PIC */

View File

@ -1,10 +1,10 @@
#include "apic.h" #include "apic.h"
#include "../../../common/kprint.h" #include <common/kprint.h>
#include "../../../common/printk.h" #include <common/printk.h>
#include "../../../common/cpu.h" #include <common/cpu.h>
#include "../../../common/glib.h" #include <common/glib.h>
#include "../../../exception/gate.h" #include <exception/gate.h>
#include "../../acpi/acpi.h" #include <driver/acpi/acpi.h>
#include <exception/softirq.h> #include <exception/softirq.h>
#include <process/process.h> #include <process/process.h>

View File

@ -1,9 +1,9 @@
#pragma once #pragma once
#include "../../../common/asm.h" #include <common/asm.h>
#include "../../../process/ptrace.h" #include <process/ptrace.h>
#include "../../../exception/irq.h" #include <exception/irq.h>
#include "../../../mm/mm.h" #include <mm/mm.h>
#define APIC_SUCCESS 0 #define APIC_SUCCESS 0
#define APIC_E_NOTFOUND 1 #define APIC_E_NOTFOUND 1

View File

@ -1,8 +1,8 @@
#include "ps2_keyboard.h" #include "ps2_keyboard.h"
#include "../interrupt/apic/apic.h" #include <driver/interrupt/apic/apic.h>
#include "../../mm/mm.h" #include <mm/mm.h>
#include "../../mm/slab.h" #include <mm/slab.h>
#include "../../common/printk.h" #include <common/printk.h>
#include <filesystem/VFS/VFS.h> #include <filesystem/VFS/VFS.h>
#include <process/wait_queue.h> #include <process/wait_queue.h>
#include <process/spinlock.h> #include <process/spinlock.h>

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../../common/glib.h" #include <common/glib.h>
#define PS2_KEYBOARD_INTR_VECTOR 0x21 // 键盘的中断向量号 #define PS2_KEYBOARD_INTR_VECTOR 0x21 // 键盘的中断向量号

View File

@ -1,9 +1,9 @@
#include "ps2_mouse.h" #include "ps2_mouse.h"
#include "../interrupt/apic/apic.h" #include <driver/interrupt/apic/apic.h>
#include "../../mm/mm.h" #include <mm/mm.h>
#include "../../mm/slab.h" #include <mm/slab.h>
#include "../../common/printk.h" #include <common/printk.h>
#include "../../common/kprint.h" #include <common/kprint.h>
static struct ps2_mouse_input_buffer *ps2_mouse_buf_ptr = NULL; static struct ps2_mouse_input_buffer *ps2_mouse_buf_ptr = NULL;
static int c = 0; static int c = 0;

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../../common/glib.h" #include <common/glib.h>
#define PS2_MOUSE_INTR_VECTOR 0x2c // 鼠标的中断向量号 #define PS2_MOUSE_INTR_VECTOR 0x2c // 鼠标的中断向量号

View File

@ -1,8 +1,8 @@
#include "multiboot2.h" #include "multiboot2.h"
#include "assert.h" #include "assert.h"
#include "../../common/glib.h" #include <common/glib.h>
#include "../../common/kprint.h" #include <common/kprint.h>
uintptr_t multiboot2_boot_info_addr; uintptr_t multiboot2_boot_info_addr;
unsigned int multiboot2_magic; unsigned int multiboot2_magic;
unsigned int multiboot2_boot_info_size; unsigned int multiboot2_boot_info_size;

View File

@ -7,8 +7,8 @@
#include "stdint.h" #include "stdint.h"
#include "stdbool.h" #include "stdbool.h"
#include "../../common/boot_info.h" #include <common/boot_info.h>
#include "../acpi/acpi.h" #include <driver/acpi/acpi.h>
/// @see Multiboot2 Specification version 2.0.pdf /// @see Multiboot2 Specification version 2.0.pdf
// 启动后,在 32 位内核进入点,机器状态如下: // 启动后,在 32 位内核进入点,机器状态如下:

View File

@ -1,6 +1,6 @@
#include "pci.h" #include "pci.h"
#include "../../common/kprint.h" #include <common/kprint.h>
#include "../../mm/slab.h" #include <mm/slab.h>
static uint count_device_list = 0; static uint count_device_list = 0;
static void pci_checkBus(uint8_t bus); static void pci_checkBus(uint8_t bus);

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../../common/glib.h" #include <common/glib.h>
#include "stdint.h" #include "stdint.h"
#define PORT_PCI_CONFIG_ADDRESS 0xcf8 #define PORT_PCI_CONFIG_ADDRESS 0xcf8

View File

@ -1 +1,17 @@
#include "usb.h" #include "usb.h"
#include <common/kprint.h>
#include <driver/pci/pci.h>
#define MAX_USB_NUM 8 // pci总线上的usb设备的最大数量
// 在pci总线上寻找到的usb设备控制器的header
struct pci_device_structure_header_t *usb_pdevs[MAX_USB_NUM];
/**
* @brief usb驱动程序
*
*/
void usb_init()
{
kinfo("Initializing usb driver...");
}

View File

@ -1 +1,19 @@
#pragma once #pragma once
// usb设备在pci总线上的class
#define USB_CLASS 0xC
#define USB_SUBCLASS 0x3
// 不同的usb设备在pci总线上的prog IF
#define USB_TYPE_UHCI 0x0
#define USB_TYPE_OHCI 0x10
#define USB_TYPE_EHCI 0x20
#define USB_TYPE_XHCI 0x30
#define USB_TYPE_UNSPEC 0x80 // Unspecified
#define USB_TYPE_DEVICE 0xfe // USB Device(Not controller)
/**
* @brief usb驱动程序
*
*/
void usb_init();

View File

@ -9,7 +9,7 @@
#ifndef __GATE_H__ #ifndef __GATE_H__
#define __GATE_H__ #define __GATE_H__
#include "../common/kprint.h" #include <common/kprint.h>
#include <mm/mm.h> #include <mm/mm.h>
//描述符表的结构体 //描述符表的结构体

View File

@ -3,13 +3,13 @@
// 对进行 // 对进行
#if _INTR_8259A_ #if _INTR_8259A_
#include "../driver/interrupt/8259A/8259A.h" #include <driver/interrupt/8259A/8259A.h>
#else #else
#include "../driver/interrupt/apic/apic.h" #include <driver/interrupt/apic/apic.h>
#endif #endif
#include "../common/asm.h" #include <common/asm.h>
#include "../common/printk.h" #include <common/printk.h>
#include "gate.h" #include "gate.h"
#include <mm/slab.h> #include <mm/slab.h>

View File

@ -11,9 +11,9 @@
#pragma once #pragma once
#include "../common/glib.h" #include <common/glib.h>
#include "../process/ptrace.h" #include <process/ptrace.h>
#define SMP_IRQ_NUM 10 #define SMP_IRQ_NUM 10
#define LOCAL_APIC_IRQ_NUM 10 #define LOCAL_APIC_IRQ_NUM 10

View File

@ -1,7 +1,7 @@
#include "trap.h" #include "trap.h"
#include "gate.h" #include "gate.h"
#include "../process/ptrace.h" #include <process/ptrace.h>
#include "../common/kprint.h" #include <common/kprint.h>
#include <process/process.h> #include <process/process.h>
#include <debug/traceback/traceback.h> #include <debug/traceback/traceback.h>

View File

@ -8,9 +8,9 @@
#pragma once #pragma once
#include "../common/printk.h" #include <common/printk.h>
#include "../common/glib.h" #include <common/glib.h>
#include "../common/asm.h" #include <common/asm.h>
/** /**
* @brief * @brief

View File

@ -1,8 +1,8 @@
#include "mm.h" #include "mm.h"
#include "slab.h" #include "slab.h"
#include "../common/printk.h" #include <common/printk.h>
#include "../common/kprint.h" #include <common/kprint.h>
#include "../driver/multiboot2/multiboot2.h" #include <driver/multiboot2/multiboot2.h>
#include <process/process.h> #include <process/process.h>
ul Total_Memory = 0; ul Total_Memory = 0;

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../common/glib.h" #include <common/glib.h>
// 每个页表的项数 // 每个页表的项数
// 64位下每个页表4k每条页表项8B故一个页表有512条 // 64位下每个页表4k每条页表项8B故一个页表有512条

View File

@ -1,9 +1,9 @@
#pragma once #pragma once
#include "mm.h" #include "mm.h"
#include "../common/glib.h" #include <common/glib.h>
#include "../common/printk.h" #include <common/printk.h>
#include "../common/kprint.h" #include <common/kprint.h>
#define SIZEOF_LONG_ALIGN(size) ((size + sizeof(long) - 1) & ~(sizeof(long) - 1)) #define SIZEOF_LONG_ALIGN(size) ((size + sizeof(long) - 1) & ~(sizeof(long) - 1))
#define SIZEOF_INT_ALIGN(size) ((size + sizeof(int) - 1) & ~(sizeof(int) - 1)) #define SIZEOF_INT_ALIGN(size) ((size + sizeof(int) - 1) & ~(sizeof(int) - 1))

View File

@ -1,10 +1,10 @@
#include "process.h" #include "process.h"
#include "../exception/gate.h" #include <exception/gate.h>
#include "../common/printk.h" #include <common/printk.h>
#include "../common/kprint.h" #include <common/kprint.h>
#include "../syscall/syscall.h" #include <syscall/syscall.h>
#include "../syscall/syscall_num.h" #include <syscall/syscall_num.h>
#include <mm/slab.h> #include <mm/slab.h>
#include <sched/sched.h> #include <sched/sched.h>
#include <filesystem/fat32/fat32.h> #include <filesystem/fat32/fat32.h>

View File

@ -10,10 +10,10 @@
#pragma once #pragma once
#include "../common/cpu.h" #include <common/cpu.h>
#include "../common/glib.h" #include <common/glib.h>
#include "../mm/mm.h" #include <mm/mm.h>
#include "../syscall/syscall.h" #include <syscall/syscall.h>
#include "ptrace.h" #include "ptrace.h"
#include <common/errno.h> #include <common/errno.h>
#include <filesystem/VFS/VFS.h> #include <filesystem/VFS/VFS.h>

View File

@ -1,11 +1,11 @@
#include "smp.h" #include "smp.h"
#include "../common/kprint.h" #include <common/kprint.h>
#include "../driver/interrupt/apic/apic.h" #include <driver/interrupt/apic/apic.h>
#include "../exception/gate.h" #include <exception/gate.h>
#include "../common/cpu.h" #include <common/cpu.h>
#include "../mm/slab.h" #include <mm/slab.h>
#include "../process/process.h" #include <process/process.h>
#include "../process/spinlock.h" #include <process/spinlock.h>
#include <sched/sched.h> #include <sched/sched.h>

View File

@ -1,9 +1,9 @@
#pragma once #pragma once
#include "../common/glib.h" #include <common/glib.h>
#include "../common/asm.h" #include <common/asm.h>
#include "../driver/acpi/acpi.h" #include <driver/acpi/acpi.h>
#include "../driver/interrupt/apic/apic.h" #include <driver/interrupt/apic/apic.h>
#define MAX_SUPPORTED_PROCESSOR_NUM 1024 #define MAX_SUPPORTED_PROCESSOR_NUM 1024

View File

@ -1,5 +1,5 @@
#include "syscall.h" #include "syscall.h"
#include "../process/process.h" #include <process/process.h>
#include <exception/gate.h> #include <exception/gate.h>
#include <exception/irq.h> #include <exception/irq.h>
#include <driver/disk/ahci/ahci.h> #include <driver/disk/ahci/ahci.h>

View File

@ -1,8 +1,8 @@
#pragma once #pragma once
#include "../common/glib.h" #include <common/glib.h>
#include "../common/kprint.h" #include <common/kprint.h>
#include "../process/ptrace.h" #include <process/ptrace.h>
#include <common/unistd.h> #include <common/unistd.h>
// 定义最大系统调用数量 // 定义最大系统调用数量
#define MAX_SYSTEM_CALL_NUM 256 #define MAX_SYSTEM_CALL_NUM 256