* devices.h: Move a few device major numbers. Fix typo of FH_UDP.

* device.shilka: Remove /dev/hd device entries, rename all device_hd*
	to device_sd*.
	(device::parse): Disallow units outside lower and upper bounds.
	* dtable.cc (build_fh_pc): Fix typo of FH_UDP.
	* path.cc (win32_device_name): Fix win32 name creation to match new
	device handling.
This commit is contained in:
Corinna Vinschen 2003-09-28 09:44:13 +00:00
parent 83abcab4c0
commit 5c770c8431
6 changed files with 556 additions and 938 deletions

View File

@ -1,3 +1,13 @@
2003-09-28 Corinna Vinschen <corinna@vinschen.de>
* devices.h: Move a few device major numbers. Fix typo of FH_UDP.
* device.shilka: Remove /dev/hd device entries, rename all device_hd*
to device_sd*.
(device::parse): Disallow units outside lower and upper bounds.
* dtable.cc (build_fh_pc): Fix typo of FH_UDP.
* path.cc (win32_device_name): Fix win32 name creation to match new
device handling.
2003-09-27 Christopher Faylor <cgf@redhat.com>
* device.shilka (device::parse): Allow units on other than tty.

File diff suppressed because it is too large Load Diff

View File

@ -60,8 +60,8 @@ enum fh_devices
FH_NTAPE = FHDEV (DEV_TAPE_MAJOR, 128),
FH_MAXNTAPE= FHDEV (DEV_TAPE_MAJOR, 255),
DEV_SD_MAJOR = 3,
DEV_SD1_MAJOR = 90,
DEV_SD_MAJOR = 8,
DEV_SD1_MAJOR = 65,
FH_SD = FHDEV (DEV_SD_MAJOR, 0),
FH_SD1 = FHDEV (DEV_SD1_MAJOR, 0),
FH_SDA = FHDEV (DEV_SD_MAJOR, 0),
@ -100,17 +100,17 @@ enum fh_devices
FH_URANDOM = FHDEV (1, 9),
FH_OSS_DSP = FHDEV (14, 3),
DEV_CYGDRIVE_MAJOR = 30,
DEV_CYGDRIVE_MAJOR = 29,
FH_CYGDRIVE= FHDEV (DEV_CYGDRIVE_MAJOR, 0),
FH_CYGDRIVE_A= FHDEV (DEV_CYGDRIVE_MAJOR, 'a'),
FH_CYGDRIVE_Z= FHDEV (DEV_CYGDRIVE_MAJOR, 'z'),
DEV_RAWDRIVE_MAJOR = 65,
DEV_RAWDRIVE_MAJOR = 66,
FH_RAWDRIVE= FHDEV (DEV_RAWDRIVE_MAJOR, 0),
DEV_TCP_MAJOR = 30,
FH_TCP = FHDEV (DEV_TCP_MAJOR, 36),
FH_UCP = FHDEV (DEV_TCP_MAJOR, 39),
FH_UDP = FHDEV (DEV_TCP_MAJOR, 39),
FH_ICMP = FHDEV (DEV_TCP_MAJOR, 33),
FH_UNIX = FHDEV (DEV_TCP_MAJOR, 120),
FH_STREAM = FHDEV (DEV_TCP_MAJOR, 121),

View File

@ -31,7 +31,7 @@ const device dev_tcp_storage =
{"/dev/inet/tcp", FH_TCP, "", 0, 0, 0, 0};
const device dev_udp_storage =
{"/dev/inet/udp", FH_UCP, "", 0, 0, 0, 0};
{"/dev/inet/udp", FH_UDP, "", 0, 0, 0, 0};
const device dev_icmp_storage =
{"/dev/inet/icmp", FH_ICMP, "", 0, 0, 0, 0};
@ -129,83 +129,83 @@ const device dev_cdrom_storage =
const device dev_sr_storage =
{"/dev/sr", FH_CDROM, "\\Device\\CdRom%d", 0, 15};
const device dev_hda_storage =
{"/dev/hda", FH_SDA, "\\Device\\Harddisk%d\\Partition%d", 1, 16, -1};
const device dev_sda_storage =
{"/dev/sda", FH_SDA, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 0};
const device dev_hdb_storage =
{"/dev/hdb", FH_SDB, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 15};
const device dev_sdb_storage =
{"/dev/sdb", FH_SDB, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 16};
const device dev_hdc_storage =
{"/dev/hdc", FH_SDC, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 31};
const device dev_sdc_storage =
{"/dev/sdc", FH_SDC, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 32};
const device dev_hdd_storage =
{"/dev/hdd", FH_SDD, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 47};
const device dev_sdd_storage =
{"/dev/sdd", FH_SDD, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 48};
const device dev_hde_storage =
{"/dev/hde", FH_SDE, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 63};
const device dev_sde_storage =
{"/dev/sde", FH_SDE, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 64};
const device dev_hdf_storage =
{"/dev/hdf", FH_SDF, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 79};
const device dev_sdf_storage =
{"/dev/sdf", FH_SDF, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 80};
const device dev_hdg_storage =
{"/dev/hdg", FH_SDG, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 95};
const device dev_sdg_storage =
{"/dev/sdg", FH_SDG, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 96};
const device dev_hdh_storage =
{"/dev/hdh", FH_SDH, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 111};
const device dev_sdh_storage =
{"/dev/sdh", FH_SDH, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 112};
const device dev_hdi_storage =
{"/dev/hdi", FH_SDI, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 127};
const device dev_sdi_storage =
{"/dev/sdi", FH_SDI, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 128};
const device dev_hdj_storage =
{"/dev/hdj", FH_SDJ, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 143};
const device dev_sdj_storage =
{"/dev/sdj", FH_SDJ, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 144};
const device dev_hdk_storage =
{"/dev/hdk", FH_SDK, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 159};
const device dev_sdk_storage =
{"/dev/sdk", FH_SDK, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 160};
const device dev_hdl_storage =
{"/dev/hdl", FH_SDL, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 175};
const device dev_sdl_storage =
{"/dev/sdl", FH_SDL, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 176};
const device dev_hdm_storage =
{"/dev/hdm", FH_SDM, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 191};
const device dev_sdm_storage =
{"/dev/sdm", FH_SDM, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 192};
const device dev_hdn_storage =
{"/dev/hdn", FH_SDN, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 207};
const device dev_sdn_storage =
{"/dev/sdn", FH_SDN, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 208};
const device dev_hdo_storage =
{"/dev/hdo", FH_SDO, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 223};
const device dev_sdo_storage =
{"/dev/sdo", FH_SDO, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 224};
const device dev_hdp_storage =
{"/dev/hdp", FH_SDP, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 239};
const device dev_sdp_storage =
{"/dev/sdp", FH_SDP, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 240};
const device dev_hdq_storage =
{"/dev/hdq", FH_SDQ, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 255 /* FIXME 8 bit lunacy */};
const device dev_sdq_storage =
{"/dev/sdq", FH_SDQ, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 256};
const device dev_hdr_storage =
{"/dev/hdr", FH_SDR, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 271};
const device dev_sdr_storage =
{"/dev/sdr", FH_SDR, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 272};
const device dev_hds_storage =
{"/dev/hds", FH_SDS, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 287};
const device dev_sds_storage =
{"/dev/sds", FH_SDS, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 288};
const device dev_hdt_storage =
{"/dev/hdt", FH_SDT, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 303};
const device dev_sdt_storage =
{"/dev/sdt", FH_SDT, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 304};
const device dev_hdu_storage =
{"/dev/hdu", FH_SDU, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 319};
const device dev_sdu_storage =
{"/dev/sdu", FH_SDU, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 320};
const device dev_hdv_storage =
{"/dev/hdv", FH_SDV, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 335};
const device dev_sdv_storage =
{"/dev/sdv", FH_SDV, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 336};
const device dev_hdw_storage =
{"/dev/hdw", FH_SDW, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 351};
const device dev_sdw_storage =
{"/dev/sdw", FH_SDW, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 352};
const device dev_hdx_storage =
{"/dev/hdx", FH_SDX, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 367};
const device dev_sdx_storage =
{"/dev/sdx", FH_SDX, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 368};
const device dev_hdy_storage =
{"/dev/hdy", FH_SDY, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 383};
const device dev_sdy_storage =
{"/dev/sdy", FH_SDY, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 384};
const device dev_hdz_storage =
{"/dev/hdz", FH_SDZ, "\\Device\\Harddisk%d\\Partition%d", 1, 16, 399};
const device dev_sdz_storage =
{"/dev/sdz", FH_SDZ, "\\Device\\Harddisk%d\\Partition%d", 1, 15, 400};
const device dev_rawdrive_storage =
{"/dev/rawdrive", FH_RAWDRIVE, "\\DosDevices\\%c:", 0, 0, 0, 0};
@ -282,58 +282,32 @@ const device *uniq_devices[] =
"/dev/fd" = fd {return &dev_floppy_storage;}
"/dev/scd" = scd {return &dev_cdrom_storage;}
"/dev/sr" = sr {return &dev_sr_storage;}
"/dev/hda" = hda {return &dev_hda_storage;}
"/dev/hdb" = hdb {return &dev_hdb_storage;}
"/dev/hdc" = hdc {return &dev_hdc_storage;}
"/dev/hdd" = hdd {return &dev_hdd_storage;}
"/dev/hde" = hde {return &dev_hde_storage;}
"/dev/hdf" = hdf {return &dev_hdf_storage;}
"/dev/hdg" = hdg {return &dev_hdg_storage;}
"/dev/hdh" = hdh {return &dev_hdh_storage;}
"/dev/hdi" = hdi {return &dev_hdi_storage;}
"/dev/hdj" = hdj {return &dev_hdj_storage;}
"/dev/hdk" = hdk {return &dev_hdk_storage;}
"/dev/hdl" = hdl {return &dev_hdl_storage;}
"/dev/hdm" = hdm {return &dev_hdm_storage;}
"/dev/hdn" = hdn {return &dev_hdn_storage;}
"/dev/hdo" = hdo {return &dev_hdo_storage;}
"/dev/hdp" = hdp {return &dev_hdp_storage;}
"/dev/hdq" = hdq {return &dev_hdq_storage;}
"/dev/hdr" = hdr {return &dev_hdr_storage;}
"/dev/hds" = hds {return &dev_hds_storage;}
"/dev/hdt" = hdt {return &dev_hdt_storage;}
"/dev/hdu" = hdu {return &dev_hdu_storage;}
"/dev/hdv" = hdv {return &dev_hdv_storage;}
"/dev/hdw" = hdw {return &dev_hdw_storage;}
"/dev/hdx" = hdx {return &dev_hdx_storage;}
"/dev/hdy" = hdy {return &dev_hdy_storage;}
"/dev/hdz" = hdz {return &dev_hdz_storage;}
"/dev/sda" = hda {return &dev_hda_storage;}
"/dev/sdb" = hdb {return &dev_hdb_storage;}
"/dev/sdc" = hdc {return &dev_hdc_storage;}
"/dev/sdd" = hdd {return &dev_hdd_storage;}
"/dev/sde" = hde {return &dev_hde_storage;}
"/dev/sdf" = hdf {return &dev_hdf_storage;}
"/dev/sdg" = hdg {return &dev_hdg_storage;}
"/dev/sdh" = hdh {return &dev_hdh_storage;}
"/dev/sdi" = hdi {return &dev_hdi_storage;}
"/dev/sdj" = hdj {return &dev_hdj_storage;}
"/dev/sdk" = hdk {return &dev_hdk_storage;}
"/dev/sdl" = hdl {return &dev_hdl_storage;}
"/dev/sdm" = hdm {return &dev_hdm_storage;}
"/dev/sdn" = hdn {return &dev_hdn_storage;}
"/dev/sdo" = hdo {return &dev_hdo_storage;}
"/dev/sdp" = hdp {return &dev_hdp_storage;}
"/dev/sdq" = hdq {return &dev_hdq_storage;}
"/dev/sdr" = hdr {return &dev_hdr_storage;}
"/dev/sds" = hds {return &dev_hds_storage;}
"/dev/sdt" = hdt {return &dev_hdt_storage;}
"/dev/sdu" = hdu {return &dev_hdu_storage;}
"/dev/sdv" = hdv {return &dev_hdv_storage;}
"/dev/sdw" = hdw {return &dev_hdw_storage;}
"/dev/sdx" = hdx {return &dev_hdx_storage;}
"/dev/sdy" = hdy {return &dev_hdy_storage;}
"/dev/sdz" = hdz {return &dev_hdz_storage;}
"/dev/sda" = sda {return &dev_sda_storage;}
"/dev/sdb" = sdb {return &dev_sdb_storage;}
"/dev/sdc" = sdc {return &dev_sdc_storage;}
"/dev/sdd" = sdd {return &dev_sdd_storage;}
"/dev/sde" = sde {return &dev_sde_storage;}
"/dev/sdf" = sdf {return &dev_sdf_storage;}
"/dev/sdg" = sdg {return &dev_sdg_storage;}
"/dev/sdh" = sdh {return &dev_sdh_storage;}
"/dev/sdi" = sdi {return &dev_sdi_storage;}
"/dev/sdj" = sdj {return &dev_sdj_storage;}
"/dev/sdk" = sdk {return &dev_sdk_storage;}
"/dev/sdl" = sdl {return &dev_sdl_storage;}
"/dev/sdm" = sdm {return &dev_sdm_storage;}
"/dev/sdn" = sdn {return &dev_sdn_storage;}
"/dev/sdo" = sdo {return &dev_sdo_storage;}
"/dev/sdp" = sdp {return &dev_sdp_storage;}
"/dev/sdq" = sdq {return &dev_sdq_storage;}
"/dev/sdr" = sdr {return &dev_sdr_storage;}
"/dev/sds" = sds {return &dev_sds_storage;}
"/dev/sdt" = sdt {return &dev_sdt_storage;}
"/dev/sdu" = sdu {return &dev_sdu_storage;}
"/dev/sdv" = sdv {return &dev_sdv_storage;}
"/dev/sdw" = sdw {return &dev_sdw_storage;}
"/dev/sdx" = sdx {return &dev_sdx_storage;}
"/dev/sdy" = sdy {return &dev_sdy_storage;}
"/dev/sdz" = sdz {return &dev_sdz_storage;}
"/dev/rawdrive" = rawdrive {return &dev_rawdrive_storage;}
%other {return NULL;}
%%
@ -361,6 +335,8 @@ device::parse (const char *s)
dev = ttys_dev; // SIGH
if (n >= dev->lower && n <= dev->upper)
unit = n;
else
dev = NULL;
}
}
}

View File

@ -382,7 +382,7 @@ build_fh_pc (path_conv& pc)
fh = cnew (fhandler_pipe) ();
break;
case FH_TCP:
case FH_UCP:
case FH_UDP:
case FH_ICMP:
case FH_UNIX:
case FH_STREAM:

View File

@ -903,17 +903,19 @@ win32_device_name (const char *src_path, char *win32_path, device& dev)
if (dev.devn == FH_FS)
return false;
switch (dev.devn)
switch (dev.major)
{
case FH_TAPE:
case DEV_TAPE_MAJOR:
__small_sprintf (win32_path, dev.fmt, dev.minor % 128);
break;
case FH_RAWDRIVE:
__small_sprintf (win32_path, dev.fmt, dev.minor - 224 + 'A');
case DEV_RAWDRIVE_MAJOR:
__small_sprintf (win32_path, dev.fmt, dev.minor + 'A');
break;
case DEV_SD_MAJOR:
__small_sprintf (win32_path, dev.fmt, dev.minor / 16, dev.minor % 16);
break;
default:
__small_sprintf (win32_path, dev.fmt, dev.minor);
break;
}
return true;
}