summaryrefslogtreecommitdiff
path: root/kernel/old/include/syscalls.h
blob: e66f6c026cd748ca4c4e1cef0e0f02c4bf59d85a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**
** @file	syscalls.h
**
** @author	CSCI-452 class of 20245
**
** @brief	System call declarations
*/

#ifndef SYSCALLS_H_
#define SYSCALLS_H_

#include <common.h>

/*
** General (C and/or assembly) definitions
*/

/*
** system call codes
**
** these are used in the user-level C library stub functions,
** and are defined here as CPP macros instead of as an enum
** so that they can be used from assembly
*/

#define SYS_exit        0
#define SYS_waitpid     1
#define SYS_fork        2
#define SYS_exec        3
#define SYS_read        4
#define SYS_write       5
#define SYS_getpid      6
#define SYS_getppid     7
#define SYS_gettime     8
#define SYS_getprio     9
#define SYS_setprio     10
#define SYS_kill        11
#define SYS_sleep       12

// UPDATE THIS DEFINITION IF MORE SYSCALLS ARE ADDED!
#define N_SYSCALLS      13

// dummy system call code for testing our ISR
#define SYS_bogus       0xbad

// interrupt vector entry for system calls
#define VEC_SYSCALL     0x80

#ifndef ASM_SRC

/*
** Start of C-only definitions
*/

/*
** Types
*/

/*
** Globals
*/

/*
** Prototypes
*/

#ifdef KERNEL_SRC

/**
** Name:  sys_init
**
** Syscall module initialization routine
*/
void sys_init( void );

#endif  /* KERNEL_SRC */

#endif  /* !ASM_SRC */

#endif