2015-03-18 10:31:25 +01:00
|
|
|
/*
|
2016-09-22 11:53:09 +02:00
|
|
|
* \brief x86_64 constants
|
2015-03-18 10:31:25 +01:00
|
|
|
* \author Reto Buerki
|
|
|
|
* \date 2015-03-18
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Genode Labs GmbH
|
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
2016-09-22 11:53:09 +02:00
|
|
|
#ifndef _CORE__INCLUDE__SPEC__X86_64__BOARD_H_
|
|
|
|
#define _CORE__INCLUDE__SPEC__X86_64__BOARD_H_
|
2015-03-18 10:31:25 +01:00
|
|
|
|
|
|
|
namespace Genode
|
|
|
|
{
|
|
|
|
struct Board
|
|
|
|
{
|
|
|
|
enum {
|
|
|
|
MMIO_LAPIC_BASE = 0xfee00000,
|
|
|
|
MMIO_LAPIC_SIZE = 0x1000,
|
|
|
|
MMIO_IOAPIC_BASE = 0xfec00000,
|
|
|
|
MMIO_IOAPIC_SIZE = 0x1000,
|
|
|
|
|
|
|
|
VECTOR_REMAP_BASE = 48,
|
|
|
|
TIMER_VECTOR_KERNEL = 32,
|
|
|
|
TIMER_VECTOR_USER = 50,
|
hw_x86_64: Do not mask edge-triggered interrupts
Do not mask edge-triggered interrupts to avoid losing them while masked,
see Intel 82093AA I/O Advanced Programmable Interrupt Controller
(IOAPIC) specification, section 3.4.2, "Interrupt Mask":
"When this bit is 1, the interrupt signal is masked. Edge-sensitive
interrupts signaled on a masked interrupt pin are ignored (i.e., not
delivered or held pending)"
Or to quote Linus Torvalds on the subject:
"Now, edge-triggered interrupts are a _lot_ harder to mask, because the
Intel APIC is an unbelievable piece of sh*t, and has the edge-detect
logic _before_ the mask logic, so if a edge happens _while_ the device
is masked, you'll never ever see the edge ever again (unmasking will not
cause a new edge, so you simply lost the interrupt)."
So when you "mask" an edge-triggered IRQ, you can't really mask it at
all, because if you did that, you'd lose it forever if the IRQ comes in
while you masked it. Instead, we're supposed to leave it active, and set
a flag, and IF the IRQ comes in, we just remember it, and mask it at
that point instead, and then on unmasking, we have to replay it by
sending a self-IPI." [1]
[1] - http://yarchive.net/comp/linux/edge_triggered_interrupts.html
Ref #1448
2015-03-20 14:25:07 +01:00
|
|
|
ISA_IRQ_END = 15,
|
2015-03-18 10:31:25 +01:00
|
|
|
};
|
2016-01-11 11:02:52 +01:00
|
|
|
|
|
|
|
void init() { }
|
2015-03-18 10:31:25 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-09-22 11:53:09 +02:00
|
|
|
#endif /* _CORE__INCLUDE__SPEC__X86_64__BOARD_H_ */
|