mirror of
https://github.com/reactos/reactos.git
synced 2025-03-30 17:10:22 +00:00
[HAL]
- Use functions instead of macros for irq<->vector<->irql translation, this will be neccessary, once apic support is there - Disable mp hal in rbuild for now, its broken anyway svn path=/trunk/; revision=53600
This commit is contained in:
parent
0f969dedca
commit
f627019d71
4 changed files with 35 additions and 26 deletions
|
@ -13,9 +13,9 @@
|
|||
<xi:include href="hal.rbuild" />
|
||||
<xi:include href="halacpi.rbuild" />
|
||||
<xi:include href="halxbox.rbuild" />
|
||||
<if property="BUILD_MP" value="1">
|
||||
<!-- if property="BUILD_MP" value="1">
|
||||
<xi:include href="halmps.rbuild" />
|
||||
</if>
|
||||
</if -->
|
||||
</if>
|
||||
|
||||
<if property="ARCH" value="amd64">
|
||||
|
|
|
@ -55,13 +55,11 @@
|
|||
#define TAG_BUS_HANDLER 'BusH'
|
||||
|
||||
/* Internal HAL Headers */
|
||||
#include "apic.h"
|
||||
#include "bus.h"
|
||||
#include "halirq.h"
|
||||
#include "haldma.h"
|
||||
#include "halp.h"
|
||||
#include "mps.h"
|
||||
#include "ioapic.h"
|
||||
#include "halacpi.h"
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -4,29 +4,19 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
UCHAR
|
||||
FASTCALL
|
||||
HalpIrqToVector(UCHAR Irq);
|
||||
|
||||
#define FIRST_DEVICE_VECTOR (0x30)
|
||||
#define FIRST_SYSTEM_VECTOR (0xef)
|
||||
KIRQL
|
||||
FASTCALL
|
||||
HalpVectorToIrql(UCHAR Vector);
|
||||
|
||||
#define IRQ_BASE FIRST_DEVICE_VECTOR
|
||||
#define NR_IRQS (FIRST_SYSTEM_VECTOR - FIRST_DEVICE_VECTOR)
|
||||
UCHAR
|
||||
FASTCALL
|
||||
HalpVectorToIrq(UCHAR Vector);
|
||||
|
||||
/*
|
||||
* FIXME:
|
||||
* This does not work if we have more than 24 IRQs (ie. more than one I/O APIC)
|
||||
*/
|
||||
#define VECTOR2IRQ(vector) (23 - (vector - IRQ_BASE) / 8)
|
||||
#define VECTOR2IRQL(vector) (PROFILE_LEVEL - VECTOR2IRQ(vector))
|
||||
#define IRQ2VECTOR(irq) (((23 - (irq)) * 8) + FIRST_DEVICE_VECTOR)
|
||||
#define VECTOR2IRQ(vector) HalpVectorToIrq(vector)
|
||||
#define VECTOR2IRQL(vector) HalpVectorToIrql(vector)
|
||||
#define IRQ2VECTOR(irq) HalpIrqToVector(irq)
|
||||
|
||||
#else
|
||||
|
||||
#define IRQ_BASE (0x30)
|
||||
#define NR_IRQS (16)
|
||||
|
||||
#define VECTOR2IRQ(vector) ((vector) - IRQ_BASE)
|
||||
#define VECTOR2IRQL(vector) (PROFILE_LEVEL - VECTOR2IRQ(vector))
|
||||
#define IRQ2VECTOR(irq) ((irq) + IRQ_BASE)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -512,6 +512,27 @@ HalpInitializePICs(IN BOOLEAN EnableInterrupts)
|
|||
__writeeflags(EFlags);
|
||||
}
|
||||
|
||||
UCHAR
|
||||
FASTCALL
|
||||
HalpIrqToVector(UCHAR Irq)
|
||||
{
|
||||
return (PRIMARY_VECTOR_BASE + Irq);
|
||||
}
|
||||
|
||||
UCHAR
|
||||
FASTCALL
|
||||
HalpVectorToIrq(UCHAR Vector)
|
||||
{
|
||||
return (Vector - PRIMARY_VECTOR_BASE);
|
||||
}
|
||||
|
||||
KIRQL
|
||||
FASTCALL
|
||||
HalpVectorToIrql(UCHAR Vector)
|
||||
{
|
||||
return (PROFILE_LEVEL - (Vector - PRIMARY_VECTOR_BASE));
|
||||
}
|
||||
|
||||
/* IRQL MANAGEMENT ************************************************************/
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue