e61d00351f
in BRANCH-smp-bochs revisions. - The general task was to make multiple CPU's which communicate through their APICs. So instead of BX_CPU and BX_MEM, we now have BX_CPU(x) and BX_MEM(y). For an SMP simulation you have several processors in a shared memory space, so there might be processors BX_CPU(0..3) but only one memory space BX_MEM(0). For cosimulation, you could have BX_CPU(0) with BX_MEM(0), then BX_CPU(1) with BX_MEM(1). WARNING: Cosimulation is almost certainly broken by the SMP changes. - to simulate multiple CPUs, you have to give each CPU time to execute in turn. This is currently implemented using debugger guards. The cpu loop steps one CPU for a few instructions, then steps the next CPU for a few instructions, etc. - there is some limited support in the debugger for two CPUs, for example printing information from each CPU when single stepping.
35 lines
874 B
Perl
Executable File
35 lines
874 B
Perl
Executable File
#!/usr/bin/perl
|
|
#
|
|
# tested with linux 2.2.14
|
|
# reads <asm/unistd.h>, outputs syscalls-linux.h
|
|
|
|
$date = `date`;
|
|
print <<EOF;
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Linux system call table
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Format for each entry:
|
|
// DEF_LINUX_SYSCALL(syscall_number, "syscall_name")
|
|
// This file can be regenerated with the following command:
|
|
//
|
|
// ./make-syscalls-linux.pl < /usr/include/asm/unistd.h > syscalls-linux.h
|
|
//
|
|
EOF
|
|
|
|
$max = 0;
|
|
while (<STDIN>) {
|
|
$line = $_;
|
|
next unless /#define __NR_[a-z]/;
|
|
s/.*NR_//;
|
|
undef $number;
|
|
($name, $number) = split (/[\s]+/);
|
|
if ((length $number) < 1) {
|
|
die "bad line: $line";
|
|
}
|
|
if ($number > $max) { $max = $number; }
|
|
print "DEF_SYSCALL($number, \"$name\")\n";
|
|
}
|
|
|
|
print "#define N_SYSCALLS $max\n";
|