diff options
author | Christopher Faylor <me@cgf.cx> | 2012-04-03 00:41:46 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-04-03 00:41:46 +0400 |
commit | 17a61045ffe0acdbdb0f84ddfc34d3eb47666e57 (patch) | |
tree | 681d3d6a8826eb99dfb76d60207ef8b845bc0117 /winsup/cygwin/gendevices | |
parent | eb7729eb36da9c27121d17d088860079d4c64625 (diff) |
* devices.h (lives_in_dev): New field.
(dev_on_fs): Set bit size.
(is_dev_resident): Define new method.
* devices.in: Use different method for labelling requested name for dev
storage: prefix it with a ='. Use an actual ':' to denote an internal device.
(exists_console): Avoid repeated test.
(exists_ntdev_silent): Rename from the less-descriptive exists_ntdevs.
(dev_dev_storage): Delete unneeded define.
* gendevices: Add a flag to each line denoting whether the device lives in /dev
space.
(generate): Handle special ":" case here for internal devices. Parse
=something_dev as requiring a storage location. Tack the rest of the line back
onto the reformulated "$rest".
* devices.cc: Regenerate.
Diffstat (limited to 'winsup/cygwin/gendevices')
-rwxr-xr-x | winsup/cygwin/gendevices | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/winsup/cygwin/gendevices b/winsup/cygwin/gendevices index fde4a43ee..3e514bcab 100755 --- a/winsup/cygwin/gendevices +++ b/winsup/cygwin/gendevices @@ -41,6 +41,7 @@ while (<INPUT>) { my $x = $f->[0]; my $rest = $f->[1]; my ($dev, $devrest) = ($x =~ /([^%]+)(%.*)?$/o); + $rest .= ', ' . (($dev =~ m%/dev/%o) ? 'true' : 'false'); push(@lines, generate($dev, $devrest, $rest, [])); } @patterns = (); @@ -84,7 +85,6 @@ for (my $i = 0; $i < @lines; $i++) { splice(@lines, $i, 1); redo; }; - $lines[$i] =~ s%"//%":%go; } open(OUTPUT, '>', $output) or do {{ if (chmod(0664, $output)) { @@ -117,6 +117,7 @@ sub generate { } else { my $fh = $dev; $fh =~ s%/%_%og; + $fh =~ s%^:%__%o; my $shilka_id = $fh; my $storage_str = $fh . '_storage'; $fh =~ s/^_dev_/FH_/o; @@ -127,9 +128,9 @@ sub generate { @lines = ('"' . $dev . '"' . " = $shilka_id {return $storage_loc;}\n"); $rest = "$fh, $rest" if $rest =~ /^"/o; $rest = fixup($rest, $vars); - if ($rest =~ /^(.*), ([a-z_]*_dev)/) { + if ($rest =~ /^(.*), =(\S*_dev)\b\s*(.*)$/) { $pointers{$2} ||= "const device *$2 = $storage_loc;\n"; - $rest = $1; + $rest = $1 . $3; } push(@storage, " {\"$dev\", " . $rest . "},\n"); } |