diff options
author | Helge Deller <deller@gmx.de> | 2024-01-18 16:56:56 +0100 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2024-01-18 16:56:56 +0100 |
commit | a488ee4a27cda3264bfdc9134558175ec2c3d1d3 (patch) | |
tree | b9a6a26e101a83353b7a13adcde5eb310841cf50 /src/parisc | |
parent | 293f9922f48a214f49db887a322ba980b4698c90 (diff) | |
download | seabios-hppa-a488ee4a27cda3264bfdc9134558175ec2c3d1d3.zip seabios-hppa-a488ee4a27cda3264bfdc9134558175ec2c3d1d3.tar.gz seabios-hppa-a488ee4a27cda3264bfdc9134558175ec2c3d1d3.tar.bz2 |
parisc: Add F_EXTEND() and ROM_EXTEND() helper macros
They are used to translate 32-bit addresses into I/O and Firmware
regions on 64-bit machines.
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'src/parisc')
-rw-r--r-- | src/parisc/hppa.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/parisc/hppa.h b/src/parisc/hppa.h index 03cd9f9..ec149a2 100644 --- a/src/parisc/hppa.h +++ b/src/parisc/hppa.h @@ -208,6 +208,22 @@ static inline u32 ror(u32 word, unsigned int shift) return (word >> (shift & 31)) | (word << ((-shift) & 31)); } + +/* F_EXTEND() is used to access I/O ports. ROM_EXTEND() to access firmware ROM/RAM */ +#if defined(__LP64__) +#define F_EXTEND(x) ((unsigned long)(0xfffffffful<<32) | (x)) +#define ROM_EXTEND(x) ((unsigned long)(0xfffffff0ul<<32) | (x)) +#else +#define F_EXTEND(x) ((unsigned long)(x)) +#define ROM_EXTEND(x) ((unsigned long)(x)) +#endif + +static inline void builtin_console_out(char c) +{ + asm volatile("copy %0,%%r26 ! diag 0x101" : : "r" (c) : "r26"); +} + + extern char has_astro; /* false for B160L machine with Dino PCI chip */ extern unsigned long hppa_port_pci_cmd; extern unsigned long hppa_port_pci_data; @@ -216,7 +232,7 @@ extern unsigned long hppa_port_pci_data; #define pci_ioport_addr(port) ((port >= 0x1000) && (port < FIRMWARE_START)) #define is_astro_ioport(port) (has_astro && (port < IOS_DIST_BASE_SIZE)) -#define astro_ioport_addr(port) ((void *)(portaddr_t)(IOS_DIST_BASE_ADDR + port)) +#define astro_ioport_addr(port) ((void *)(portaddr_t) F_EXTEND(IOS_DIST_BASE_ADDR + port)) /* inb()/outb() accesses little-endian memory and does byteswapping to host endianess */ |