mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-08 18:26:48 +00:00
将进程同步原语移动到common文件夹下
This commit is contained in:
parent
ae6d8a19dd
commit
a02acbdbe6
@ -2,7 +2,7 @@
|
||||
|
||||
## 简介
|
||||
|
||||
  DragonOS实现了原子变量,类型为atomic_t. 原子变量是基于具体体系结构的原子操作指令实现的。具体实现在`kernel/process/atomic.h`中。
|
||||
  DragonOS实现了原子变量,类型为atomic_t. 原子变量是基于具体体系结构的原子操作指令实现的。具体实现在`kernel/common/atomic.h`中。
|
||||
|
||||
## API
|
||||
|
||||
|
@ -3,7 +3,7 @@ CFLAGS += -I .
|
||||
|
||||
kernel_common_subdirs:=libELF math
|
||||
|
||||
all: glib.o printk.o cpu.o bitree.o kfifo.o
|
||||
all: glib.o printk.o cpu.o bitree.o kfifo.o wait_queue.o
|
||||
@list='$(kernel_common_subdirs)'; for subdir in $$list; do \
|
||||
echo "make all in $$subdir";\
|
||||
cd $$subdir;\
|
||||
@ -25,3 +25,6 @@ bitree.o: bitree.c
|
||||
|
||||
kfifo.o: kfifo.c
|
||||
gcc $(CFLAGS) -c kfifo.c -o kfifo.o
|
||||
|
||||
wait_queue.o: wait_queue.c
|
||||
gcc $(CFLAGS) -c wait_queue.c -o wait_queue.o
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "kprint.h"
|
||||
#include <driver/multiboot2/multiboot2.h>
|
||||
#include <mm/mm.h>
|
||||
#include <process/spinlock.h>
|
||||
#include <common/spinlock.h>
|
||||
|
||||
#include <driver/uart/uart.h>
|
||||
#include <driver/video/video.h>
|
||||
|
@ -10,7 +10,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <process/atomic.h>
|
||||
#include <common/atomic.h>
|
||||
|
||||
#include <process/process.h>
|
||||
#include <sched/sched.h>
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <common/glib.h>
|
||||
#include "stdint.h"
|
||||
#include <process/semaphore.h>
|
||||
#include <common/semaphore.h>
|
||||
|
||||
#define BLK_TYPE_AHCI 0
|
||||
struct block_device_operation
|
||||
|
@ -4,8 +4,8 @@
|
||||
#include <mm/slab.h>
|
||||
#include <common/printk.h>
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <process/wait_queue.h>
|
||||
#include <process/spinlock.h>
|
||||
#include <common/wait_queue.h>
|
||||
#include <common/spinlock.h>
|
||||
#include <common/kfifo.h>
|
||||
|
||||
// 键盘输入缓冲区
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <smp/ipi.h>
|
||||
#include <driver/video/video.h>
|
||||
#include <driver/interrupt/apic/apic_timer.h>
|
||||
#include <process/spinlock.h>
|
||||
#include <common/spinlock.h>
|
||||
|
||||
static struct acpi_HPET_description_table_t *hpet_table;
|
||||
static uint64_t HPET_REG_BASE = 0;
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <common/kprint.h>
|
||||
#include <driver/pci/pci.h>
|
||||
#include <debug/bug.h>
|
||||
#include <process/spinlock.h>
|
||||
#include <common/spinlock.h>
|
||||
|
||||
extern spinlock_t xhci_controller_init_lock; // xhci控制器初始化锁
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "xhci.h"
|
||||
#include <common/kprint.h>
|
||||
#include <debug/bug.h>
|
||||
#include <process/spinlock.h>
|
||||
#include <common/spinlock.h>
|
||||
#include <mm/mm.h>
|
||||
#include <mm/slab.h>
|
||||
#include <debug/traceback/traceback.h>
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <common/kprint.h>
|
||||
#include <mm/mm.h>
|
||||
#include <mm/slab.h>
|
||||
#include <process/spinlock.h>
|
||||
#include <common/spinlock.h>
|
||||
#include <exception/softirq.h>
|
||||
|
||||
// 每个时刻只能有1个进程新增定时任务
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <common/kprint.h>
|
||||
#include <process/process.h>
|
||||
#include <driver/video/video.h>
|
||||
#include <process/spinlock.h>
|
||||
#include <common/spinlock.h>
|
||||
|
||||
static spinlock_t softirq_modify_lock; // 软中断状态(status)
|
||||
static volatile uint64_t softirq_pending = 0;
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <common/kprint.h>
|
||||
#include <driver/disk/ahci/ahci.h>
|
||||
#include <filesystem/MBR.h>
|
||||
#include <process/spinlock.h>
|
||||
#include <common/spinlock.h>
|
||||
#include <mm/slab.h>
|
||||
#include <common/errno.h>
|
||||
#include <common/stdio.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
all: procs.o process.o wait_queue.o
|
||||
all: procs.o process.o
|
||||
|
||||
CFLAGS += -I .
|
||||
|
||||
@ -12,8 +12,7 @@ procs.o: proc.S
|
||||
process.o: process.c
|
||||
gcc $(CFLAGS) -c process.c -o process.o
|
||||
|
||||
wait_queue.o: wait_queue.c
|
||||
gcc $(CFLAGS) -c wait_queue.c -o wait_queue.o
|
||||
|
||||
|
||||
clean:
|
||||
echo "Done."
|
@ -11,7 +11,7 @@
|
||||
#include <exception/gate.h>
|
||||
#include <filesystem/fat32/fat32.h>
|
||||
#include <mm/slab.h>
|
||||
#include <process/spinlock.h>
|
||||
#include <common/spinlock.h>
|
||||
#include <syscall/syscall.h>
|
||||
#include <syscall/syscall_num.h>
|
||||
#include <sched/sched.h>
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "ptrace.h"
|
||||
#include <common/errno.h>
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <process/wait_queue.h>
|
||||
#include <common/wait_queue.h>
|
||||
|
||||
// 进程最大可拥有的文件描述符数量
|
||||
#define PROC_MAX_FD_NUM 16
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "sched.h"
|
||||
#include <common/kprint.h>
|
||||
#include <driver/video/video.h>
|
||||
#include <process/spinlock.h>
|
||||
#include <common/spinlock.h>
|
||||
|
||||
struct sched_queue_t sched_cfs_ready_queue[MAX_CPU_NUM]; // 就绪队列
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <common/cpu.h>
|
||||
#include <mm/slab.h>
|
||||
#include <process/process.h>
|
||||
#include <process/spinlock.h>
|
||||
#include <common/spinlock.h>
|
||||
|
||||
#include <sched/sched.h>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user