Mercurial > hg > CbC > CbC_xv6
changeset 390:dccc1cb1350c
impl kernel goto
author | anatofuz |
---|---|
date | Thu, 30 Jul 2020 17:02:53 +0900 |
parents | 174e02ed3509 |
children | 72c38f531ae2 |
files | src/gearsTools/generate_stub.pl |
diffstat | 1 files changed, 16 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gearsTools/generate_stub.pl Tue Jul 28 14:55:05 2020 +0900 +++ b/src/gearsTools/generate_stub.pl Thu Jul 30 17:02:53 2020 +0900 @@ -642,6 +642,12 @@ my $next = $2; my @args = split(/,/, $3); my $v = 0; + my $arg_context = $context_name; + if ($prev =~ /kernel/) { + $prev = ""; + $arg_context = "kernel_context"; + } + if (exists $filename2localCodes{$filename}->{$next}) { print $fd $_; next; } @@ -657,26 +663,26 @@ print $fd "\t*O_$arg = $v;\n"; } if ($hasParGoto) { - print $fd "${prev}Gearef(${context_name}, TaskManager)->taskList = ${context_name}->taskList;\n"; - print $fd "${prev}Gearef(${context_name}, TaskManager)->next1 = C_$next;\n"; - print $fd "${prev}goto meta(${context_name}, C_$next);\n"; + print $fd "${prev}Gearef(${arg_context}, TaskManager)->taskList = ${arg_context}->taskList;\n"; + print $fd "${prev}Gearef(${arg_context}, TaskManager)->next1 = C_$next;\n"; + print $fd "${prev}goto meta(${arg_context}, C_$next);\n"; } else { - print $fd "${prev}${context_name}->before = C_$codeGearName;\n"; - print $fd "${prev}goto meta(${context_name}, $next);\n"; + print $fd "${prev}${arg_context}->before = C_$codeGearName;\n"; + print $fd "${prev}goto meta(${arg_context}, $next);\n"; } next; } if ($hasParGoto) { - print $fd "${prev}Gearef(${context_name}, TaskManager)->taskList = ${context_name}\->taskList;\n"; - print $fd "${prev}Gearef(${context_name}, TaskManager)->next1 = C_$next;\n"; - print $fd "${prev}goto parGotoMeta(${context_name}, C_$next);\n"; + print $fd "${prev}Gearef(${arg_context}, TaskManager)->taskList = ${arg_context}\->taskList;\n"; + print $fd "${prev}Gearef(${arg_context}, TaskManager)->next1 = C_$next;\n"; + print $fd "${prev}goto parGotoMeta(${arg_context}, C_$next);\n"; next; } elsif ($next eq "meta") { print $fd $_; next; } else { - print $fd "${prev}${context_name}\->before = C_$codeGearName;\n"; - print $fd "${prev}goto meta(${context_name}, C_$next);\n"; + print $fd "${prev}${arg_context}\->before = C_$codeGearName;\n"; + print $fd "${prev}goto meta(${arg_context}, C_$next);\n"; next; } } elsif(/^.*(struct|union)?\s(\w+)\*\s(\w+)\s?[=;]/) {