4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * X86 (and AMD64) Local APIC registers (VMM,++).
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * apic.mac is generated from this file by running 'kmk incs' in the root.
c58f1213e628a545081c70e26c6b67a841cff880vboxsync * Copyright (C) 2010-2012 Oracle Corporation
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * available from http://www.virtualbox.org. This file is free software;
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * you can redistribute it and/or modify it under the terms of the GNU
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * General Public License (GPL) as published by the Free Software
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * The contents of this file may alternatively be used under the terms
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * of the Common Development and Distribution License Version 1.0
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * VirtualBox OSE distribution, in which case the provisions of the
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * CDDL are applicable instead of those of the GPL.
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * You may elect to license modified versions of this file under the
4ad0e04fb2a93fb4980de2644f7ccca9e8869083vboxsync * terms and conditions of either the GPL or the CDDL or both.
b25beb02262250b10b8ab40797a8b6c55fc81783vboxsync#define APIC_REG_VERSION_GET_MAX_LVT(u32) ((u32 & 0xff0000) >> 16)
b25beb02262250b10b8ab40797a8b6c55fc81783vboxsync/* Defines according to Figure 10-8 of the Intel Software Developers Manual Vol 3A */
b25beb02262250b10b8ab40797a8b6c55fc81783vboxsync#define APIC_REG_LVT_MODE_MASK (RT_BIT(8) | RT_BIT(9) | RT_BIT(10))
b25beb02262250b10b8ab40797a8b6c55fc81783vboxsync#define APIC_REG_LVT_MODE_EXTINT (RT_BIT(8) | RT_BIT(9) | RT_BIT(10))
56dd9cee948a9c54f78376adb1aa98b1b3214ee2vboxsyncDECLINLINE(uint32_t) ApicRegRead(void *pvBase, uint32_t offReg)
56dd9cee948a9c54f78376adb1aa98b1b3214ee2vboxsync return *(const volatile uint32_t *)((uintptr_t)pvBase + offReg);
6cac05f856d982151579a9d445a109960c2c07d2vboxsync * Reads an X2APIC register.
6cac05f856d982151579a9d445a109960c2c07d2vboxsync * @param offReg MMIO offset, APIC_REG_XXX.
6cac05f856d982151579a9d445a109960c2c07d2vboxsyncDECLINLINE(uint32_t) ApicX2RegRead32(uint32_t offReg)
6cac05f856d982151579a9d445a109960c2c07d2vboxsync return ASMRdMsr((offReg >> 4) + MSR_IA32_X2APIC_START);
b25beb02262250b10b8ab40797a8b6c55fc81783vboxsync#endif /* ___VBox_apic_h */