1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * Redistribution and use of this software in source and binary forms, 6 * with or without modification, are permitted provided that the 7 * following conditions are met: 8 * --- 79 unchanged lines hidden (view full) --- 88 const Addr IntAddrPrefixMask = ULL(0xffffffff00000000); 89 const Addr IntAddrPrefixCPUID = ULL(0x100000000); 90 const Addr IntAddrPrefixMSR = ULL(0x200000000); 91 const Addr IntAddrPrefixIO = ULL(0x300000000); 92 93 const Addr PhysAddrPrefixIO = ULL(0x8000000000000000); 94 const Addr PhysAddrPrefixPciConfig = ULL(0xC000000000000000); 95 const Addr PhysAddrPrefixLocalAPIC = ULL(0xA000000000000000); |
96 const Addr PhysAddrPrefixInterrupts = ULL(0x2000000000000000); |
97 // Each APIC gets two pages. One page is used for local apics to field 98 // accesses from the CPU, and the other is for all APICs to communicate. 99 const Addr PhysAddrAPICRangeSize = 1 << 12; 100 101 static inline Addr 102 x86IOAddress(const uint32_t port) 103 { 104 return PhysAddrPrefixIO | port; --- 6 unchanged lines hidden (view full) --- 111 } 112 113 static inline Addr 114 x86LocalAPICAddress(const uint8_t id, const uint16_t addr) 115 { 116 assert(addr < (1 << 12)); 117 return PhysAddrPrefixLocalAPIC | (id * (1 << 12)) | addr; 118 } |
119 120 static inline Addr 121 x86InterruptAddress(const uint8_t id, const uint16_t addr) 122 { 123 assert(addr < PhysAddrAPICRangeSize); 124 return PhysAddrPrefixInterrupts | (id * PhysAddrAPICRangeSize) | addr; 125 } |
126} 127 128#endif //__ARCH_X86_X86TRAITS_HH__ |