磁盘请求在处理时,切换进程

This commit is contained in:
fslongjin
2022-04-19 15:13:59 +08:00
parent 0e8bf69d65
commit 39dd802ff1
14 changed files with 257 additions and 206 deletions

View File

@ -2,6 +2,7 @@
#include "../process/process.h"
#include <exception/gate.h>
#include <exception/irq.h>
#include<driver/disk/ahci/ahci.h>
// 导出系统调用入口函数定义在entry.S中
extern void system_call(void);
@ -85,6 +86,12 @@ ul sys_printf(struct pt_regs *regs)
return 0;
}
ul sys_ahci_end_req(struct pt_regs *regs)
{
ahci_end_request();
return 0;
}
// 系统调用的内核入口程序
void do_syscall_int(struct pt_regs *regs, unsigned long error_code)
{

View File

@ -5,7 +5,7 @@
#include "../process/ptrace.h"
// 定义最大系统调用数量
#define MAX_SYSTEM_CALL_NUM 128
#define MAX_SYSTEM_CALL_NUM 256
#define ESYSCALL_NOT_EXISTS 1
@ -53,6 +53,8 @@ ul system_call_not_exists(struct pt_regs *regs)
*/
ul sys_printf(struct pt_regs *regs);
ul sys_ahci_end_req(struct pt_regs *regs);
// 系统调用的内核入口程序
void do_syscall_int(struct pt_regs *regs, unsigned long error_code);
@ -60,4 +62,5 @@ system_call_t system_call_table[MAX_SYSTEM_CALL_NUM] =
{
[0] = system_call_not_exists,
[1] = sys_printf,
[2 ... MAX_SYSTEM_CALL_NUM - 1] = system_call_not_exists};
[2 ... 254] = system_call_not_exists,
[255] = sys_ahci_end_req};

View File

@ -1,4 +1,15 @@
#pragma once
/**
* 系统调用说明
* 1 printf
*
*
* 255 AHCI end_request
*
*/
#define SYS_NOT_EXISTS 0
#define SYS_PRINTF 1
#define SYS_PRINTF 1
#define SYS_AHCI_END_REQ 255