Changeset 204674e in mainline
- Timestamp:
- 2006-01-15T16:49:10Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4be51c8
- Parents:
- 81703f9
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/interrupt.c
r81703f9 r204674e 28 28 29 29 #include <arch/interrupt.h> 30 #include <syscall/syscall.h> 30 31 #include <print.h> 31 32 #include <debug.h> … … 111 112 } 112 113 113 void syscall(int n, void *st ack)114 void syscall(int n, void *st) 114 115 { 115 printf("cpu%d: syscall\n", CPU->id); 116 thread_usleep(1000); 116 __native *stack = (__native *) st; 117 118 if (stack[-2] < SYSCALL_END) 119 syscall_table[stack[-2]](stack[-5], stack[-3], stack[-4]); 120 else 121 panic("Undefined syscall %d", stack[-2]); 117 122 } 118 123 -
generic/include/syscall/syscall.h
r81703f9 r204674e 30 30 #define __SYSCALL_H__ 31 31 32 #include <typedefs.h> 33 32 34 typedef enum { 33 35 SYS_CTL = 0, … … 39 41 40 42 extern int sys_ctl(void); 41 extern int sys_io( void);43 extern int sys_io(int fd, const void *buf, size_t count); 42 44 43 45 extern syshandler_t syscall_table[SYSCALL_END]; -
generic/src/syscall/syscall.c
r81703f9 r204674e 27 27 */ 28 28 29 #include <arch/types.h>30 29 #include <syscall/syscall.h> 30 #include <print.h> 31 #include <putchar.h> 31 32 32 33 int sys_ctl(void) { 34 printf("SYS_CTL\n"); 33 35 return 0; 34 36 } 35 37 36 int sys_io(void) { 38 int sys_io(int fd, const void * buf, size_t count) { 39 40 // TODO: buf sanity checks and a lot of other stuff ... 41 42 size_t i; 43 44 for (i = 0; i < count; i++) 45 putchar(((char *) buf)[i]); 46 37 47 return 0; 38 48 }
Note:
See TracChangeset
for help on using the changeset viewer.