CS318 - Pintos
Pintos source browser for JHU CS318 course
|
Go to the documentation of this file.
2 #include "../syscall-nr.h"
6 #define syscall0(NUMBER) \
10 ("pushl %[number]; int $0x30; addl $4, %%esp" \
12 : [number] "i" (NUMBER) \
19 #define syscall1(NUMBER, ARG0) \
23 ("pushl %[arg0]; pushl %[number]; int $0x30; addl $8, %%esp" \
25 : [number] "i" (NUMBER), \
33 #define syscall2(NUMBER, ARG0, ARG1) \
37 ("pushl %[arg1]; pushl %[arg0]; " \
38 "pushl %[number]; int $0x30; addl $12, %%esp" \
40 : [number] "i" (NUMBER), \
49 #define syscall3(NUMBER, ARG0, ARG1, ARG2) \
53 ("pushl %[arg2]; pushl %[arg1]; pushl %[arg0]; " \
54 "pushl %[number]; int $0x30; addl $16, %%esp" \
56 : [number] "i" (NUMBER), \
127 seek (
int fd,
unsigned position)
Tests if a fd represents a directory.
Change the current directory.
bool readdir(int fd, char name[READDIR_MAX_LEN+1])
Report current position in a file.
int write(int fd, const void *buffer, unsigned size)
pid_t exec(const char *file)
Wait for a child process to die.
Returns the inode number for a fd.
#define NOT_REACHED()
lib/debug.h
#define syscall1(NUMBER, ARG0)
Invokes syscall NUMBER, passing argument ARG0, and returns the return value as an ‘int’.
bool mkdir(const char *dir)
bool remove(const char *file)
bool chdir(const char *dir)
Project 4 only.
int open(const char *file)
Halt the operating system.
void halt(void)
Projects 2 and later.
#define syscall3(NUMBER, ARG0, ARG1, ARG2)
Invokes syscall NUMBER, passing arguments ARG0, ARG1, and ARG2, and returns the return value as an ‘i...
Change position in a file.
void seek(int fd, unsigned position)
int inumber(int fd)
lib/user/syscall.h
#define READDIR_MAX_LEN
Maximum characters in a filename written by readdir().
int pid_t
Process identifier.
#define syscall2(NUMBER, ARG0, ARG1)
Invokes syscall NUMBER, passing arguments ARG0 and ARG1, and returns the return value as an ‘int’.
mapid_t mmap(int fd, void *addr)
Project 3 and optionally project 4.
#define syscall0(NUMBER)
Invokes syscall NUMBER, passing no arguments, and returns the return value as an ‘int’.
void munmap(mapid_t mapid)
int mapid_t
Map region identifier.
int read(int fd, void *buffer, unsigned size)
bool create(const char *file, unsigned initial_size)