Make UEFI boot-platform build again
[haiku.git] / headers / private / graphics / radeon / mmio.h
blob903392d0a105291c67448335466f6ea41cf9b154
1 /*
2 Copyright (c) 2002, Thomas Kurschel
5 Part of Radeon driver
7 Macros for easier memory mapped I/O access
8 */
10 #ifndef _MMIO_H
11 #define _MMIO_H
13 // read 8-bit register
14 #define INREG8( regs, addr ) (*(regs + (addr)))
15 // write 8-bit register
16 #define OUTREG8( regs, addr, val ) do { *(regs + (addr)) = (val); } while( 0 )
17 // read 32-bit register
18 #define INREG( regs, addr ) (*((vuint32 *)(regs + (addr))))
19 // write 32-bit register
20 #define OUTREG( regs, addr, val ) do { *(vuint32 *)(regs + (addr)) = (val); } while( 0 )
21 // write partial 32-bit register, keeping bits "mask"
22 #define OUTREGP( regs, addr, val, mask ) \
23 do { \
24 uint32 tmp = INREG( (regs), (addr) ); \
25 tmp &= (mask); \
26 tmp |= (val) & ~(mask); \
27 OUTREG( (regs), (addr), tmp ); \
28 } while (0)
30 #endif