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
33 foreach($lSyscalls as $num=>$call)
40 $lHeader .= "\t{$call[0]}";
41 if($i != $num) $lHeader .= " = {$num}";
42 $lHeader .= ",\t// {$num} - {$call[1]}\n";
44 $lAsmInc .= "%define {$call[0]}\t{$num}\t; {$call[1]}\n";
52 $lHeader .= "\tNUM_SYSCALLS,\n";
53 $lHeader .= "\tSYS_DEBUG = 0x100 // 0x100 - Print a debug string\n";
55 $lHeader .= "static const char *cSYSCALL_NAMES[] = {\n\t";
58 for($i=0;$i<$lMax;$i++)
60 if(!isset($lSyscalls[$i]))
63 $lHeader .= "\"".$lSyscalls[$i][0]."\",";
70 $lHeader .= "\"\"\n};\n#endif\n";
72 $fp = fopen("include/syscalls.h", "w"); fwrite($fp, $lHeader); fclose($fp);
73 $fp = fopen("include/syscalls.inc.asm", "w"); fwrite($fp, $lAsmInc); fclose($fp);