diff options
author | Zou Nan hai <nanhai.zou@intel.com> | 2006-09-21 13:06:08 +0800 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2006-10-06 12:46:16 +0900 |
commit | 4160e1b01231b8393d11367c82690646368e251d (patch) | |
tree | 6fc849713b18e5867609de44d86b3acab3624a42 /purgatory | |
parent | ad691d700dd06b80adab8cc404ce8113ccdd1622 (diff) | |
download | kexec-tools-4160e1b01231b8393d11367c82690646368e251d.tar.gz |
kexec-tools: --noio option to disable I/O in purgatory code.
SN platform support PIO in a different way to generic IA64 platform. It
does not support most of the legacy I/O ports.
Give an --noio option to kexec-tools to disable I/O in purgatory code.
This patch also removed an unused io.h in kexec-tools.
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Edited to consistently use tabs instead of spaces for intentation,
remove one instance of trailing whitespace, and fix indentation
of noio line in options[].
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'purgatory')
-rw-r--r-- | purgatory/arch/ia64/entry.S | 1 | ||||
-rw-r--r-- | purgatory/arch/ia64/include/arch/io.h | 25 | ||||
-rw-r--r-- | purgatory/arch/ia64/io.h | 64 |
3 files changed, 40 insertions, 50 deletions
diff --git a/purgatory/arch/ia64/entry.S b/purgatory/arch/ia64/entry.S index a1e9e87b..2cc8302e 100644 --- a/purgatory/arch/ia64/entry.S +++ b/purgatory/arch/ia64/entry.S @@ -68,3 +68,4 @@ DECLARE_DATA8(__loaded_segments) DECLARE_DATA8(__loaded_segments_num) DECLARE_DATA8(__gp_value) +DECLARE_DATA8(__noio) diff --git a/purgatory/arch/ia64/include/arch/io.h b/purgatory/arch/ia64/include/arch/io.h deleted file mode 100644 index 7b313fca..00000000 --- a/purgatory/arch/ia64/include/arch/io.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef ARCH_IO_H -#define ARCH_IO_H - -#include <stdint.h> -/* Helper functions for directly doing I/O */ - -extern inline uint8_t inb(void *port) -{ - volatile unsigned char *addr = (unsigned char *)port; - uint8_t result; - - result = *addr; - asm volatile ("mf.a"::: "memory"); - return result; -} - -extern inline void outb (uint8_t value, void *port) -{ - volatile unsigned char *addr = (unsigned char *)port; - - *addr = value; - asm volatile ("mf.a"::: "memory"); -} - -#endif /* ARCH_IO_H */ diff --git a/purgatory/arch/ia64/io.h b/purgatory/arch/ia64/io.h index 73701595..0f78580e 100644 --- a/purgatory/arch/ia64/io.h +++ b/purgatory/arch/ia64/io.h @@ -3,7 +3,7 @@ #define UNCACHED(x) (void *)((x)|(1UL<<63)) #define MF() asm volatile ("mf.a" ::: "memory") #define IO_SPACE_ENCODING(p) ((((p) >> 2) << 12) | (p & 0xfff)) - +extern long __noio; static inline void *io_addr (unsigned long port) { unsigned long offset; @@ -16,28 +16,34 @@ static inline void *io_addr (unsigned long port) static inline unsigned int inb (unsigned long port) { volatile unsigned char *addr = io_addr(port); - unsigned char ret; - ret = *addr; - MF(); + unsigned char ret = 0; + if (!__noio) { + ret = *addr; + MF(); + } return ret; } static inline unsigned int inw (unsigned long port) { volatile unsigned short *addr = io_addr(port); - unsigned short ret; + unsigned short ret = 0; - ret = *addr; - MF(); + if (!__noio) { + ret = *addr; + MF(); + } return ret; } -static inline unsigned int ia64_inl (unsigned long port) +static inline unsigned int inl (unsigned long port) { - volatile unsigned int *addr = __ia64_mk_io_addr(port); - unsigned int ret; - ret = *addr; - MF(); + volatile unsigned int *addr = io_addr(port); + unsigned int ret ; + if (!__noio) { + ret = *addr; + MF(); + } return ret; } @@ -45,50 +51,58 @@ static inline void outb (unsigned char val, unsigned long port) { volatile unsigned char *addr = io_addr(port); - *addr = val; - MF(); + if (!__noio) { + *addr = val; + MF(); + } } static inline void outw (unsigned short val, unsigned long port) { volatile unsigned short *addr = io_addr(port); - *addr = val; - MF(); + if (!__noio) { + *addr = val; + MF(); + } } static inline void outl (unsigned int val, unsigned long port) { volatile unsigned int *addr = io_addr(port); - *addr = val; - MF(); + if (!__noio) { + *addr = val; + MF(); + } } - static inline unsigned char readb(const volatile void *addr) { - return *(volatile unsigned char *) addr; + return __noio ? 0 :*(volatile unsigned char *) addr; } static inline unsigned short readw(const volatile void *addr) { - return *(volatile unsigned short *) addr; + return __noio ? 0 :*(volatile unsigned short *) addr; } static inline unsigned int readl(const volatile void *addr) { - return *(volatile unsigned int *) addr; + return __noio ? 0 :*(volatile unsigned int *) addr; } static inline void writeb(unsigned char b, volatile void *addr) { - *(volatile unsigned char *) addr = b; + if (!__noio) + *(volatile unsigned char *) addr = b; } static inline void writew(unsigned short b, volatile void *addr) { - *(volatile unsigned short *) addr = b; + if (!__noio) + *(volatile unsigned short *) addr = b; } static inline void writel(unsigned int b, volatile void *addr) { - *(volatile unsigned int *) addr = b; + if (!__noio) + *(volatile unsigned int *) addr = b; } #endif |