Handle up to 63 partitions per drive

Revamp device parsing code.  Introducing support for more partitions
into the shilka-generated parser has the unfortunate side-effect of
raising the size of the DLL by almost 2 Megs.  Therefore we split out
the handling for /dev/sdXY devices into a tiny bit of hand-written
code.

While at it, remove some unused cruft from devices.* and generally
clean up the device class to provide access methods instead of direct
access to members.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2016-06-23 16:56:41 +02:00
parent bceb8ebebb
commit b2867a68b9
21 changed files with 5268 additions and 40170 deletions

View File

@@ -54,7 +54,7 @@ chop $storage[$#storage];
chop $storage[$#storage];
$storage[$#storage] .= "\n";
splice(@lines, $storage_ix, 1,
"const _RDATA device dev_storage[] =\n", "{\n",
"const _RDATA _device dev_storage[] =\n", "{\n",
@storage, "};\n\n",
sort {$a cmp $b} values %pointers);
open(SHILKA, '>', $shilka);
@@ -128,7 +128,7 @@ sub generate {
$rest = "$fh, $rest" if $rest =~ /^"/o;
$rest = fixup($rest, $vars);
if ($rest =~ /^(.*), =(\S*_dev)\b\s*(.*)$/) {
$pointers{$2} ||= "const device *$2 = $storage_loc;\n";
$pointers{$2} ||= "const _device *$2 = $storage_loc;\n";
$rest = $1 . $3;
}
push(@storage, " {\"$dev\", " . $rest . "},\n");