mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Don't make assumptions about device address size
Prefer phys_addr_t for physical addresses. Resort to uintptr_t where a conversion to pointer occurs, since the physical address may be larger (e.g., sparc32). v2: * Use phys_addr_t. Signed-off-by: Andreas Färber <andreas.faerber@web.de> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@933 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
committed by
Andreas Färber
parent
70bbfcf6ce
commit
8356ea4eb9
@@ -22,15 +22,15 @@ extern uint32_t isa_io_base;
|
||||
* are arrays of bytes, and byte-swapping is not appropriate in
|
||||
* that case. - paulus
|
||||
*/
|
||||
#define insw(port, buf, ns) _insw((uint16_t *)((port)+isa_io_base), (buf), (ns))
|
||||
#define outsw(port, buf, ns) _outsw((uint16_t *)((port)+isa_io_base), (buf), (ns))
|
||||
#define insw(port, buf, ns) _insw((uint16_t *)(uintptr_t)((port)+isa_io_base), (buf), (ns))
|
||||
#define outsw(port, buf, ns) _outsw((uint16_t *)(uintptr_t)((port)+isa_io_base), (buf), (ns))
|
||||
|
||||
#define inb(port) in_8((uint8_t *)((port)+isa_io_base))
|
||||
#define outb(val, port) out_8((uint8_t *)((port)+isa_io_base), (val))
|
||||
#define inw(port) in_le16((uint16_t *)((port)+isa_io_base))
|
||||
#define outw(val, port) out_le16((uint16_t *)((port)+isa_io_base), (val))
|
||||
#define inl(port) in_le32((uint32_t *)((port)+isa_io_base))
|
||||
#define outl(val, port) out_le32((uint32_t *)((port)+isa_io_base), (val))
|
||||
#define inb(port) in_8((uint8_t *)(uintptr_t)((port)+isa_io_base))
|
||||
#define outb(val, port) out_8((uint8_t *)(uintptr_t)((port)+isa_io_base), (val))
|
||||
#define inw(port) in_le16((uint16_t *)(uintptr_t)((port)+isa_io_base))
|
||||
#define outw(val, port) out_le16((uint16_t *)(uintptr_t)((port)+isa_io_base), (val))
|
||||
#define inl(port) in_le32((uint32_t *)(uintptr_t)((port)+isa_io_base))
|
||||
#define outl(val, port) out_le32((uint32_t *)(uintptr_t)((port)+isa_io_base), (val))
|
||||
|
||||
/*
|
||||
* 8, 16 and 32 bit, big and little endian I/O operations, with barrier.
|
||||
|
||||
@@ -113,9 +113,9 @@ char uart_getchar(int port);
|
||||
void serial_putchar(int c);
|
||||
#endif
|
||||
#ifdef CONFIG_DRIVER_ESCC
|
||||
int uart_init(uint64_t port, unsigned long speed);
|
||||
int uart_charav(int port);
|
||||
char uart_getchar(int port);
|
||||
int uart_init(phys_addr_t port, unsigned long speed);
|
||||
int uart_charav(uintptr_t port);
|
||||
char uart_getchar(uintptr_t port);
|
||||
void serial_putchar(int c);
|
||||
void serial_cls(void);
|
||||
#ifdef CONFIG_DRIVER_ESCC_SUN
|
||||
|
||||
Reference in New Issue
Block a user