Main Page | Directories | File List | Globals

syscalls.c

Go to the documentation of this file.
00001 /*
00002  * kernel_arch/i386/kernel/syscalls.c
00003  *
00004  * Copyright (c) 2003-2004 Lukasz Dembinski <dembol@nasa.com.pl>
00005  * All Rights Reserved
00006  * 
00007  * Date:        2004/01
00008  * Author:      Lukasz Dembinski
00009  * Info:        syscalls.c core file
00010  * Contact:     mailto: <dembol@nasa.com.pl>
00011  *
00012  */
00013 
00014 #include <agnix/agnix.h>
00015 #include <agnix/init.h>
00016 #include <agnix/linkage.h>
00017 #include <agnix/unistd.h>
00018 #include <agnix/tasks.h>
00019 #include <agnix/syscalls.h>
00020 #include <agnix/console.h>
00021 
00022 extern struct tss_wrap_s init_tss[MAX_TASKS];
00023 extern struct tss_s *syscall_tss;
00024 
00025 int (*syscall_table[0xFF])(struct regs_s *regs) = 
00026 {
00027     SYS_CALL_NAME(not_implemented),
00028     SYS_CALL_NAME(exit),                /* 1 */
00029     SYS_CALL_NAME(fork),                /* 2 */
00030     SYS_CALL_NAME(read),
00031     SYS_CALL_NAME(write),
00032     SYS_CALL_NAME(open),
00033     SYS_CALL_NAME(not_implemented),
00034     SYS_CALL_NAME(not_implemented),
00035     SYS_CALL_NAME(not_implemented),
00036     SYS_CALL_NAME(not_implemented),
00037     SYS_CALL_NAME(not_implemented),     /* 10 */
00038     SYS_CALL_NAME(not_implemented),
00039     SYS_CALL_NAME(not_implemented),
00040     SYS_CALL_NAME(time),
00041     SYS_CALL_NAME(not_implemented),
00042     SYS_CALL_NAME(not_implemented),
00043     SYS_CALL_NAME(not_implemented),
00044     SYS_CALL_NAME(not_implemented),
00045     SYS_CALL_NAME(not_implemented),
00046     SYS_CALL_NAME(not_implemented),
00047     SYS_CALL_NAME(getpid),              /* 20 */
00048     SYS_CALL_NAME(not_implemented),
00049     SYS_CALL_NAME(not_implemented),
00050     SYS_CALL_NAME(not_implemented),
00051     SYS_CALL_NAME(not_implemented),
00052     SYS_CALL_NAME(not_implemented),
00053     SYS_CALL_NAME(not_implemented),
00054     SYS_CALL_NAME(not_implemented),
00055     SYS_CALL_NAME(not_implemented),
00056     SYS_CALL_NAME(not_implemented),
00057     SYS_CALL_NAME(not_implemented),     /* 30 */
00058     SYS_CALL_NAME(not_implemented),
00059     SYS_CALL_NAME(not_implemented),
00060     SYS_CALL_NAME(not_implemented),
00061     SYS_CALL_NAME(nice),                /* 34 */
00062     SYS_CALL_NAME(not_implemented),
00063     SYS_CALL_NAME(not_implemented),
00064     SYS_CALL_NAME(kill),                /* 37 */
00065     SYS_CALL_NAME(not_implemented),
00066     SYS_CALL_NAME(not_implemented),
00067     SYS_CALL_NAME(not_implemented),     /* 40 */
00068     SYS_CALL_NAME(not_implemented),
00069     SYS_CALL_NAME(not_implemented),
00070     SYS_CALL_NAME(not_implemented),
00071     SYS_CALL_NAME(not_implemented),
00072     SYS_CALL_NAME(not_implemented),
00073     SYS_CALL_NAME(not_implemented),
00074     SYS_CALL_NAME(not_implemented),
00075     SYS_CALL_NAME(not_implemented),
00076     SYS_CALL_NAME(not_implemented),
00077     SYS_CALL_NAME(not_implemented),     /* 50 */
00078     SYS_CALL_NAME(not_implemented),
00079     SYS_CALL_NAME(not_implemented),
00080     SYS_CALL_NAME(not_implemented),
00081     SYS_CALL_NAME(not_implemented),
00082     SYS_CALL_NAME(not_implemented),
00083     SYS_CALL_NAME(not_implemented),
00084     SYS_CALL_NAME(not_implemented),
00085     SYS_CALL_NAME(not_implemented),
00086     SYS_CALL_NAME(not_implemented),
00087     SYS_CALL_NAME(not_implemented),     /* 60 */
00088     SYS_CALL_NAME(not_implemented),
00089     SYS_CALL_NAME(not_implemented),
00090     SYS_CALL_NAME(not_implemented),
00091     SYS_CALL_NAME(not_implemented),
00092     SYS_CALL_NAME(not_implemented),
00093     SYS_CALL_NAME(not_implemented),
00094     SYS_CALL_NAME(sigaction),           /* 67 */
00095     SYS_CALL_NAME(not_implemented),
00096     SYS_CALL_NAME(not_implemented),
00097     SYS_CALL_NAME(not_implemented),     /* 70 */
00098     SYS_CALL_NAME(not_implemented),
00099     SYS_CALL_NAME(not_implemented),
00100     SYS_CALL_NAME(not_implemented),
00101     SYS_CALL_NAME(not_implemented),
00102     SYS_CALL_NAME(not_implemented),
00103     SYS_CALL_NAME(not_implemented),
00104     SYS_CALL_NAME(not_implemented),
00105     SYS_CALL_NAME(not_implemented),
00106     SYS_CALL_NAME(not_implemented),
00107     SYS_CALL_NAME(not_implemented),     /* 80 */
00108     SYS_CALL_NAME(not_implemented),
00109     SYS_CALL_NAME(not_implemented),
00110     SYS_CALL_NAME(not_implemented),
00111     SYS_CALL_NAME(not_implemented),
00112     SYS_CALL_NAME(not_implemented),
00113     SYS_CALL_NAME(not_implemented),
00114     SYS_CALL_NAME(not_implemented),
00115     SYS_CALL_NAME(not_implemented),
00116     SYS_CALL_NAME(not_implemented),
00117     SYS_CALL_NAME(not_implemented),     /* 90 */
00118     SYS_CALL_NAME(not_implemented),
00119     SYS_CALL_NAME(not_implemented),
00120     SYS_CALL_NAME(not_implemented),
00121     SYS_CALL_NAME(not_implemented),
00122     SYS_CALL_NAME(not_implemented),
00123     SYS_CALL_NAME(not_implemented),
00124     SYS_CALL_NAME(not_implemented),
00125     SYS_CALL_NAME(not_implemented),
00126     SYS_CALL_NAME(not_implemented),
00127     SYS_CALL_NAME(not_implemented),     /* 100 */
00128     SYS_CALL_NAME(not_implemented),
00129     SYS_CALL_NAME(not_implemented),
00130     SYS_CALL_NAME(not_implemented),
00131     SYS_CALL_NAME(setitimer),
00132     SYS_CALL_NAME(getitimer),
00133     SYS_CALL_NAME(not_implemented),
00134     SYS_CALL_NAME(not_implemented),
00135     SYS_CALL_NAME(not_implemented),
00136     SYS_CALL_NAME(not_implemented),
00137     SYS_CALL_NAME(not_implemented),     /* 110 */
00138     SYS_CALL_NAME(not_implemented),
00139     SYS_CALL_NAME(not_implemented),
00140     SYS_CALL_NAME(not_implemented),
00141     SYS_CALL_NAME(not_implemented),
00142     SYS_CALL_NAME(not_implemented),
00143     SYS_CALL_NAME(not_implemented),
00144     SYS_CALL_NAME(not_implemented),
00145     SYS_CALL_NAME(not_implemented),
00146     SYS_CALL_NAME(sigreturn),           /* 119 */
00147     SYS_CALL_NAME(not_implemented),     /* 120 */
00148     SYS_CALL_NAME(not_implemented),
00149     SYS_CALL_NAME(not_implemented),
00150     SYS_CALL_NAME(not_implemented),
00151     SYS_CALL_NAME(not_implemented),
00152     SYS_CALL_NAME(not_implemented),
00153     SYS_CALL_NAME(not_implemented),
00154     SYS_CALL_NAME(not_implemented),
00155     SYS_CALL_NAME(not_implemented),
00156     SYS_CALL_NAME(not_implemented)
00157 };
00158 
00159 asmlinkage void syscall_irq(struct regs_s regs)
00160 {
00161     u32 function;
00162     int ret;
00163     
00164     function = regs.eax;
00165 
00166     if (syscall_table[function] != 0) {
00167         ret = syscall_table[function](&regs);
00168         regs.eax = (u32)ret;
00169     }
00170 }
Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix