[BACK]Return to bus.c CVS log [TXT][DIR] Up to [local] / funnyos / dev

Annotation of funnyos/dev/bus.c, Revision 1.2

1.1       init        1: /*
1.2     ! init        2:  * $Id: bus.c,v 1.1 2007/10/16 20:18:13 init Exp $
1.1       init        3:  */
                      4: #include <sys/types.h>
                      5: #include <sys/device.h>
                      6: #include <sys/bus.h>
                      7:
                      8: #include <libkern/printf.h>
                      9:
                     10: /*
                     11:  * Bus abstraction wrapper functions.
                     12:  */
                     13:
                     14: uint8_t
                     15: bus_read_1(struct bus_handle *bhp, uint32_t addr)
                     16: {
                     17:        /* XXX we may use bus locking here */
                     18:
1.2     ! init       19:        return(bhp->bus_read_1(bhp->bh_ownerdd, addr));
1.1       init       20: }
                     21:
                     22:
                     23: uint16_t
                     24: bus_read_2(struct bus_handle *bhp, uint32_t addr)
                     25: {
1.2     ! init       26:        return(bhp->bus_read_2(bhp->bh_ownerdd, addr));
1.1       init       27: }
                     28:
                     29:
                     30: uint32_t
                     31: bus_read_4(struct bus_handle *bhp, uint32_t addr)
                     32: {
1.2     ! init       33:        return(bhp->bus_read_4(bhp->bh_ownerdd, addr));
1.1       init       34: }
                     35:
                     36:
                     37: int
                     38: bus_write_1(struct bus_handle *bhp, uint32_t addr, uint8_t data)
                     39: {
1.2     ! init       40:        return(bhp->bus_write_1(bhp->bh_ownerdd, addr, data));
1.1       init       41: }
                     42:
                     43: int
                     44: bus_write_2(struct bus_handle *bhp, uint32_t addr, uint16_t data)
                     45: {
1.2     ! init       46:        return(bhp->bus_write_2(bhp->bh_ownerdd, addr, data));
1.1       init       47: }
                     48:
                     49: int
                     50: bus_write_4(struct bus_handle *bhp, uint32_t addr, uint32_t data)
                     51: {
1.2     ! init       52:        return(bhp->bus_write_4(bhp->bh_ownerdd, addr, data));
1.1       init       53: }
                     54:

CVSweb