drivers: resolve compiler warnings

This commit is contained in:
David van Moolenbroek 2012-03-05 00:11:41 +01:00
parent 4aaa5377b3
commit ca95f69f25
23 changed files with 105 additions and 104 deletions

View file

@ -124,24 +124,24 @@
extern struct machine machine; extern struct machine machine;
PRIVATE unsigned pci_inb(u16_t port) { PRIVATE u32_t pci_inb(u16_t port) {
unsigned long value; u32_t value;
int s; int s;
if ((s=sys_inb(port, &value)) !=OK) if ((s=sys_inb(port, &value)) !=OK)
printf("ACPI: warning, sys_inb failed: %d\n", s); printf("ACPI: warning, sys_inb failed: %d\n", s);
return value; return value;
} }
PRIVATE unsigned pci_inw(u16_t port) { PRIVATE u32_t pci_inw(u16_t port) {
unsigned long value; u32_t value;
int s; int s;
if ((s=sys_inw(port, &value)) !=OK) if ((s=sys_inw(port, &value)) !=OK)
printf("ACPI: warning, sys_inw failed: %d\n", s); printf("ACPI: warning, sys_inw failed: %d\n", s);
return value; return value;
} }
PRIVATE unsigned pci_inl(u16_t port) { PRIVATE u32_t pci_inl(u16_t port) {
unsigned long value; u32_t value;
int s; int s;
if ((s=sys_inl(port, &value)) !=OK) if ((s=sys_inl(port, &value)) !=OK)
printf("ACPI: warning, sys_inl failed: %d\n", s); printf("ACPI: warning, sys_inl failed: %d\n", s);
@ -823,13 +823,13 @@ AcpiOsReadPort (
*Value = 0; *Value = 0;
switch (Width) { switch (Width) {
case 8: case 8:
sys_inb(Address, (unsigned long *)Value); sys_inb(Address, Value);
break; break;
case 16: case 16:
sys_inw(Address, (unsigned long *)Value); sys_inw(Address, Value);
break; break;
case 32: case 32:
sys_inl(Address, (unsigned long *)Value); sys_inl(Address, Value);
break; break;
} }
return AE_OK; return AE_OK;

View file

@ -189,9 +189,9 @@ FORWARD _PROTOTYPE( int at_vinb, (pvb_pair_t *, int n));
#undef sys_inb #undef sys_inb
#undef sys_outl #undef sys_outl
FORWARD _PROTOTYPE( int at_out, (int line, u32_t port, unsigned long value, FORWARD _PROTOTYPE( int at_out, (int line, u32_t port, u32_t value,
char *typename, int type)); char *typename, int type));
FORWARD _PROTOTYPE( int at_in, (int line, u32_t port, unsigned long *value, FORWARD _PROTOTYPE( int at_in, (int line, u32_t port, u32_t *value,
char *typename, int type)); char *typename, int type));
#define sys_outb(p, v) at_out(__LINE__, (p), (v), "outb", _DIO_BYTE) #define sys_outb(p, v) at_out(__LINE__, (p), (v), "outb", _DIO_BYTE)
@ -688,8 +688,7 @@ PRIVATE struct device *w_part(dev_t device)
PRIVATE void PRIVATE void
check_dma(struct wini *wn) check_dma(struct wini *wn)
{ {
unsigned long dma_status = 0; u32_t dma_status, dma_base;
u32_t dma_base;
int id_dma, ultra_dma; int id_dma, ultra_dma;
u16_t w; u16_t w;
@ -1131,7 +1130,7 @@ PRIVATE void start_dma(const struct wini *wn, int do_write)
PRIVATE int error_dma(const struct wini *wn) PRIVATE int error_dma(const struct wini *wn)
{ {
int r; int r;
unsigned long v; u32_t v;
#define DMAERR(msg) \ #define DMAERR(msg) \
printf("at_wini%ld: bad DMA: %s. Disabling DMA for drive %d.\n", \ printf("at_wini%ld: bad DMA: %s. Disabling DMA for drive %d.\n", \
@ -1176,7 +1175,8 @@ PRIVATE ssize_t w_transfer(
struct wini *wn; struct wini *wn;
iovec_t *iop, *iov_end = iov + nr_req; iovec_t *iop, *iov_end = iov + nr_req;
int n, r, s, errors, do_dma; int n, r, s, errors, do_dma;
unsigned long block, w_status; unsigned long block;
u32_t w_status;
u64_t dv_size; u64_t dv_size;
unsigned nbytes; unsigned nbytes;
unsigned dma_buf_offset; unsigned dma_buf_offset;
@ -1502,7 +1502,7 @@ PRIVATE int setup_dma(
phys_bytes user_phys; phys_bytes user_phys;
unsigned n, offset, size; unsigned n, offset, size;
int i, j, r; int i, j, r;
unsigned long v; u32_t v;
struct wini *wn = w_wn; struct wini *wn = w_wn;
int verbose = 0; int verbose = 0;
@ -1746,7 +1746,7 @@ PRIVATE void w_intr_wait(void)
/* Wait for a task completion interrupt. */ /* Wait for a task completion interrupt. */
int r; int r;
unsigned long w_status; u32_t w_status;
message m; message m;
int ipc_status; int ipc_status;
@ -1802,7 +1802,7 @@ PRIVATE int at_intr_wait(void)
{ {
/* Wait for an interrupt, study the status bits and return error/success. */ /* Wait for an interrupt, study the status bits and return error/success. */
int r, s; int r, s;
unsigned long inbval; u32_t inbval;
w_intr_wait(); w_intr_wait();
if ((w_wn->w_status & (STATUS_BSY | STATUS_WF | STATUS_ERR)) == 0) { if ((w_wn->w_status & (STATUS_BSY | STATUS_WF | STATUS_ERR)) == 0) {
@ -1829,7 +1829,7 @@ int value; /* required status */
{ {
/* Wait until controller is in the required state. Return zero on timeout. /* Wait until controller is in the required state. Return zero on timeout.
*/ */
unsigned long w_status; u32_t w_status;
spin_t spin; spin_t spin;
int s; int s;
@ -1855,7 +1855,7 @@ int value; /* required status */
{ {
/* Wait until controller is in the required state. Return zero on timeout. /* Wait until controller is in the required state. Return zero on timeout.
*/ */
unsigned long w_status; u32_t w_status;
spin_t spin; spin_t spin;
int s; int s;
@ -2302,7 +2302,7 @@ PRIVATE void w_hw_int(unsigned int irqs)
PRIVATE void ack_irqs(unsigned int irqs) PRIVATE void ack_irqs(unsigned int irqs)
{ {
unsigned int drive; unsigned int drive;
unsigned long w_status; u32_t w_status;
for (drive = 0; drive < MAX_DRIVES; drive++) { for (drive = 0; drive < MAX_DRIVES; drive++) {
if (!(wini[drive].state & IGNORING) && wini[drive].irq_need_ack && if (!(wini[drive].state & IGNORING) && wini[drive].irq_need_ack &&
@ -2457,21 +2457,19 @@ PRIVATE int at_vinb(pvb_pair_t *pvb, int n)
panic("sys_vinb failed"); panic("sys_vinb failed");
} }
PRIVATE int at_out(int line, u32_t port, unsigned long value, PRIVATE int at_out(int line, u32_t port, u32_t value, char *typename, int type)
char *typename, int type)
{ {
int s; int s;
s = sys_out(port, value, type); s = sys_out(port, value, type);
if(s == OK) if(s == OK)
return OK; return OK;
printf("at_wini%ld: line %d: %s failed: %d; %lx -> %x\n", printf("at_wini%ld: line %d: %s failed: %d; %x -> %x\n",
w_instance, line, typename, s, value, port); w_instance, line, typename, s, value, port);
panic("sys_out failed"); panic("sys_out failed");
} }
PRIVATE int at_in(int line, u32_t port, unsigned long *value, PRIVATE int at_in(int line, u32_t port, u32_t *value, char *typename, int type)
char *typename, int type)
{ {
int s; int s;
s = sys_in(port, value, type); s = sys_in(port, value, type);

View file

@ -14,8 +14,8 @@
/*===========================================================================* /*===========================================================================*
* helper functions for I/O * * helper functions for I/O *
*===========================================================================*/ *===========================================================================*/
PUBLIC unsigned pci_inb(u16_t port) { PUBLIC u32_t pci_inb(u16_t port) {
unsigned long value; u32_t value;
int s; int s;
if ((s=sys_inb(port, &value)) !=OK) if ((s=sys_inb(port, &value)) !=OK)
printf("%s: warning, sys_inb failed: %d\n", DRIVER_NAME, s); printf("%s: warning, sys_inb failed: %d\n", DRIVER_NAME, s);
@ -23,8 +23,8 @@ PUBLIC unsigned pci_inb(u16_t port) {
} }
PUBLIC unsigned pci_inw(u16_t port) { PUBLIC u32_t pci_inw(u16_t port) {
unsigned long value; u32_t value;
int s; int s;
if ((s=sys_inw(port, &value)) !=OK) if ((s=sys_inw(port, &value)) !=OK)
printf("%s: warning, sys_inw failed: %d\n", DRIVER_NAME, s); printf("%s: warning, sys_inw failed: %d\n", DRIVER_NAME, s);
@ -32,8 +32,8 @@ PUBLIC unsigned pci_inw(u16_t port) {
} }
PUBLIC unsigned pci_inl(u16_t port) { PUBLIC u32_t pci_inl(u16_t port) {
unsigned long value; u32_t value;
int s; int s;
if ((s=sys_inl(port, &value)) !=OK) if ((s=sys_inl(port, &value)) !=OK)
printf("%s: warning, sys_inl failed: %d\n", DRIVER_NAME, s); printf("%s: warning, sys_inl failed: %d\n", DRIVER_NAME, s);

View file

@ -14,8 +14,8 @@
/*===========================================================================* /*===========================================================================*
* helper functions for I/O * * helper functions for I/O *
*===========================================================================*/ *===========================================================================*/
PUBLIC unsigned pci_inb(u16_t port) { PUBLIC u32_t pci_inb(u16_t port) {
unsigned long value; u32_t value;
int s; int s;
if ((s=sys_inb(port, &value)) !=OK) if ((s=sys_inb(port, &value)) !=OK)
printf("%s: warning, sys_inb failed: %d\n", DRIVER_NAME, s); printf("%s: warning, sys_inb failed: %d\n", DRIVER_NAME, s);
@ -23,8 +23,8 @@ PUBLIC unsigned pci_inb(u16_t port) {
} }
PUBLIC unsigned pci_inw(u16_t port) { PUBLIC u32_t pci_inw(u16_t port) {
unsigned long value; u32_t value;
int s; int s;
if ((s=sys_inw(port, &value)) !=OK) if ((s=sys_inw(port, &value)) !=OK)
printf("%s: warning, sys_inw failed: %d\n", DRIVER_NAME, s); printf("%s: warning, sys_inw failed: %d\n", DRIVER_NAME, s);
@ -32,8 +32,8 @@ PUBLIC unsigned pci_inw(u16_t port) {
} }
PUBLIC unsigned pci_inl(u16_t port) { PUBLIC u32_t pci_inl(u16_t port) {
unsigned long value; u32_t value;
int s; int s;
if ((s=sys_inl(port, &value)) !=OK) if ((s=sys_inl(port, &value)) !=OK)
printf("%s: warning, sys_inl failed: %d\n", DRIVER_NAME, s); printf("%s: warning, sys_inl failed: %d\n", DRIVER_NAME, s);

View file

@ -430,7 +430,7 @@ PUBLIC int dsp_command(int value) {
PUBLIC int sb16_inb(int port) { PUBLIC int sb16_inb(int port) {
int s; int s;
unsigned long value; u32_t value;
if ((s=sys_inb(port, &value)) != OK) if ((s=sys_inb(port, &value)) != OK)
panic("sys_inb() failed: %d", s); panic("sys_inb() failed: %d", s);

View file

@ -1844,7 +1844,7 @@ u8_t inb(port_t port)
u16_t inw(port_t port) u16_t inw(port_t port)
{ {
int r; int r;
unsigned long value; u32_t value;
r= sys_inw(port, &value); r= sys_inw(port, &value);
if (r != OK) if (r != OK)

View file

@ -413,7 +413,8 @@ static void ns_recv(dpeth_t *dep, int fromint, int size)
next = header.dr_next; next = header.dr_next;
if (length < ETH_MIN_PACK_SIZE || length > ETH_MAX_PACK_SIZE) { if (length < ETH_MIN_PACK_SIZE || length > ETH_MAX_PACK_SIZE) {
printf("%s: packet with strange length arrived: %d\n", dep->de_name, length); printf("%s: packet with strange length arrived: %ld\n",
dep->de_name, length);
dep->de_stat.ets_recvErr += 1; dep->de_stat.ets_recvErr += 1;
next = curr; next = curr;

View file

@ -27,7 +27,7 @@ static void warning(const char *type, int err)
*/ */
PUBLIC unsigned int inb(unsigned short port) PUBLIC unsigned int inb(unsigned short port)
{ {
unsigned long value; u32_t value;
int rc; int rc;
if ((rc = sys_inb(port, &value)) != OK) warning("inb", rc); if ((rc = sys_inb(port, &value)) != OK) warning("inb", rc);
@ -40,7 +40,7 @@ PUBLIC unsigned int inb(unsigned short port)
*/ */
PUBLIC unsigned int inw(unsigned short port) PUBLIC unsigned int inw(unsigned short port)
{ {
unsigned long value; u32_t value;
int rc; int rc;
if ((rc = sys_inw(port, &value)) != OK) warning("inw", rc); if ((rc = sys_inw(port, &value)) != OK) warning("inw", rc);

View file

@ -947,7 +947,7 @@ PRIVATE int fdc_results(void)
*/ */
int s, result_nr; int s, result_nr;
unsigned long status; u32_t status;
spin_t spin; spin_t spin;
/* Extract bytes from FDC until it says it has no more. The loop is /* Extract bytes from FDC until it says it has no more. The loop is
@ -964,7 +964,7 @@ PRIVATE int fdc_results(void)
panic("Sys_inb in fdc_results() failed: %d", s); panic("Sys_inb in fdc_results() failed: %d", s);
status &= (MASTER | DIRECTION | CTL_BUSY); status &= (MASTER | DIRECTION | CTL_BUSY);
if (status == (MASTER | DIRECTION | CTL_BUSY)) { if (status == (MASTER | DIRECTION | CTL_BUSY)) {
unsigned long tmp_r; u32_t tmp_r;
if (result_nr >= MAX_RESULTS) break; /* too many results */ if (result_nr >= MAX_RESULTS) break; /* too many results */
if ((s=sys_inb(FDC_DATA, &tmp_r)) != OK) if ((s=sys_inb(FDC_DATA, &tmp_r)) != OK)
panic("Sys_inb in fdc_results() failed: %d", s); panic("Sys_inb in fdc_results() failed: %d", s);
@ -1024,7 +1024,7 @@ PRIVATE void fdc_out(
*/ */
spin_t spin; spin_t spin;
int s; int s;
unsigned long status; u32_t status;
if (need_reset) return; /* if controller is not listening, return */ if (need_reset) return; /* if controller is not listening, return */

View file

@ -761,7 +761,7 @@ fxp_t *fp;
{ {
int i, r, isr; int i, r, isr;
port_t port; port_t port;
u32_t bus_addr; phys_bytes bus_addr;
port= fp->fxp_base_port; port= fp->fxp_base_port;
@ -825,7 +825,7 @@ fxp_t *fp;
{ {
size_t rx_totbufsize, tx_totbufsize, tot_bufsize, alloc_bufsize; size_t rx_totbufsize, tx_totbufsize, tot_bufsize, alloc_bufsize;
char *alloc_buf; char *alloc_buf;
phys_bytes buf; phys_bytes buf, bus_addr;
int i, r; int i, r;
struct rfd *rfdp; struct rfd *rfdp;
struct tx *txp; struct tx *txp;
@ -856,9 +856,10 @@ fxp_t *fp;
fp->fxp_rx_buf= (struct rfd *)&tmpbufp[1]; fp->fxp_rx_buf= (struct rfd *)&tmpbufp[1];
r= sys_umap(SELF, VM_D, (vir_bytes)fp->fxp_rx_buf, rx_totbufsize, r= sys_umap(SELF, VM_D, (vir_bytes)fp->fxp_rx_buf, rx_totbufsize,
&fp->fxp_rx_busaddr); &bus_addr);
if (r != OK) if (r != OK)
panic("sys_umap failed: %d", r); panic("sys_umap failed: %d", r);
fp->fxp_rx_busaddr= bus_addr;
#if 0 #if 0
printf("fxp_init_buf: got phys 0x%x for vir 0x%x\n", printf("fxp_init_buf: got phys 0x%x for vir 0x%x\n",
@ -872,9 +873,10 @@ fxp_t *fp;
if (i != fp->fxp_rx_nbuf-1) if (i != fp->fxp_rx_nbuf-1)
{ {
r= sys_umap(SELF, VM_D, (vir_bytes)&rfdp[1], r= sys_umap(SELF, VM_D, (vir_bytes)&rfdp[1],
sizeof(rfdp[1]), &rfdp->rfd_linkaddr); sizeof(rfdp[1]), &bus_addr);
if (r != OK) if (r != OK)
panic("sys_umap failed: %d", r); panic("sys_umap failed: %d", r);
rfdp->rfd_linkaddr= bus_addr;
} }
else else
{ {
@ -901,10 +903,10 @@ fxp_t *fp;
if (i != fp->fxp_tx_nbuf-1) if (i != fp->fxp_tx_nbuf-1)
{ {
r= sys_umap(SELF, VM_D, (vir_bytes)&txp[1], r= sys_umap(SELF, VM_D, (vir_bytes)&txp[1],
(phys_bytes)sizeof(txp[1]), (phys_bytes)sizeof(txp[1]), &bus_addr);
&txp->tx_linkaddr);
if (r != OK) if (r != OK)
panic("sys_umap failed: %d", r); panic("sys_umap failed: %d", r);
txp->tx_linkaddr= bus_addr;
} }
else else
{ {
@ -951,7 +953,7 @@ static void fxp_confaddr(fxp_t *fp)
static char eakey[]= FXP_ENVVAR "#_EA"; static char eakey[]= FXP_ENVVAR "#_EA";
static char eafmt[]= "x:x:x:x:x:x"; static char eafmt[]= "x:x:x:x:x:x";
int i, r; int i, r;
u32_t bus_addr; phys_bytes bus_addr;
long v; long v;
/* User defined ethernet address? */ /* User defined ethernet address? */
@ -1354,7 +1356,7 @@ static void fxp_do_conf(fp)
fxp_t *fp; fxp_t *fp;
{ {
int r; int r;
u32_t bus_addr; phys_bytes bus_addr;
/* Configure device */ /* Configure device */
tmpbufp->cc.cc_status= 0; tmpbufp->cc.cc_status= 0;

View file

@ -235,7 +235,7 @@ int hermes_init (hermes_t * hw)
} }
if (!(reg & HERMES_EV_CMD)) { if (!(reg & HERMES_EV_CMD)) {
printf("hermes @ %lx: Timeout waiting for card to reset\n", printf("hermes @ %x: Timeout waiting for card to reset\n",
hw->iobase); hw->iobase);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
@ -250,7 +250,7 @@ int hermes_init (hermes_t * hw)
/* Was the status, the result of the issued command, ok? */ /* Was the status, the result of the issued command, ok? */
/* The expression below should be zero. Non-zero means an error */ /* The expression below should be zero. Non-zero means an error */
if (status & HERMES_STATUS_RESULT) { if (status & HERMES_STATUS_RESULT) {
printf("Hermes:Result of INIT_CMD wrong.error value: 0x%lx\n", printf("Hermes:Result of INIT_CMD wrong.error value: 0x%x\n",
(status & HERMES_STATUS_RESULT) >> 8); (status & HERMES_STATUS_RESULT) >> 8);
err = -EIO; err = -EIO;
} }
@ -272,7 +272,7 @@ int hermes_docmd_wait (hermes_t * hw, u16_t cmd, u16_t parm0,
err = hermes_issue_cmd (hw, cmd, parm0); err = hermes_issue_cmd (hw, cmd, parm0);
if (err) { if (err) {
printf("hermes @ %lx: Error %d issuing command.\n", printf("hermes @ %x: Error %d issuing command.\n",
hw->iobase, err); hw->iobase, err);
return err; return err;
} }
@ -290,7 +290,7 @@ int hermes_docmd_wait (hermes_t * hw, u16_t cmd, u16_t parm0,
/* check for a timeout: has the command still not completed? */ /* check for a timeout: has the command still not completed? */
if (!(reg & HERMES_EV_CMD)) { if (!(reg & HERMES_EV_CMD)) {
printf("hermes @ %lx: Timeout waiting for command \ printf("hermes @ %x: Timeout waiting for command \
completion.\n", hw->iobase); completion.\n", hw->iobase);
err = -ETIMEDOUT; err = -ETIMEDOUT;
return err; return err;
@ -361,7 +361,7 @@ int hermes_allocate (hermes_t * hw, u16_t size, u16_t * fid) {
/* tired of waiting to complete. Abort. */ /* tired of waiting to complete. Abort. */
if (!(reg & HERMES_EV_ALLOC)) { if (!(reg & HERMES_EV_ALLOC)) {
printf("hermes @ %lx:Timeout waiting for frame allocation\n", printf("hermes @ %x:Timeout waiting for frame allocation\n",
hw->iobase); hw->iobase);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
@ -622,13 +622,13 @@ int hermes_read_ltv (hermes_t * hw, int bap, u16_t rid, unsigned bufsize,
*length = rlength; *length = rlength;
if (rtype != rid) { if (rtype != rid) {
printf("hermes @ %lx: hermes_read_ltv(): rid (0x%04x)", printf("hermes @ %x: hermes_read_ltv(): rid (0x%04x)",
hw->iobase, rid); hw->iobase, rid);
printf("does not match type (0x%04x)\n", rtype); printf("does not match type (0x%04x)\n", rtype);
} }
if (HERMES_RECLEN_TO_BYTES (rlength) > bufsize) { if (HERMES_RECLEN_TO_BYTES (rlength) > bufsize) {
printf("hermes @ %lx: Truncating LTV record from ", printf("hermes @ %x: Truncating LTV record from ",
hw->iobase); hw->iobase);
printf("%d to %d bytes. (rid=0x%04x, len=0x%04x)\n", printf("%d to %d bytes. (rid=0x%04x, len=0x%04x)\n",
HERMES_RECLEN_TO_BYTES (rlength), bufsize, rid, HERMES_RECLEN_TO_BYTES (rlength), bufsize, rid,

View file

@ -696,7 +696,7 @@ static u32_t or_get_bar (int devind, t_or * orp)
HERMES_16BIT_REGSPACING); HERMES_16BIT_REGSPACING);
if (debug) { if (debug) {
printf ("%s: using I/O space address 0x%lx, IRQ %d\n", printf ("%s: using I/O space address 0x%x, IRQ %d\n",
orp->or_name, bar, orp->or_irq); orp->or_name, bar, orp->or_irq);
} }
@ -720,7 +720,7 @@ static u32_t or_get_bar (int devind, t_or * orp)
if (debug){ if (debug){
printf ("%s: using shared memory address", printf ("%s: using shared memory address",
orp->or_name); orp->or_name);
printf (" 0x%lx, IRQ %d\n", bar, orp->or_irq); printf (" 0x%x, IRQ %d\n", bar, orp->or_irq);
} }
return bar; return bar;

View file

@ -215,7 +215,7 @@ register message *m_ptr; /* pointer to the newly arrived message */
register int r = SUSPEND; register int r = SUSPEND;
int retries; int retries;
unsigned long status; u32_t status;
/* Reject command if last write is not yet finished, the count is not /* Reject command if last write is not yet finished, the count is not
* positive, or the user address is bad. * positive, or the user address is bad.
@ -435,7 +435,7 @@ PRIVATE void do_printer_output()
* IRQ yet! * IRQ yet!
*/ */
unsigned long status; u32_t status;
pvb_pair_t char_out[3]; pvb_pair_t char_out[3];
if (oleft == 0) { if (oleft == 0) {

View file

@ -923,8 +923,8 @@ static void rl_readv_s(const message *mp, int from_int)
if (!(rxstat & RL_RXS_ROK)) if (!(rxstat & RL_RXS_ROK))
{ {
printf("rxstat = 0x%08lx\n", rxstat); printf("rxstat = 0x%08x\n", rxstat);
printf("d_start: 0x%x, d_end: 0x%x, rxstat: 0x%lx\n", printf("d_start: 0x%x, d_end: 0x%x, rxstat: 0x%x\n",
d_start, d_end, rxstat); d_start, d_end, rxstat);
panic("received packet not OK"); panic("received packet not OK");
} }
@ -933,10 +933,10 @@ static void rl_readv_s(const message *mp, int from_int)
{ {
/* Someting went wrong */ /* Someting went wrong */
printf( printf(
"rl_readv: bad length (%u) in status 0x%08lx at offset 0x%x\n", "rl_readv: bad length (%u) in status 0x%08x at offset 0x%x\n",
totlen, rxstat, d_start); totlen, rxstat, d_start);
printf( printf(
"d_start: 0x%x, d_end: 0x%x, totlen: %d, rxstat: 0x%lx\n", "d_start: 0x%x, d_end: 0x%x, totlen: %d, rxstat: 0x%x\n",
d_start, d_end, totlen, rxstat); d_start, d_end, totlen, rxstat);
panic(NULL); panic(NULL);
} }
@ -1935,7 +1935,7 @@ static int rl_handler(re_t *rep)
} }
else else
{ {
printf("TSD%d = 0x%04lx\n", i, tsd); printf("TSD%d = 0x%04x\n", i, tsd);
/* Set head and tail to this buffer */ /* Set head and tail to this buffer */
rep->re_tx_head= rep->re_tx_tail= i; rep->re_tx_head= rep->re_tx_tail= i;
@ -1982,7 +1982,7 @@ static int rl_handler(re_t *rep)
rep->re_stat.ets_carrSense++; rep->re_stat.ets_carrSense++;
if (tsd & RL_TSD_TABT) if (tsd & RL_TSD_TABT)
{ {
printf("rl_handler, TABT, TSD%d = 0x%04lx\n", printf("rl_handler, TABT, TSD%d = 0x%04x\n",
tx_tail, tsd); tx_tail, tsd);
assert(0); /* CLRABT is not all that assert(0); /* CLRABT is not all that
* effective, why not? * effective, why not?
@ -2010,7 +2010,7 @@ static int rl_handler(re_t *rep)
ertxth &= RL_TSD_ERTXTH_M; ertxth &= RL_TSD_ERTXTH_M;
if (debug && ertxth > rep->re_ertxth) if (debug && ertxth > rep->re_ertxth)
{ {
printf("%s: new ertxth: %ld bytes\n", printf("%s: new ertxth: %d bytes\n",
rep->re_name, rep->re_name,
(ertxth >> RL_TSD_ERTXTH_S) * (ertxth >> RL_TSD_ERTXTH_S) *
32); 32);

View file

@ -878,7 +878,7 @@ re_t *rep;
if ((s = sys_irqenable(&rep->re_hook_id)) != OK) if ((s = sys_irqenable(&rep->re_hook_id)) != OK)
printf("RTL8169: error, couldn't enable interrupts: %d\n", s); printf("RTL8169: error, couldn't enable interrupts: %d\n", s);
printf("%s: model: %s mac: 0x%08lx\n", printf("%s: model: %s mac: 0x%08x\n",
rep->re_name, rep->re_model, rep->re_mac); rep->re_name, rep->re_model, rep->re_mac);
rl_confaddr(rep); rl_confaddr(rep);
@ -1290,7 +1290,7 @@ readvs_loop:
totlen = rxstat & DESC_RX_LENMASK; totlen = rxstat & DESC_RX_LENMASK;
if (totlen < 8 || totlen > 2 * ETH_MAX_PACK_SIZE) { if (totlen < 8 || totlen > 2 * ETH_MAX_PACK_SIZE) {
/* Someting went wrong */ /* Someting went wrong */
printf("rl_readv_s: bad length (%u) in status 0x%08lx\n", printf("rl_readv_s: bad length (%u) in status 0x%08x\n",
totlen, rxstat); totlen, rxstat);
panic(NULL); panic(NULL);
} }

View file

@ -741,7 +741,7 @@ int reg; /* which register pair to set */
unsigned *val; /* 16-bit value to set it to */ unsigned *val; /* 16-bit value to set it to */
{ {
char v1, v2; char v1, v2;
unsigned long v; u32_t v;
/* Get a register pair inside the 6845. */ /* Get a register pair inside the 6845. */
sys_outb(vid_port + INDEX, reg); sys_outb(vid_port + INDEX, reg);
sys_inb(vid_port + DATA, &v); sys_inb(vid_port + DATA, &v);
@ -764,7 +764,7 @@ PRIVATE void beep()
*/ */
static timer_t tmr_stop_beep; static timer_t tmr_stop_beep;
pvb_pair_t char_out[3]; pvb_pair_t char_out[3];
unsigned long port_b_val; u32_t port_b_val;
/* Set timer in advance to prevent beeping delay. */ /* Set timer in advance to prevent beeping delay. */
set_timer(&tmr_stop_beep, B_TIME, stop_beep, 0); set_timer(&tmr_stop_beep, B_TIME, stop_beep, 0);
@ -871,7 +871,7 @@ clock_t dur;
*/ */
static timer_t tmr_stop_beep; static timer_t tmr_stop_beep;
pvb_pair_t char_out[3]; pvb_pair_t char_out[3];
unsigned long port_b_val; u32_t port_b_val;
unsigned long ival= TIMER_FREQ / freq; unsigned long ival= TIMER_FREQ / freq;
if (ival == 0 || ival > 0xffff) if (ival == 0 || ival > 0xffff)
@ -899,7 +899,7 @@ clock_t dur;
PRIVATE void stop_beep(timer_t *UNUSED(tmrp)) PRIVATE void stop_beep(timer_t *UNUSED(tmrp))
{ {
/* Turn off the beeper by turning off bits 0 and 1 in PORT_B. */ /* Turn off the beeper by turning off bits 0 and 1 in PORT_B. */
unsigned long port_b_val; u32_t port_b_val;
if (sys_inb(PORT_B, &port_b_val)==OK && if (sys_inb(PORT_B, &port_b_val)==OK &&
sys_outb(PORT_B, (port_b_val & ~3))==OK) sys_outb(PORT_B, (port_b_val & ~3))==OK)
beeping = FALSE; beeping = FALSE;

View file

@ -675,7 +675,7 @@ int try;
*===========================================================================*/ *===========================================================================*/
PRIVATE void kbd_send() PRIVATE void kbd_send()
{ {
unsigned long sb; u32_t sb;
int r; int r;
if (!kbdout.avail) if (!kbdout.avail)
@ -688,7 +688,7 @@ PRIVATE void kbd_send()
} }
if (sb & (KB_OUT_FULL|KB_IN_FULL)) if (sb & (KB_OUT_FULL|KB_IN_FULL))
{ {
printf("not sending 1: sb = 0x%lx\n", sb); printf("not sending 1: sb = 0x%x\n", sb);
return; return;
} }
micro_delay(KBC_IN_DELAY); micro_delay(KBC_IN_DELAY);
@ -697,7 +697,7 @@ PRIVATE void kbd_send()
} }
if (sb & (KB_OUT_FULL|KB_IN_FULL)) if (sb & (KB_OUT_FULL|KB_IN_FULL))
{ {
printf("not sending 2: sb = 0x%lx\n", sb); printf("not sending 2: sb = 0x%x\n", sb);
return; return;
} }
@ -706,7 +706,7 @@ PRIVATE void kbd_send()
printf("sending byte 0x%x to keyboard\n", kbdout.buf[kbdout.offset]); printf("sending byte 0x%x to keyboard\n", kbdout.buf[kbdout.offset]);
#endif #endif
if((r=sys_outb(KEYBD, kbdout.buf[kbdout.offset])) != OK) { if((r=sys_outb(KEYBD, kbdout.buf[kbdout.offset])) != OK) {
printf("kbd_send: 3 sys_inb() failed: %d\n", r); printf("kbd_send: 3 sys_outb() failed: %d\n", r);
} }
kbdout.offset++; kbdout.offset++;
kbdout.avail--; kbdout.avail--;
@ -884,7 +884,7 @@ int data;
PRIVATE int kbc_read() PRIVATE int kbc_read()
{ {
int i; int i;
unsigned long byte, st; u32_t byte, st;
#if 0 #if 0
struct micro_state ms; struct micro_state ms;
#endif #endif
@ -910,9 +910,9 @@ PRIVATE int kbc_read()
if(sys_inb(KEYBD, &byte) != OK) if(sys_inb(KEYBD, &byte) != OK)
printf("kbc_read: 2 sys_inb failed\n"); printf("kbc_read: 2 sys_inb failed\n");
if (st & KB_AUX_BYTE) if (st & KB_AUX_BYTE)
printf("kbc_read: aux byte 0x%lx\n", byte); printf("kbc_read: aux byte 0x%x\n", byte);
#if DEBUG #if DEBUG
printf("keyboard`kbc_read: returning byte 0x%lx\n", printf("keyboard`kbc_read: returning byte 0x%x\n",
byte); byte);
#endif #endif
return byte; return byte;
@ -934,7 +934,7 @@ PRIVATE int kb_wait()
/* Wait until the controller is ready; return zero if this times out. */ /* Wait until the controller is ready; return zero if this times out. */
int retries; int retries;
unsigned long status; u32_t status;
int s, isaux; int s, isaux;
unsigned char byte; unsigned char byte;
@ -965,8 +965,7 @@ PRIVATE int kb_ack()
/* Wait until kbd acknowledges last command; return zero if this times out. */ /* Wait until kbd acknowledges last command; return zero if this times out. */
int retries, s; int retries, s;
unsigned long u8val; u32_t u8val;
retries = MAX_KB_ACK_RETRIES + 1; retries = MAX_KB_ACK_RETRIES + 1;
do { do {
@ -1254,7 +1253,7 @@ PRIVATE int scan_keyboard(bp, isauxp)
unsigned char *bp; unsigned char *bp;
int *isauxp; int *isauxp;
{ {
unsigned long b, sb; u32_t b, sb;
if(sys_inb(KB_STATUS, &sb) != OK) if(sys_inb(KB_STATUS, &sb) != OK)
printf("scan_keyboard: sys_inb failed\n"); printf("scan_keyboard: sys_inb failed\n");

View file

@ -201,7 +201,7 @@ PRIVATE void unlock(void) {}
PRIVATE int my_inb(port_t port) PRIVATE int my_inb(port_t port)
{ {
int r; int r;
unsigned long v = 0; u32_t v = 0;
r = sys_inb(port, &v); r = sys_inb(port, &v);
if (r != OK) if (r != OK)
printf("RS232 warning: failed inb 0x%x\n", port); printf("RS232 warning: failed inb 0x%x\n", port);
@ -426,7 +426,7 @@ PRIVATE void rs_config(rs232_t *rs)
PUBLIC void rs_init(tty_t *tp) PUBLIC void rs_init(tty_t *tp)
/* tp which TTY */ /* tp which TTY */
{ {
unsigned long dummy; u32_t dummy;
/* Initialize RS232 for one line. */ /* Initialize RS232 for one line. */
register rs232_t *rs; register rs232_t *rs;
@ -640,7 +640,7 @@ PRIVATE int rs_break(tty_t *tp, int UNUSED(dummy))
{ {
/* Generate a break condition by setting the BREAK bit for 0.4 sec. */ /* Generate a break condition by setting the BREAK bit for 0.4 sec. */
rs232_t *rs = tp->tty_priv; rs232_t *rs = tp->tty_priv;
unsigned long line_controls; u32_t line_controls;
sys_inb(rs->line_ctl_port, &line_controls); sys_inb(rs->line_ctl_port, &line_controls);
sys_outb(rs->line_ctl_port, line_controls | LC_BREAK); sys_outb(rs->line_ctl_port, line_controls | LC_BREAK);
@ -675,7 +675,7 @@ PRIVATE void rs232_handler(struct rs232 *rs)
/* Interrupt hander for RS232. */ /* Interrupt hander for RS232. */
while (TRUE) { while (TRUE) {
unsigned long v; u32_t v;
/* Loop to pick up ALL pending interrupts for device. /* Loop to pick up ALL pending interrupts for device.
* This usually just wastes time unless the hardware has a buffer * This usually just wastes time unless the hardware has a buffer
* (and then we have to worry about being stuck in the loop too long). * (and then we have to worry about being stuck in the loop too long).
@ -713,7 +713,7 @@ PRIVATE void in_int(register rs232_t *rs)
* Set a flag for the clock interrupt handler to eventually notify TTY. * Set a flag for the clock interrupt handler to eventually notify TTY.
*/ */
unsigned long c; u32_t c;
#if 0 /* Enable this if you want serial input in the kernel */ #if 0 /* Enable this if you want serial input in the kernel */
return; return;
@ -756,7 +756,7 @@ PRIVATE void line_int(register rs232_t *rs)
{ {
/* Check for and record errors. */ /* Check for and record errors. */
unsigned long s; u32_t s;
sys_inb(rs->line_status_port, &s); sys_inb(rs->line_status_port, &s);
rs->lstatus = s; rs->lstatus = s;
if (rs->lstatus & LS_FRAMING_ERR) ++rs->framing_errors; if (rs->lstatus & LS_FRAMING_ERR) ++rs->framing_errors;

View file

@ -224,16 +224,16 @@ _PROTOTYPE(int sys_vinw, (pvw_pair_t *pvw_pairs, int nr_ports) );
_PROTOTYPE(int sys_vinl, (pvl_pair_t *pvl_pairs, int nr_ports) ); _PROTOTYPE(int sys_vinl, (pvl_pair_t *pvl_pairs, int nr_ports) );
/* Shorthands for sys_out() system call. */ /* Shorthands for sys_out() system call. */
#define sys_outb(p,v) sys_out((p), (unsigned long) (v), _DIO_BYTE) #define sys_outb(p,v) sys_out((p), (u32_t) (v), _DIO_BYTE)
#define sys_outw(p,v) sys_out((p), (unsigned long) (v), _DIO_WORD) #define sys_outw(p,v) sys_out((p), (u32_t) (v), _DIO_WORD)
#define sys_outl(p,v) sys_out((p), (unsigned long) (v), _DIO_LONG) #define sys_outl(p,v) sys_out((p), (u32_t) (v), _DIO_LONG)
_PROTOTYPE(int sys_out, (int port, unsigned long value, int type) ); _PROTOTYPE(int sys_out, (int port, u32_t value, int type) );
/* Shorthands for sys_in() system call. */ /* Shorthands for sys_in() system call. */
#define sys_inb(p,v) sys_in((p), (v), _DIO_BYTE) #define sys_inb(p,v) sys_in((p), (v), _DIO_BYTE)
#define sys_inw(p,v) sys_in((p), (v), _DIO_WORD) #define sys_inw(p,v) sys_in((p), (v), _DIO_WORD)
#define sys_inl(p,v) sys_in((p), (v), _DIO_LONG) #define sys_inl(p,v) sys_in((p), (v), _DIO_LONG)
_PROTOTYPE(int sys_in, (int port, unsigned long *value, int type) ); _PROTOTYPE(int sys_in, (int port, u32_t *value, int type) );
/* pci.c */ /* pci.c */
_PROTOTYPE( void pci_init, (void) ); _PROTOTYPE( void pci_init, (void) );

View file

@ -7,6 +7,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <stdlib.h> #include <stdlib.h>
#include <minix/sysutil.h>
void void
__assert13(file, line, function, failedexpr) __assert13(file, line, function, failedexpr)

View file

@ -10,7 +10,7 @@
*===========================================================================*/ *===========================================================================*/
PUBLIC void ser_putc(char c) PUBLIC void ser_putc(char c)
{ {
unsigned long b; u32_t b;
int i; int i;
int lsr, thr; int lsr, thr;

View file

@ -5,7 +5,7 @@
*===========================================================================*/ *===========================================================================*/
PUBLIC int sys_in(port, value, type) PUBLIC int sys_in(port, value, type)
int port; /* port address to read from */ int port; /* port address to read from */
unsigned long *value; /* pointer where to store value */ u32_t *value; /* pointer where to store value */
int type; /* byte, word, long */ int type; /* byte, word, long */
{ {
message m_io; message m_io;

View file

@ -5,7 +5,7 @@
*===========================================================================*/ *===========================================================================*/
PUBLIC int sys_out(port, value, type) PUBLIC int sys_out(port, value, type)
int port; /* port address to write to */ int port; /* port address to write to */
unsigned long value; /* value to write */ u32_t value; /* value to write */
int type; /* byte, word, long */ int type; /* byte, word, long */
{ {
message m_io; message m_io;