summaryrefslogtreecommitdiffstats
path: root/private/ntos/nthals/halsable/alpha/icic.c
blob: 7d853513a91dcc161f2f1948269387136c09b803 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*++

Copyright (c) 1995  Digital Equipment Corporation

Module Name:

    icic.c

Abstract:

    This module implements functions specific to the Interrupt
    Controller IC (ICIC).

Author:

    Dave Richards    26-May-1995

Environment:

    Kernel mode

Revision History:

--*/

#include "halp.h"
#include "t2.h"
#include "icic.h"


ULONGLONG
READ_ICIC_REGISTER(
    IN PVOID TxQva,
    IN ICIC_REGISTER IcIcRegister
    )

/*++

Routine Description:

    Read a 64-bit value from an ICIC register.

Arguments:

    TxQva - The QVA of the T3/T4 CSR space.

    IcIcRegister - The register number to read.

Return Value:

    The 64-bit value read.

--*/

{
    WRITE_T2_REGISTER( &((PT2_CSRS)TxQva)->Air, IcIcRegister );

    return READ_T2_REGISTER( &((PT2_CSRS)TxQva)->Dir );
}


VOID
WRITE_ICIC_REGISTER(
    IN PVOID TxQva,
    IN ICIC_REGISTER IcIcRegister,
    IN ULONGLONG Value
    )

/*++

Routine Description:

    Write a 64-bit value to an ICIC register.

Arguments:

    TxQva - The QVA of the T3/T4 CSR space.

    IcIcRegister - The register number to write.

    Value - The 64-bit value to write.

Return Value:

    None.

--*/
{
    WRITE_T2_REGISTER( &((PT2_CSRS)TxQva)->Air, IcIcRegister );

    WRITE_T2_REGISTER( &((PT2_CSRS)TxQva)->Dir, Value );

    (VOID)READ_T2_REGISTER( &((PT2_CSRS)TxQva)->Dir );
}