2 $gLines = file("syscalls.lst");
6 foreach($gLines as $line)
9 if(empty($line)) continue;
11 if( intVal($line) != 0)
14 $lSyscalls[$i++] = explode("\t", $line, 3);
24 * AcessOS Microkernel Version
32 foreach($lSyscalls as $num=>$call)
39 $lHeader .= "#define {$call[0]}\t{$num}";
40 $lHeader .= "\t// {$num} - {$call[1]}\n";
42 $lAsmInc .= "%define {$call[0]}\t{$num}\t; {$call[1]}\n";
50 $lHeader .= "#define NUM_SYSCALLS\t$i\n";
51 $lHeader .= "#define SYS_DEBUG\t0x100 // 0x100 - Print a debug string\n";
53 $lHeader .= "#ifdef __GNUC__\n";
54 $lHeader .= "static const char *cSYSCALL_NAMES[] = {\n\t";
57 for($i=0;$i<$lMax;$i++)
59 if(!isset($lSyscalls[$i]))
62 $lHeader .= "\"".$lSyscalls[$i][0]."\",";
69 $lHeader .= "\"\"\n};\n"
70 $lHeader .= "#endif\n";
71 $lHeader .= "#endif\n";
73 $fp = fopen("include/syscalls.h", "w"); fwrite($fp, $lHeader); fclose($fp);
74 $fp = fopen("include/syscalls.inc.asm", "w"); fwrite($fp, $lAsmInc); fclose($fp);