Splitting Buslogic and Aha154x up, cleanups. First phase.

This commit is contained in:
waltje
2017-05-07 23:42:05 -04:00
parent baa847b759
commit 5a87f91bc5
7 changed files with 2218 additions and 647 deletions

View File

@@ -577,7 +577,6 @@ void resetx86()
codegen_reset(); codegen_reset();
x86_was_reset = 1; x86_was_reset = 1;
port_92_clear_reset(); port_92_clear_reset();
BuslogicSoftReset();
} }
void softresetx86() void softresetx86()
@@ -596,7 +595,6 @@ void softresetx86()
x86seg_reset(); x86seg_reset();
x86_was_reset = 1; x86_was_reset = 1;
port_92_clear_reset(); port_92_clear_reset();
BuslogicSoftReset();
} }
static void setznp8(uint8_t val) static void setznp8(uint8_t val)

View File

@@ -556,13 +556,8 @@ wchar_t pcempath[512];
/*Hard disc*/ /*Hard disc*/
#ifdef __MSC__
#pragma pack(push,1) #pragma pack(push,1)
typedef struct typedef struct {
#else
typedef struct __attribute((__packed__))
#endif
{
FILE *f; FILE *f;
uint64_t spt,hpc; /*Sectors per track, heads per cylinder*/ uint64_t spt,hpc; /*Sectors per track, heads per cylinder*/
uint64_t tracks; uint64_t tracks;
@@ -575,17 +570,10 @@ typedef struct __attribute((__packed__))
uint8_t scsi_id; uint8_t scsi_id;
uint8_t scsi_lun; uint8_t scsi_lun;
} hard_disk_t; } hard_disk_t;
#ifdef __MSC__
#pragma pack(pop) #pragma pack(pop)
#endif
#ifdef __MSC__
#pragma pack(push,1) #pragma pack(push,1)
typedef struct typedef struct {
#else
typedef struct __attribute((__packed__))
#endif
{
/* Stuff for SCSI hard disks. */ /* Stuff for SCSI hard disks. */
uint8_t cdb[16]; uint8_t cdb[16];
uint8_t current_cdb[16]; uint8_t current_cdb[16];
@@ -619,9 +607,7 @@ typedef struct __attribute((__packed__))
uint64_t base; uint64_t base;
uint8_t hd_cdb[16]; uint8_t hd_cdb[16];
} scsi_hard_disk_t; } scsi_hard_disk_t;
#ifdef __MSC__
#pragma pack(pop) #pragma pack(pop)
#endif
#define HDC_NUM 16 #define HDC_NUM 16
#define IDE_NUM 8 #define IDE_NUM 8
@@ -744,7 +730,6 @@ uint32_t svga_color_transform(uint32_t color);
extern int scale; extern int scale;
/* Function prototypes. */ /* Function prototypes. */
void BuslogicSoftReset();
int checkio(int port); int checkio(int port);
void closepc(); void closepc();
void codegen_block_end(); void codegen_block_end();

View File

@@ -10,6 +10,7 @@
#include "device.h" #include "device.h"
#include "cdrom.h" #include "cdrom.h"
#include "scsi.h" #include "scsi.h"
#include "scsi_aha154x.h"
#include "scsi_buslogic.h" #include "scsi_buslogic.h"

View File

@@ -1,14 +1,14 @@
/* Copyright holders: SA1988 /* Copyright holders: SA1988
see COPYING for more details see COPYING for more details
*/ */
#ifndef __SCSI_H__ #ifndef SCSI_H
#define __SCSI_H__ #define SCSI_H
#include "timer.h"
#define SCSI_TIME (5 * 100 * (1 << TIMER_SHIFT)) #define SCSI_TIME (5 * 100 * (1 << TIMER_SHIFT))
/* SCSI Commands */
/* SCSI commands. */
#define GPCMD_TEST_UNIT_READY 0x00 #define GPCMD_TEST_UNIT_READY 0x00
#define GPCMD_REZERO_UNIT 0x01 #define GPCMD_REZERO_UNIT 0x01
#define GPCMD_REQUEST_SENSE 0x03 #define GPCMD_REQUEST_SENSE 0x03
@@ -266,4 +266,40 @@ void scsi_hd_request_sense_for_scsi(uint8_t id, uint8_t *buffer, uint8_t alloc_l
void scsi_hd_command(uint8_t id, uint8_t *cdb); void scsi_hd_command(uint8_t id, uint8_t *cdb);
void scsi_hd_callback(uint8_t id); void scsi_hd_callback(uint8_t id);
#pragma pack(push,1)
typedef struct {
uint8_t hi;
uint8_t mid;
uint8_t lo;
} addr24;
#pragma pack(pop)
#define ADDR_TO_U32(x) (((x).hi<<16)|((x).mid<<8)|((x).lo&0xFF))
#define U32_TO_ADDR(a,x) do {(a).hi=(x)>>16;(a).mid=(x)>>8;(a).lo=(x)&0xFF;}while(0)
/*
*
* Scatter/Gather Segment List Definitions
*
* Adapter limits
*/
#define MAX_SG_DESCRIPTORS 32 /* Always make the array 32 elements long, if less are used, that's not an issue. */
#pragma pack(push,1)
typedef struct {
uint32_t Segment;
uint32_t SegmentPointer;
} SGE32;
#pragma pack(pop)
#pragma pack(push,1)
typedef struct {
addr24 Segment;
addr24 SegmentPointer;
} SGE;
#pragma pack(pop)
#endif #endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,27 +1,9 @@
#ifndef BUSLOGIC_H #ifndef SCSI_BUSLOGIC_H
# define BUSLOGIC_H # define SCSI_BUSLOGIC_H
typedef struct {
uint8_t flags; /* local flags */
uint8_t bid; /* board ID */
char fwl, fwh; /* firmware info */
} aha_info;
#define AHA_GLAG_MEMEN 0x01 /* BIOS Shadow RAM enabled */
extern device_t aha1540b_device;
extern device_t aha1542cf_device;
extern device_t buslogic_device; extern device_t buslogic_device;
extern device_t buslogic_pci_device; extern device_t buslogic_pci_device;
extern int buslogic_dev_present(uint8_t id, uint8_t lun); #endif /*SCSI_BUSLOGIC_H*/
extern void aha154x_init(uint16_t, uint32_t, aha_info *);
extern uint8_t aha154x_shram(uint8_t);
extern uint8_t aha154x_eeprom(uint8_t,uint8_t,uint8_t,uint8_t,uint8_t *);
extern uint8_t aha154x_memory(uint8_t);
#endif /*BUSLOGIC_H*/