mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
esp: convert ti_buf from array to Fifo8
Rename TI_BUFSZ to ESP_FIFO_SZ since this constant is really describing the size of the FIFO and is not directly related to the TI size. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20210304221103.6369-39-mark.cave-ayland@ilande.co.uk>
This commit is contained in:
parent
799d90d818
commit
042879fc3f
2 changed files with 79 additions and 47 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "hw/scsi/scsi.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "qemu/fifo8.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
/* esp.c */
|
||||
|
@ -10,7 +11,7 @@
|
|||
typedef void (*ESPDMAMemoryReadWriteFunc)(void *opaque, uint8_t *buf, int len);
|
||||
|
||||
#define ESP_REGS 16
|
||||
#define TI_BUFSZ 16
|
||||
#define ESP_FIFO_SZ 16
|
||||
#define ESP_CMDBUF_SZ 32
|
||||
|
||||
typedef struct ESPState ESPState;
|
||||
|
@ -28,10 +29,9 @@ struct ESPState {
|
|||
uint8_t chip_id;
|
||||
bool tchi_written;
|
||||
int32_t ti_size;
|
||||
uint32_t ti_rptr, ti_wptr;
|
||||
uint32_t status;
|
||||
uint32_t dma;
|
||||
uint8_t ti_buf[TI_BUFSZ];
|
||||
Fifo8 fifo;
|
||||
SCSIBus bus;
|
||||
SCSIDevice *current_dev;
|
||||
SCSIRequest *current_req;
|
||||
|
@ -58,6 +58,8 @@ struct ESPState {
|
|||
uint32_t mig_dma_left;
|
||||
uint32_t mig_deferred_status;
|
||||
bool mig_deferred_complete;
|
||||
uint32_t mig_ti_rptr, mig_ti_wptr;
|
||||
uint8_t mig_ti_buf[ESP_FIFO_SZ];
|
||||
};
|
||||
|
||||
#define TYPE_SYSBUS_ESP "sysbus-esp"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue