Mercurial > hg > Members > menikon > CbC_xv6
changeset 295:274bbf78b87b
fix sort enum Codes at dump context.h
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 04 Feb 2020 14:04:34 +0900 |
parents | cabe731b1c88 |
children | 124c51584208 |
files | src/gearsTools/lib/Gears/Util.pm src/interface/vm.h |
diffstat | 2 files changed, 21 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gearsTools/lib/Gears/Util.pm Tue Feb 04 13:40:45 2020 +0900 +++ b/src/gearsTools/lib/Gears/Util.pm Tue Feb 04 14:04:34 2020 +0900 @@ -164,8 +164,20 @@ my $context = "${space}//$h2context->{file_name}\n"; $context .= "${space}struct $h2context->{name} {\n"; my $content_space; - if (exists $h2context->{content}){ - my @chars = split //, $h2context->{content}->[0]; + + my @enumCodes; + my @var; + + for my $c (@{$h2context->{content}}) { + if ($c =~ /\A\s*enum Code/) { + push(@enumCodes,$c); + } else { + push(@var,$c); + } + } + + if (@var){ + my @chars = split //, $var[0]; for my $w (@chars) { last if ($w !~ /\s/); $content_space .= $w; @@ -176,10 +188,16 @@ $content_space = ""; } - for my $c (@{$h2context->{content}}) { + for my $c (@var) { $c =~ s/$content_space//; $context .= "${space}${space}$c"; } + + for my $c (@enumCodes) { + $c =~ s/$content_space//; + $context .= "${space}${space}$c"; + } + $context .= "${space}} $h2context->{name};\n"; return $context; }
--- a/src/interface/vm.h Tue Feb 04 13:40:45 2020 +0900 +++ b/src/interface/vm.h Tue Feb 04 14:04:34 2020 +0900 @@ -1,22 +1,4 @@ typedef struct vm<Type,Impl> { - union Data* vm; - uint low; - uint hi; - struct proc* p; - pde_t* pgdir; - char* init; - uint sz; - char* addr; - struct inode* ip; - uint offset; - uint oldsz; - uint newsz; - char* uva; - uint va; - void* pp; - uint len; - uint phy_low; - uint phy_hi; __code init_vmm(Impl* vm, __code next(...)); __code kpt_freerange(Impl* vm, uint low, uint hi, __code next(...)); __code kpt_alloc(Impl* vm ,__code next(...));