From: David van Moolenbroek Date: Sun, 4 Mar 2012 23:11:41 +0000 (+0100) Subject: drivers: resolve compiler warnings X-Git-Tag: v3.2.1~677 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=ca95f69;p=minix.git drivers: resolve compiler warnings --- diff --git a/drivers/acpi/osminixxf.c b/drivers/acpi/osminixxf.c index 4531d67a5..398f3a665 100644 --- a/drivers/acpi/osminixxf.c +++ b/drivers/acpi/osminixxf.c @@ -124,24 +124,24 @@ extern struct machine machine; -PRIVATE unsigned pci_inb(u16_t port) { - unsigned long value; +PRIVATE u32_t pci_inb(u16_t port) { + u32_t value; int s; if ((s=sys_inb(port, &value)) !=OK) printf("ACPI: warning, sys_inb failed: %d\n", s); return value; } -PRIVATE unsigned pci_inw(u16_t port) { - unsigned long value; +PRIVATE u32_t pci_inw(u16_t port) { + u32_t value; int s; if ((s=sys_inw(port, &value)) !=OK) printf("ACPI: warning, sys_inw failed: %d\n", s); return value; } -PRIVATE unsigned pci_inl(u16_t port) { - unsigned long value; +PRIVATE u32_t pci_inl(u16_t port) { + u32_t value; int s; if ((s=sys_inl(port, &value)) !=OK) printf("ACPI: warning, sys_inl failed: %d\n", s); @@ -823,13 +823,13 @@ AcpiOsReadPort ( *Value = 0; switch (Width) { case 8: - sys_inb(Address, (unsigned long *)Value); + sys_inb(Address, Value); break; case 16: - sys_inw(Address, (unsigned long *)Value); + sys_inw(Address, Value); break; case 32: - sys_inl(Address, (unsigned long *)Value); + sys_inl(Address, Value); break; } return AE_OK; diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index d03cafcbe..e33dd5bb1 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -189,9 +189,9 @@ FORWARD _PROTOTYPE( int at_vinb, (pvb_pair_t *, int n)); #undef sys_inb #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)); -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)); #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 check_dma(struct wini *wn) { - unsigned long dma_status = 0; - u32_t dma_base; + u32_t dma_status, dma_base; int id_dma, ultra_dma; 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) { int r; - unsigned long v; + u32_t v; #define DMAERR(msg) \ 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; iovec_t *iop, *iov_end = iov + nr_req; int n, r, s, errors, do_dma; - unsigned long block, w_status; + unsigned long block; + u32_t w_status; u64_t dv_size; unsigned nbytes; unsigned dma_buf_offset; @@ -1502,7 +1502,7 @@ PRIVATE int setup_dma( phys_bytes user_phys; unsigned n, offset, size; int i, j, r; - unsigned long v; + u32_t v; struct wini *wn = w_wn; int verbose = 0; @@ -1746,7 +1746,7 @@ PRIVATE void w_intr_wait(void) /* Wait for a task completion interrupt. */ int r; - unsigned long w_status; + u32_t w_status; message m; 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. */ int r, s; - unsigned long inbval; + u32_t inbval; w_intr_wait(); 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. */ - unsigned long w_status; + u32_t w_status; spin_t spin; int s; @@ -1855,7 +1855,7 @@ int value; /* required status */ { /* Wait until controller is in the required state. Return zero on timeout. */ - unsigned long w_status; + u32_t w_status; spin_t spin; int s; @@ -2302,7 +2302,7 @@ PRIVATE void w_hw_int(unsigned int irqs) PRIVATE void ack_irqs(unsigned int irqs) { unsigned int drive; - unsigned long w_status; + u32_t w_status; for (drive = 0; drive < MAX_DRIVES; drive++) { 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"); } -PRIVATE int at_out(int line, u32_t port, unsigned long value, - char *typename, int type) +PRIVATE int at_out(int line, u32_t port, u32_t value, char *typename, int type) { int s; s = sys_out(port, value, type); if(s == 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); panic("sys_out failed"); } -PRIVATE int at_in(int line, u32_t port, unsigned long *value, - char *typename, int type) +PRIVATE int at_in(int line, u32_t port, u32_t *value, char *typename, int type) { int s; s = sys_in(port, value, type); diff --git a/drivers/audio/es1370/pci_helper.c b/drivers/audio/es1370/pci_helper.c index ca45e9dad..47b039806 100644 --- a/drivers/audio/es1370/pci_helper.c +++ b/drivers/audio/es1370/pci_helper.c @@ -14,8 +14,8 @@ /*===========================================================================* * helper functions for I/O * *===========================================================================*/ -PUBLIC unsigned pci_inb(u16_t port) { - unsigned long value; +PUBLIC u32_t pci_inb(u16_t port) { + u32_t value; int s; if ((s=sys_inb(port, &value)) !=OK) 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) { - unsigned long value; +PUBLIC u32_t pci_inw(u16_t port) { + u32_t value; int s; if ((s=sys_inw(port, &value)) !=OK) 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) { - unsigned long value; +PUBLIC u32_t pci_inl(u16_t port) { + u32_t value; int s; if ((s=sys_inl(port, &value)) !=OK) printf("%s: warning, sys_inl failed: %d\n", DRIVER_NAME, s); diff --git a/drivers/audio/es1371/pci_helper.c b/drivers/audio/es1371/pci_helper.c index df35bafe4..44cce77c6 100644 --- a/drivers/audio/es1371/pci_helper.c +++ b/drivers/audio/es1371/pci_helper.c @@ -14,8 +14,8 @@ /*===========================================================================* * helper functions for I/O * *===========================================================================*/ -PUBLIC unsigned pci_inb(u16_t port) { - unsigned long value; +PUBLIC u32_t pci_inb(u16_t port) { + u32_t value; int s; if ((s=sys_inb(port, &value)) !=OK) 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) { - unsigned long value; +PUBLIC u32_t pci_inw(u16_t port) { + u32_t value; int s; if ((s=sys_inw(port, &value)) !=OK) 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) { - unsigned long value; +PUBLIC u32_t pci_inl(u16_t port) { + u32_t value; int s; if ((s=sys_inl(port, &value)) !=OK) printf("%s: warning, sys_inl failed: %d\n", DRIVER_NAME, s); diff --git a/drivers/audio/sb16/sb16.c b/drivers/audio/sb16/sb16.c index 79110dcb0..bede9a477 100644 --- a/drivers/audio/sb16/sb16.c +++ b/drivers/audio/sb16/sb16.c @@ -430,7 +430,7 @@ PUBLIC int dsp_command(int value) { PUBLIC int sb16_inb(int port) { int s; - unsigned long value; + u32_t value; if ((s=sys_inb(port, &value)) != OK) panic("sys_inb() failed: %d", s); diff --git a/drivers/dp8390/dp8390.c b/drivers/dp8390/dp8390.c index 9b29ecd41..e268b855f 100644 --- a/drivers/dp8390/dp8390.c +++ b/drivers/dp8390/dp8390.c @@ -1844,7 +1844,7 @@ u8_t inb(port_t port) u16_t inw(port_t port) { int r; - unsigned long value; + u32_t value; r= sys_inw(port, &value); if (r != OK) diff --git a/drivers/dpeth/8390.c b/drivers/dpeth/8390.c index 1a396ffc2..43f81deda 100644 --- a/drivers/dpeth/8390.c +++ b/drivers/dpeth/8390.c @@ -413,7 +413,8 @@ static void ns_recv(dpeth_t *dep, int fromint, int size) next = header.dr_next; 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; next = curr; diff --git a/drivers/dpeth/devio.c b/drivers/dpeth/devio.c index 99e7ab2f1..5aeb1e45f 100644 --- a/drivers/dpeth/devio.c +++ b/drivers/dpeth/devio.c @@ -27,7 +27,7 @@ static void warning(const char *type, int err) */ PUBLIC unsigned int inb(unsigned short port) { - unsigned long value; + u32_t value; int 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) { - unsigned long value; + u32_t value; int rc; if ((rc = sys_inw(port, &value)) != OK) warning("inw", rc); diff --git a/drivers/floppy/floppy.c b/drivers/floppy/floppy.c index 01c2bdacd..74af8f07f 100644 --- a/drivers/floppy/floppy.c +++ b/drivers/floppy/floppy.c @@ -947,7 +947,7 @@ PRIVATE int fdc_results(void) */ int s, result_nr; - unsigned long status; + u32_t status; spin_t spin; /* 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); 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 ((s=sys_inb(FDC_DATA, &tmp_r)) != OK) panic("Sys_inb in fdc_results() failed: %d", s); @@ -1024,7 +1024,7 @@ PRIVATE void fdc_out( */ spin_t spin; int s; - unsigned long status; + u32_t status; if (need_reset) return; /* if controller is not listening, return */ diff --git a/drivers/fxp/fxp.c b/drivers/fxp/fxp.c index e2f967d67..5051841a1 100644 --- a/drivers/fxp/fxp.c +++ b/drivers/fxp/fxp.c @@ -761,7 +761,7 @@ fxp_t *fp; { int i, r, isr; port_t port; - u32_t bus_addr; + phys_bytes bus_addr; port= fp->fxp_base_port; @@ -825,7 +825,7 @@ fxp_t *fp; { size_t rx_totbufsize, tx_totbufsize, tot_bufsize, alloc_bufsize; char *alloc_buf; - phys_bytes buf; + phys_bytes buf, bus_addr; int i, r; struct rfd *rfdp; struct tx *txp; @@ -856,9 +856,10 @@ fxp_t *fp; fp->fxp_rx_buf= (struct rfd *)&tmpbufp[1]; r= sys_umap(SELF, VM_D, (vir_bytes)fp->fxp_rx_buf, rx_totbufsize, - &fp->fxp_rx_busaddr); + &bus_addr); if (r != OK) panic("sys_umap failed: %d", r); + fp->fxp_rx_busaddr= bus_addr; #if 0 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) { r= sys_umap(SELF, VM_D, (vir_bytes)&rfdp[1], - sizeof(rfdp[1]), &rfdp->rfd_linkaddr); + sizeof(rfdp[1]), &bus_addr); if (r != OK) panic("sys_umap failed: %d", r); + rfdp->rfd_linkaddr= bus_addr; } else { @@ -901,10 +903,10 @@ fxp_t *fp; if (i != fp->fxp_tx_nbuf-1) { r= sys_umap(SELF, VM_D, (vir_bytes)&txp[1], - (phys_bytes)sizeof(txp[1]), - &txp->tx_linkaddr); + (phys_bytes)sizeof(txp[1]), &bus_addr); if (r != OK) panic("sys_umap failed: %d", r); + txp->tx_linkaddr= bus_addr; } else { @@ -951,7 +953,7 @@ static void fxp_confaddr(fxp_t *fp) static char eakey[]= FXP_ENVVAR "#_EA"; static char eafmt[]= "x:x:x:x:x:x"; int i, r; - u32_t bus_addr; + phys_bytes bus_addr; long v; /* User defined ethernet address? */ @@ -1354,7 +1356,7 @@ static void fxp_do_conf(fp) fxp_t *fp; { int r; - u32_t bus_addr; + phys_bytes bus_addr; /* Configure device */ tmpbufp->cc.cc_status= 0; diff --git a/drivers/orinoco/hermes.c b/drivers/orinoco/hermes.c index 70d03924a..c4f0c6691 100644 --- a/drivers/orinoco/hermes.c +++ b/drivers/orinoco/hermes.c @@ -235,7 +235,7 @@ int hermes_init (hermes_t * hw) } 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); return -ETIMEDOUT; } @@ -250,7 +250,7 @@ int hermes_init (hermes_t * hw) /* Was the status, the result of the issued command, ok? */ /* The expression below should be zero. Non-zero means an error */ 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); 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); if (err) { - printf("hermes @ %lx: Error %d issuing command.\n", + printf("hermes @ %x: Error %d issuing command.\n", hw->iobase, 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? */ if (!(reg & HERMES_EV_CMD)) { - printf("hermes @ %lx: Timeout waiting for command \ + printf("hermes @ %x: Timeout waiting for command \ completion.\n", hw->iobase); err = -ETIMEDOUT; return err; @@ -361,7 +361,7 @@ int hermes_allocate (hermes_t * hw, u16_t size, u16_t * fid) { /* tired of waiting to complete. Abort. */ 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); return -ETIMEDOUT; } @@ -622,13 +622,13 @@ int hermes_read_ltv (hermes_t * hw, int bap, u16_t rid, unsigned bufsize, *length = rlength; if (rtype != rid) { - printf("hermes @ %lx: hermes_read_ltv(): rid (0x%04x)", + printf("hermes @ %x: hermes_read_ltv(): rid (0x%04x)", hw->iobase, rid); printf("does not match type (0x%04x)\n", rtype); } if (HERMES_RECLEN_TO_BYTES (rlength) > bufsize) { - printf("hermes @ %lx: Truncating LTV record from ", + printf("hermes @ %x: Truncating LTV record from ", hw->iobase); printf("%d to %d bytes. (rid=0x%04x, len=0x%04x)\n", HERMES_RECLEN_TO_BYTES (rlength), bufsize, rid, diff --git a/drivers/orinoco/orinoco.c b/drivers/orinoco/orinoco.c index 013a580e7..dbf2c9f73 100644 --- a/drivers/orinoco/orinoco.c +++ b/drivers/orinoco/orinoco.c @@ -696,7 +696,7 @@ static u32_t or_get_bar (int devind, t_or * orp) HERMES_16BIT_REGSPACING); 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); } @@ -720,7 +720,7 @@ static u32_t or_get_bar (int devind, t_or * orp) if (debug){ printf ("%s: using shared memory address", 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; diff --git a/drivers/printer/printer.c b/drivers/printer/printer.c index 331d04828..2d05c4143 100644 --- a/drivers/printer/printer.c +++ b/drivers/printer/printer.c @@ -215,7 +215,7 @@ register message *m_ptr; /* pointer to the newly arrived message */ register int r = SUSPEND; int retries; - unsigned long status; + u32_t status; /* Reject command if last write is not yet finished, the count is not * positive, or the user address is bad. @@ -435,7 +435,7 @@ PRIVATE void do_printer_output() * IRQ yet! */ - unsigned long status; + u32_t status; pvb_pair_t char_out[3]; if (oleft == 0) { diff --git a/drivers/rtl8139/rtl8139.c b/drivers/rtl8139/rtl8139.c index 55cea9c41..3dae0aacc 100644 --- a/drivers/rtl8139/rtl8139.c +++ b/drivers/rtl8139/rtl8139.c @@ -923,8 +923,8 @@ static void rl_readv_s(const message *mp, int from_int) if (!(rxstat & RL_RXS_ROK)) { - printf("rxstat = 0x%08lx\n", rxstat); - printf("d_start: 0x%x, d_end: 0x%x, rxstat: 0x%lx\n", + printf("rxstat = 0x%08x\n", rxstat); + printf("d_start: 0x%x, d_end: 0x%x, rxstat: 0x%x\n", d_start, d_end, rxstat); panic("received packet not OK"); } @@ -933,10 +933,10 @@ static void rl_readv_s(const message *mp, int from_int) { /* Someting went wrong */ 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); 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); panic(NULL); } @@ -1935,7 +1935,7 @@ static int rl_handler(re_t *rep) } else { - printf("TSD%d = 0x%04lx\n", i, tsd); + printf("TSD%d = 0x%04x\n", i, tsd); /* Set head and tail to this buffer */ 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++; 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); assert(0); /* CLRABT is not all that * effective, why not? @@ -2010,7 +2010,7 @@ static int rl_handler(re_t *rep) ertxth &= RL_TSD_ERTXTH_M; if (debug && ertxth > rep->re_ertxth) { - printf("%s: new ertxth: %ld bytes\n", + printf("%s: new ertxth: %d bytes\n", rep->re_name, (ertxth >> RL_TSD_ERTXTH_S) * 32); diff --git a/drivers/rtl8169/rtl8169.c b/drivers/rtl8169/rtl8169.c index 465c87fc1..98cc96d55 100644 --- a/drivers/rtl8169/rtl8169.c +++ b/drivers/rtl8169/rtl8169.c @@ -878,7 +878,7 @@ re_t *rep; if ((s = sys_irqenable(&rep->re_hook_id)) != OK) 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); rl_confaddr(rep); @@ -1290,7 +1290,7 @@ readvs_loop: totlen = rxstat & DESC_RX_LENMASK; if (totlen < 8 || totlen > 2 * ETH_MAX_PACK_SIZE) { /* 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); panic(NULL); } diff --git a/drivers/tty/console.c b/drivers/tty/console.c index e9939b243..a1cfd6a63 100644 --- a/drivers/tty/console.c +++ b/drivers/tty/console.c @@ -741,7 +741,7 @@ int reg; /* which register pair to set */ unsigned *val; /* 16-bit value to set it to */ { char v1, v2; - unsigned long v; + u32_t v; /* Get a register pair inside the 6845. */ sys_outb(vid_port + INDEX, reg); sys_inb(vid_port + DATA, &v); @@ -764,7 +764,7 @@ PRIVATE void beep() */ static timer_t tmr_stop_beep; 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(&tmr_stop_beep, B_TIME, stop_beep, 0); @@ -871,7 +871,7 @@ clock_t dur; */ static timer_t tmr_stop_beep; pvb_pair_t char_out[3]; - unsigned long port_b_val; + u32_t port_b_val; unsigned long ival= TIMER_FREQ / freq; if (ival == 0 || ival > 0xffff) @@ -899,7 +899,7 @@ clock_t dur; PRIVATE void stop_beep(timer_t *UNUSED(tmrp)) { /* 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 && sys_outb(PORT_B, (port_b_val & ~3))==OK) beeping = FALSE; diff --git a/drivers/tty/keyboard.c b/drivers/tty/keyboard.c index e2dab153d..fd975707b 100644 --- a/drivers/tty/keyboard.c +++ b/drivers/tty/keyboard.c @@ -675,7 +675,7 @@ int try; *===========================================================================*/ PRIVATE void kbd_send() { - unsigned long sb; + u32_t sb; int r; if (!kbdout.avail) @@ -688,7 +688,7 @@ PRIVATE void kbd_send() } 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; } micro_delay(KBC_IN_DELAY); @@ -697,7 +697,7 @@ PRIVATE void kbd_send() } 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; } @@ -706,7 +706,7 @@ PRIVATE void kbd_send() printf("sending byte 0x%x to keyboard\n", kbdout.buf[kbdout.offset]); #endif 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.avail--; @@ -884,7 +884,7 @@ int data; PRIVATE int kbc_read() { int i; - unsigned long byte, st; + u32_t byte, st; #if 0 struct micro_state ms; #endif @@ -897,7 +897,7 @@ PRIVATE int kbc_read() * the kbd controller, return -1 on a timeout. */ for (i= 0; i<1000000; i++) - #if 0 +#if 0 micro_start(&ms); do #endif @@ -910,9 +910,9 @@ PRIVATE int kbc_read() if(sys_inb(KEYBD, &byte) != OK) printf("kbc_read: 2 sys_inb failed\n"); 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 - printf("keyboard`kbc_read: returning byte 0x%lx\n", + printf("keyboard`kbc_read: returning byte 0x%x\n", byte); #endif return byte; @@ -934,7 +934,7 @@ PRIVATE int kb_wait() /* Wait until the controller is ready; return zero if this times out. */ int retries; - unsigned long status; + u32_t status; int s, isaux; unsigned char byte; @@ -965,8 +965,7 @@ PRIVATE int kb_ack() /* Wait until kbd acknowledges last command; return zero if this times out. */ int retries, s; - unsigned long u8val; - + u32_t u8val; retries = MAX_KB_ACK_RETRIES + 1; do { @@ -1254,7 +1253,7 @@ PRIVATE int scan_keyboard(bp, isauxp) unsigned char *bp; int *isauxp; { - unsigned long b, sb; + u32_t b, sb; if(sys_inb(KB_STATUS, &sb) != OK) printf("scan_keyboard: sys_inb failed\n"); diff --git a/drivers/tty/rs232.c b/drivers/tty/rs232.c index a95a02db2..8b0597e29 100644 --- a/drivers/tty/rs232.c +++ b/drivers/tty/rs232.c @@ -201,7 +201,7 @@ PRIVATE void unlock(void) {} PRIVATE int my_inb(port_t port) { int r; - unsigned long v = 0; + u32_t v = 0; r = sys_inb(port, &v); if (r != OK) 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) /* tp which TTY */ { - unsigned long dummy; + u32_t dummy; /* Initialize RS232 for one line. */ 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. */ rs232_t *rs = tp->tty_priv; - unsigned long line_controls; + u32_t line_controls; sys_inb(rs->line_ctl_port, &line_controls); 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. */ while (TRUE) { - unsigned long v; + u32_t v; /* Loop to pick up ALL pending interrupts for device. * 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). @@ -713,7 +713,7 @@ PRIVATE void in_int(register rs232_t *rs) * 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 */ return; @@ -756,7 +756,7 @@ PRIVATE void line_int(register rs232_t *rs) { /* Check for and record errors. */ - unsigned long s; + u32_t s; sys_inb(rs->line_status_port, &s); rs->lstatus = s; if (rs->lstatus & LS_FRAMING_ERR) ++rs->framing_errors; diff --git a/include/minix/syslib.h b/include/minix/syslib.h index 22483fe3f..568b17798 100644 --- a/include/minix/syslib.h +++ b/include/minix/syslib.h @@ -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) ); /* Shorthands for sys_out() system call. */ -#define sys_outb(p,v) sys_out((p), (unsigned long) (v), _DIO_BYTE) -#define sys_outw(p,v) sys_out((p), (unsigned long) (v), _DIO_WORD) -#define sys_outl(p,v) sys_out((p), (unsigned long) (v), _DIO_LONG) -_PROTOTYPE(int sys_out, (int port, unsigned long value, int type) ); +#define sys_outb(p,v) sys_out((p), (u32_t) (v), _DIO_BYTE) +#define sys_outw(p,v) sys_out((p), (u32_t) (v), _DIO_WORD) +#define sys_outl(p,v) sys_out((p), (u32_t) (v), _DIO_LONG) +_PROTOTYPE(int sys_out, (int port, u32_t value, int type) ); /* Shorthands for sys_in() system call. */ #define sys_inb(p,v) sys_in((p), (v), _DIO_BYTE) #define sys_inw(p,v) sys_in((p), (v), _DIO_WORD) #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 */ _PROTOTYPE( void pci_init, (void) ); diff --git a/lib/libsys/assert.c b/lib/libsys/assert.c index 30d98fe1b..e70f4c5ec 100644 --- a/lib/libsys/assert.c +++ b/lib/libsys/assert.c @@ -7,6 +7,7 @@ #include #include +#include void __assert13(file, line, function, failedexpr) diff --git a/lib/libsys/ser_putc.c b/lib/libsys/ser_putc.c index e4f38598e..f39a3971b 100644 --- a/lib/libsys/ser_putc.c +++ b/lib/libsys/ser_putc.c @@ -10,7 +10,7 @@ *===========================================================================*/ PUBLIC void ser_putc(char c) { - unsigned long b; + u32_t b; int i; int lsr, thr; diff --git a/lib/libsys/sys_in.c b/lib/libsys/sys_in.c index 13ecce54d..dca155e71 100644 --- a/lib/libsys/sys_in.c +++ b/lib/libsys/sys_in.c @@ -5,7 +5,7 @@ *===========================================================================*/ PUBLIC int sys_in(port, value, type) 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 */ { message m_io; diff --git a/lib/libsys/sys_out.c b/lib/libsys/sys_out.c index 51cbfae05..f73ce11d4 100644 --- a/lib/libsys/sys_out.c +++ b/lib/libsys/sys_out.c @@ -5,7 +5,7 @@ *===========================================================================*/ PUBLIC int sys_out(port, value, type) int port; /* port address to write to */ -unsigned long value; /* value to write */ +u32_t value; /* value to write */ int type; /* byte, word, long */ { message m_io;