fix a trivial warning when yabel with direct hw access is enabled.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5421 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
1f10de6cab
commit
5ae1db0a9b
|
@ -24,52 +24,6 @@
|
||||||
#include <device/pci_ops.h>
|
#include <device/pci_ops.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static unsigned int
|
|
||||||
read_io(void *addr, size_t sz)
|
|
||||||
{
|
|
||||||
unsigned int ret;
|
|
||||||
/* since we are using inb instructions, we need the port number as 16bit value */
|
|
||||||
u16 port = (u16)(u32) addr;
|
|
||||||
|
|
||||||
switch (sz) {
|
|
||||||
case 1:
|
|
||||||
asm volatile ("inb %1, %b0" : "=a"(ret) : "d" (port));
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
asm volatile ("inw %1, %w0" : "=a"(ret) : "d" (port));
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
asm volatile ("inl %1, %0" : "=a"(ret) : "d" (port));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ret = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
write_io(void *addr, unsigned int value, size_t sz)
|
|
||||||
{
|
|
||||||
u16 port = (u16)(u32) addr;
|
|
||||||
switch (sz) {
|
|
||||||
/* since we are using inb instructions, we need the port number as 16bit value */
|
|
||||||
case 1:
|
|
||||||
asm volatile ("outb %b0, %1" : : "a"(value), "d" (port));
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
asm volatile ("outw %w0, %1" : : "a"(value), "d" (port));
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
asm volatile ("outl %0, %1" : : "a"(value), "d" (port));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_X86
|
#ifdef CONFIG_ARCH_X86
|
||||||
#include <arch/io.h>
|
#include <arch/io.h>
|
||||||
#else
|
#else
|
||||||
|
@ -172,6 +126,52 @@ void my_outl(X86EMU_pioAddr addr, u32 val)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
static unsigned int
|
||||||
|
read_io(void *addr, size_t sz)
|
||||||
|
{
|
||||||
|
unsigned int ret;
|
||||||
|
/* since we are using inb instructions, we need the port number as 16bit value */
|
||||||
|
u16 port = (u16)(u32) addr;
|
||||||
|
|
||||||
|
switch (sz) {
|
||||||
|
case 1:
|
||||||
|
asm volatile ("inb %1, %b0" : "=a"(ret) : "d" (port));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
asm volatile ("inw %1, %w0" : "=a"(ret) : "d" (port));
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
asm volatile ("inl %1, %0" : "=a"(ret) : "d" (port));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ret = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
write_io(void *addr, unsigned int value, size_t sz)
|
||||||
|
{
|
||||||
|
u16 port = (u16)(u32) addr;
|
||||||
|
switch (sz) {
|
||||||
|
/* since we are using inb instructions, we need the port number as 16bit value */
|
||||||
|
case 1:
|
||||||
|
asm volatile ("outb %b0, %1" : : "a"(value), "d" (port));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
asm volatile ("outw %w0, %1" : : "a"(value), "d" (port));
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
asm volatile ("outl %0, %1" : : "a"(value), "d" (port));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
u32 pci_cfg_read(X86EMU_pioAddr addr, u8 size);
|
u32 pci_cfg_read(X86EMU_pioAddr addr, u8 size);
|
||||||
void pci_cfg_write(X86EMU_pioAddr addr, u32 val, u8 size);
|
void pci_cfg_write(X86EMU_pioAddr addr, u32 val, u8 size);
|
||||||
u8 handle_port_61h(void);
|
u8 handle_port_61h(void);
|
||||||
|
|
Loading…
Reference in New Issue