x86_traits.hh (5648:e8abda6e0980) x86_traits.hh (5651:7f0c8006c3d7)
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);
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);
96 // Each APIC gets two pages. One page is used for local apics to field
97 // accesses from the CPU, and the other is for all APICs to communicate.
98 const Addr PhysAddrAPICRangeSize = 1 << 12;
99
100 static inline Addr
101 x86IOAddress(const uint32_t port)
102 {
103 return PhysAddrPrefixIO | port;

--- 6 unchanged lines hidden (view full) ---

110 }
111
112 static inline Addr
113 x86LocalAPICAddress(const uint8_t id, const uint16_t addr)
114 {
115 assert(addr < (1 << 12));
116 return PhysAddrPrefixLocalAPIC | (id * (1 << 12)) | addr;
117 }
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 }
118}
119
120#endif //__ARCH_X86_X86TRAITS_HH__
126}
127
128#endif //__ARCH_X86_X86TRAITS_HH__