Monster patch to clean up a lot of cruft in the code, and reduce the RAM footptiny of a running XT machine from about 680MB down to about 80MB. Yes, 600MB of unused 0x00's.

This commit is contained in:
waltje
2018-03-17 23:13:46 -05:00
parent a86d717ae1
commit 1c60e22813
217 changed files with 9300 additions and 9128 deletions

View File

@@ -8,7 +8,7 @@
*
* Handling of the SCSI controllers.
*
* Version: @(#)scsi.c 1.0.2 2018/02/24
* Version: @(#)scsi.c 1.0.3 2018/03/15
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -77,10 +77,10 @@ mutex_t *scsiMutex;
typedef struct {
const char *name;
const char *internal_name;
device_t *device;
void (*reset)(void *p);
const char *name;
const char *internal_name;
const device_t *device;
void (*reset)(void *p);
} SCSI_CARD;
@@ -124,7 +124,7 @@ scsi_card_getname(int card)
}
device_t *
const device_t *
scsi_card_getdevice(int card)
{
return(scsi_cards[card].device);

View File

@@ -8,7 +8,7 @@
*
* SCSI controller handler header.
*
* Version: @(#)scsi.h 1.0.1 2018/02/14
* Version: @(#)scsi.h 1.0.2 2018/03/15
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -311,7 +311,7 @@ extern int scsi_card_current;
extern int scsi_card_available(int card);
extern char *scsi_card_getname(int card);
#ifdef EMU_DEVICE_H
extern device_t *scsi_card_getdevice(int card);
extern const device_t *scsi_card_getdevice(int card);
#endif
extern int scsi_card_has_config(int card);
extern char *scsi_card_get_internal_name(int card);
@@ -379,6 +379,8 @@ typedef struct {
#define MODE_SELECT_PHASE_PAGE_HEADER 3
#define MODE_SELECT_PHASE_PAGE 4
#endif /*EMU_SCSI_H*/
extern void scsi_mutex_wait(uint8_t wait);
#endif /*EMU_SCSI_H*/

View File

@@ -10,7 +10,7 @@
* made by Adaptec, Inc. These controllers were designed for
* the ISA bus.
*
* Version: @(#)scsi_aha154x.c 1.0.4 2018/03/08
* Version: @(#)scsi_aha154x.c 1.0.5 2018/03/15
*
* Based on original code from TheCollector1995 and Miran Grca.
*
@@ -753,7 +753,7 @@ aha_setnvr(x54x_t *dev)
/* General initialization routine for all boards. */
static void *
aha_init(device_t *info)
aha_init(const device_t *info)
{
x54x_t *dev;
@@ -897,7 +897,7 @@ aha_init(device_t *info)
}
static device_config_t aha_154xb_config[] = {
static const device_config_t aha_154xb_config[] = {
{
"base", "Address", CONFIG_HEX16, "", 0x334,
{
@@ -1028,7 +1028,7 @@ static device_config_t aha_154xb_config[] = {
};
static device_config_t aha_154x_config[] = {
static const device_config_t aha_154x_config[] = {
{
"base", "Address", CONFIG_HEX16, "", 0x334,
{
@@ -1127,7 +1127,7 @@ static device_config_t aha_154x_config[] = {
};
device_t aha1540b_device = {
const device_t aha1540b_device = {
"Adaptec AHA-1540B",
DEVICE_ISA | DEVICE_AT,
AHA_154xB,
@@ -1136,7 +1136,7 @@ device_t aha1540b_device = {
aha_154xb_config
};
device_t aha1542c_device = {
const device_t aha1542c_device = {
"Adaptec AHA-1542C",
DEVICE_ISA | DEVICE_AT,
AHA_154xC,
@@ -1145,7 +1145,7 @@ device_t aha1542c_device = {
aha_154x_config
};
device_t aha1542cf_device = {
const device_t aha1542cf_device = {
"Adaptec AHA-1542CF",
DEVICE_ISA | DEVICE_AT,
AHA_154xCF,
@@ -1154,7 +1154,7 @@ device_t aha1542cf_device = {
aha_154x_config
};
device_t aha1640_device = {
const device_t aha1640_device = {
"Adaptec AHA-1640",
DEVICE_MCA,
AHA_1640,

View File

@@ -8,7 +8,7 @@
*
* Definitions for the Adaptec 154x driver.
*
* Version: @(#)scsi_154x.h 1.0.1 2018/02/14
* Version: @(#)scsi_154x.h 1.0.2 2018/03/15
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -38,12 +38,12 @@
# define SCSI_AHA154X_H
extern device_t aha1540b_device;
extern device_t aha1542c_device;
extern device_t aha1542cf_device;
extern device_t aha1640_device;
extern const device_t aha1540b_device;
extern const device_t aha1542c_device;
extern const device_t aha1542cf_device;
extern const device_t aha1640_device;
extern void aha_device_reset(void *p);
extern void aha_device_reset(void *p);
#endif /*SCSI_AHA154X_H*/

View File

@@ -13,7 +13,7 @@
* 1 - BT-545S ISA;
* 2 - BT-958D PCI
*
* Version: @(#)scsi_buslogic.c 1.0.5 2018/03/08
* Version: @(#)scsi_buslogic.c 1.0.6 2018/03/15
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -1466,7 +1466,7 @@ BuslogicDeviceReset(void *p)
static void *
buslogic_init(device_t *info)
buslogic_init(const device_t *info)
{
x54x_t *dev;
wchar_t *bios_rom_name;
@@ -1548,6 +1548,7 @@ buslogic_init(device_t *info)
dev->fw_rev = "AA335";
dev->ha_bps = 5000000.0; /* normal SCSI */
break;
case CHIP_BUSLOGIC_ISA:
default:
strcpy(dev->name, "BT-545S");
@@ -1561,6 +1562,7 @@ buslogic_init(device_t *info)
dev->fw_rev = "AA421E";
dev->ha_bps = 10000000.0; /* fast SCSI */
break;
case CHIP_BUSLOGIC_MCA:
strcpy(dev->name, "BT-640A");
bios_rom_name = L"roms/scsi/buslogic/bt-640a_bios.rom";
@@ -1575,6 +1577,7 @@ buslogic_init(device_t *info)
mca_add(buslogic_mca_read, buslogic_mca_write, dev);
dev->ha_bps = 5000000.0; /* normal SCSI */
break;
case CHIP_BUSLOGIC_VLB:
strcpy(dev->name, "BT-445S");
bios_rom_name = L"roms/scsi/buslogic/bt-445s_bios.rom";
@@ -1588,6 +1591,7 @@ buslogic_init(device_t *info)
dev->bit32 = 1;
dev->ha_bps = 10000000.0; /* fast SCSI */
break;
case CHIP_BUSLOGIC_PCI:
strcpy(dev->name, "BT-958D");
bios_rom_name = L"roms/scsi/buslogic/bt-958d_bios.rom";
@@ -1680,7 +1684,7 @@ buslogic_init(device_t *info)
}
static device_config_t BT_ISA_Config[] = {
static const device_config_t BT_ISA_Config[] = {
{
"base", "Address", CONFIG_HEX16, "", 0x334,
{
@@ -1776,7 +1780,7 @@ static device_config_t BT_ISA_Config[] = {
};
static device_config_t BT958D_Config[] = {
static const device_config_t BT958D_Config[] = {
{
"bios", "Enable BIOS", CONFIG_BINARY, "", 0
},
@@ -1786,7 +1790,7 @@ static device_config_t BT958D_Config[] = {
};
device_t buslogic_device = {
const device_t buslogic_device = {
"Buslogic BT-542BH ISA",
DEVICE_ISA | DEVICE_AT,
CHIP_BUSLOGIC_ISA_542,
@@ -1795,7 +1799,7 @@ device_t buslogic_device = {
BT_ISA_Config
};
device_t buslogic_545s_device = {
const device_t buslogic_545s_device = {
"Buslogic BT-545S ISA",
DEVICE_ISA | DEVICE_AT,
CHIP_BUSLOGIC_ISA,
@@ -1804,7 +1808,7 @@ device_t buslogic_545s_device = {
BT_ISA_Config
};
device_t buslogic_640a_device = {
const device_t buslogic_640a_device = {
"Buslogic BT-640A MCA",
DEVICE_MCA,
CHIP_BUSLOGIC_MCA,
@@ -1813,7 +1817,7 @@ device_t buslogic_640a_device = {
NULL
};
device_t buslogic_445s_device = {
const device_t buslogic_445s_device = {
"Buslogic BT-445S ISA",
DEVICE_VLB,
CHIP_BUSLOGIC_VLB,
@@ -1822,7 +1826,7 @@ device_t buslogic_445s_device = {
BT_ISA_Config
};
device_t buslogic_pci_device = {
const device_t buslogic_pci_device = {
"Buslogic BT-958D PCI",
DEVICE_PCI,
CHIP_BUSLOGIC_PCI,

View File

@@ -7,7 +7,7 @@
* Emulation of BusLogic BT-542B ISA and BT-958D PCI SCSI
* controllers.
*
* Version: @(#)scsi_buslogic.h 1.0.1 2018/02/14
* Version: @(#)scsi_buslogic.h 1.0.2 2018/03/15
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -37,11 +37,11 @@
# define SCSI_BUSLOGIC_H
extern device_t buslogic_device;
extern device_t buslogic_545s_device;
extern device_t buslogic_640a_device;
extern device_t buslogic_445s_device;
extern device_t buslogic_pci_device;
extern const device_t buslogic_device;
extern const device_t buslogic_545s_device;
extern const device_t buslogic_640a_device;
extern const device_t buslogic_445s_device;
extern const device_t buslogic_pci_device;
extern void BuslogicDeviceReset(void *p);

View File

@@ -8,7 +8,7 @@
*
* Emulation of SCSI fixed and removable disks.
*
* Version: @(#)scsi_disk.c 1.0.3 2018/03/08
* Version: @(#)scsi_disk.c 1.0.4 2018/03/16
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -101,7 +101,7 @@ uint8_t scsi_hard_disks[16][8] = {
/* Table of all SCSI commands and their flags, needed for the new disc change / not ready handler. */
uint8_t scsi_hd_command_flags[0x100] = {
const uint8_t scsi_hd_command_flags[0x100] = {
IMPLEMENTED | CHECK_READY | NONDATA, /* 0x00 */
IMPLEMENTED | ALLOW_UA | NONDATA | SCSI_ONLY, /* 0x01 */
0,

View File

@@ -9,7 +9,7 @@
* Implementation of the NCR 5380 series of SCSI Host Adapters
* made by NCR. These controllers were designed for the ISA bus.
*
* Version: @(#)scsi_ncr5380.c 1.0.3 2018/03/08
* Version: @(#)scsi_ncr5380.c 1.0.4 2018/03/15
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -844,7 +844,7 @@ scsiat_out(uint16_t port, uint8_t val, void *priv)
static void *
ncr_init(device_t *info)
ncr_init(const device_t *info)
{
char temp[128];
ncr_t *scsi;
@@ -967,7 +967,7 @@ scsiat_available(void)
}
static device_config_t scsiat_config[] = {
static const device_config_t scsiat_config[] = {
{
"base", "Address", CONFIG_HEX16, "", 0x0310,
{
@@ -1064,7 +1064,7 @@ static device_config_t scsiat_config[] = {
};
device_t scsi_lcs6821n_device =
const device_t scsi_lcs6821n_device =
{
"Longshine LCS-6821N",
DEVICE_ISA,
@@ -1075,7 +1075,7 @@ device_t scsi_lcs6821n_device =
NULL
};
device_t scsi_rt1000b_device =
const device_t scsi_rt1000b_device =
{
"Ranco RT1000B",
DEVICE_ISA,
@@ -1086,7 +1086,7 @@ device_t scsi_rt1000b_device =
NULL
};
device_t scsi_t130b_device =
const device_t scsi_t130b_device =
{
"Trantor T130B",
DEVICE_ISA,
@@ -1097,7 +1097,7 @@ device_t scsi_t130b_device =
NULL
};
device_t scsi_scsiat_device =
const device_t scsi_scsiat_device =
{
"Sumo SCSI-AT",
DEVICE_ISA,

View File

@@ -10,7 +10,7 @@
* made by NCR. These controllers were designed for
* the ISA bus.
*
* Version: @(#)scsi_ncr5380.c 1.0.1 2018/02/14
* Version: @(#)scsi_ncr5380.c 1.0.2 2018/03/15
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -40,10 +40,10 @@
# define SCSI_NCR5380_H
extern device_t scsi_lcs6821n_device;
extern device_t scsi_rt1000b_device;
extern device_t scsi_t130b_device;
extern device_t scsi_scsiat_device;
extern const device_t scsi_lcs6821n_device;
extern const device_t scsi_rt1000b_device;
extern const device_t scsi_t130b_device;
extern const device_t scsi_scsiat_device;
#endif /*SCSI_NCR5380_H*/

View File

@@ -10,7 +10,7 @@
* NCR and later Symbios and LSI. This controller was designed
* for the PCI bus.
*
* Version: @(#)scsi_ncr53c810.c 1.0.4 2018/03/12
* Version: @(#)scsi_ncr53c810.c 1.0.5 2018/03/15
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -2156,7 +2156,7 @@ ncr53c810_pci_write(int func, int addr, uint8_t val, void *p)
static void *
ncr53c810_init(device_t *info)
ncr53c810_init(const device_t *info)
{
ncr53c810_t *dev;
@@ -2194,7 +2194,7 @@ ncr53c810_close(void *priv)
}
device_t ncr53c810_pci_device =
const device_t ncr53c810_pci_device =
{
"NCR 53c810 (SCSI)",
DEVICE_PCI,

View File

@@ -8,7 +8,7 @@
*
* Definitions for the NCR 53C810 SCSI Host Adapter driver.
*
* Version: @(#)scsi_ncr53c810.h 1.0.1 2018/02/14
* Version: @(#)scsi_ncr53c810.h 1.0.2 2018/03/15
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -39,7 +39,7 @@
# define SCSI_NCR53C810_H
extern device_t ncr53c810_pci_device;
extern const device_t ncr53c810_pci_device;
#endif /*SCSI_NCR53C810_H*/

View File

@@ -12,7 +12,7 @@
*
* These controllers were designed for various buses.
*
* Version: @(#)scsi_x54x.c 1.0.7 2018/03/12
* Version: @(#)scsi_x54x.c 1.0.8 2018/03/15
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -1909,7 +1909,7 @@ x54x_mem_disable(x54x_t *dev)
/* General initialization routine for all boards. */
void *
x54x_init(device_t *info)
x54x_init(const device_t *info)
{
x54x_t *dev;

View File

@@ -8,7 +8,7 @@
*
* Definitions for the common AHA/BL code.
*
* Version: @(#)scsi_x54x.h 1.0.2 2018/03/08
* Version: @(#)scsi_x54x.h 1.0.3 2018/03/15
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -516,7 +516,7 @@ extern void x54x_mem_init(x54x_t *dev, uint32_t addr);
extern void x54x_mem_enable(x54x_t *dev);
extern void x54x_mem_set_addr(x54x_t *dev, uint32_t base);
extern void x54x_mem_disable(x54x_t *dev);
extern void *x54x_init(device_t *info);
extern void *x54x_init(const device_t *info);
extern void x54x_close(void *priv);
extern void x54x_device_reset(void *priv);