-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathulibs.S
More file actions
55 lines (48 loc) · 1.07 KB
/
ulibs.S
File metadata and controls
55 lines (48 loc) · 1.07 KB
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
/*
** sccs id: @(#)ulibs.S 1.1 4/17/15
**
** File: ulibs.S
**
** Author: CSCI-452 class of 20145
**
** Contributor:
**
** Description: Assembly implementations of user-level library functions
*/
#define __SP_ASM__
#include "syscall.h"
/*
** System call stubs
**
** All have the same structure:
**
** move a code into EAX
** generate the interrupt
** return to the caller
**
** As these are simple "leaf" routines, we don't use
** the standard enter/leave method to set up a stack
** frame - that takes time, and we don't really need it.
*/
#define SYSCALL(name) \
.globl name ; \
name: ; \
movl $SYS_##name, %eax ; \
int $INT_VEC_SYSCALL ; \
ret
SYSCALL(exit)
SYSCALL(spawnp)
SYSCALL(sleep)
SYSCALL(read)
SYSCALL(write)
SYSCALL(get_process_info)
SYSCALL(get_system_info)
SYSCALL(create_file)
SYSCALL(delete_file)
SYSCALL(read_file)
SYSCALL(write_file)
SYSCALL(list_files)
SYSCALL(cd)
// This is a bogus system call; it's here so that we can test
// our handling of out-of-range syscall codes in the syscall ISR.
SYSCALL(bogus)