r/include/proto.h

75 lines
1.8 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
proto.h
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Forrest Yu, 2005
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#include "proc.h"
/* klib.asm */
PUBLIC void out_byte(u16 port, u8 value);
PUBLIC u8 in_byte(u16 port);
PUBLIC void disp_str(char * info);
PUBLIC void disp_color_str(char * info, int color);
/* protect.c */
PUBLIC void init_prot();
PUBLIC u32 seg2phys(u16 seg);
/* klib.c */
PUBLIC void delay(int time);
/* kernel.asm */
void restart();
/* main.c */
void TestA();
void TestB();
void TestC();
/* i8259.c */
PUBLIC void put_irq_handler(int irq, irq_handler handler);
PUBLIC void spurious_irq(int irq);
/* clock.c */
PUBLIC void clock_handler(int irq);
/* 以下是系统调用相关 */
/* proc.c */
PUBLIC int sys_get_ticks(); /* sys_call */
PUBLIC void sys_ms_delay_proc(int); /* TODO 被分配的时间片的操作*/
/* syscall.asm */
PUBLIC void sys_call(); /* int_handler */
PUBLIC int get_ticks();
PUBLIC void sys_p_impl(SEMAPHORE *);
PUBLIC void sys_v_impl(SEMAPHORE *);
//TODO 新增的系统调用
//打印字符串的系统调用封装内核函数disp_str
PUBLIC void print_str(char *);
PUBLIC void sys_print_str(char *);
//不被分配时间片的系统调用
PUBLIC void sys_ms_delay(int);
PUBLIC void ms_delay(int);
//pv实现
PUBLIC void sys_p(SEMAPHORE *);
PUBLIC void sys_v(SEMAPHORE *);
PUBLIC void p(SEMAPHORE *);
PUBLIC void v(SEMAPHORE *);
//TODO 读者写者问题调用
void A();
void READER_B();
void READER_C();
void READER_D();
void WRITER_E();
void WRITER_F();