Subversion Repositories HelenOS

Rev

Rev 3386 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3386 Rev 4153
Line 43... Line 43...
43
#include <arch/trap/interrupt.h>
43
#include <arch/trap/interrupt.h>
44
#include <mm/page.h>
44
#include <mm/page.h>
45
#include <mm/slab.h>
45
#include <mm/slab.h>
46
#include <arch/types.h>
46
#include <arch/types.h>
47
#include <genarch/ofw/ofw_tree.h>
47
#include <genarch/ofw/ofw_tree.h>
-
 
48
#include <sysinfo/sysinfo.h>
48
 
49
 
49
fhc_t *central_fhc = NULL;
50
fhc_t *central_fhc = NULL;
50
 
51
 
51
/**
52
/**
52
 * I suspect this must be hardcoded in the FHC.
53
 * I suspect this must be hardcoded in the FHC.
Line 84... Line 85...
84
    if (!fhc)
85
    if (!fhc)
85
        return NULL;
86
        return NULL;
86
 
87
 
87
    fhc->uart_imap = (uint32_t *) hw_map(paddr, reg->size);
88
    fhc->uart_imap = (uint32_t *) hw_map(paddr, reg->size);
88
   
89
   
-
 
90
    /*
-
 
91
     * Set sysinfo data needed by the uspace FHC driver.
-
 
92
     */
-
 
93
    sysinfo_set_item_val("fhc.uart.size", NULL, reg->size);
-
 
94
    sysinfo_set_item_val("fhc.uart.physical", NULL, paddr);
-
 
95
    sysinfo_set_item_val("kbd.cir.fhc", NULL, 1);
-
 
96
 
89
    return fhc;
97
    return fhc;
90
}
98
}
91
 
99
 
92
void fhc_enable_interrupt(fhc_t *fhc, int inr)
100
void fhc_enable_interrupt(fhc_t *fhc, int inr)
93
{
101
{
94
    switch (inr) {
102
    switch (inr) {
95
    case FHC_UART_INR:
103
    case FHC_UART_INR:
96
        fhc->uart_imap[FHC_UART_IMAP] |= IMAP_V_MASK;
104
        fhc->uart_imap[FHC_UART_IMAP] |= IMAP_V_MASK;
97
        break;
105
        break;
98
    default:
106
    default:
99
        panic("Unexpected INR (%d)\n", inr);
107
        panic("Unexpected INR (%d).", inr);
100
        break;
108
        break;
101
    }
109
    }
102
}
110
}
103
 
111
 
104
void fhc_clear_interrupt(fhc_t *fhc, int inr)
112
void fhc_clear_interrupt(void *fhcp, int inr)
105
{
113
{
-
 
114
    fhc_t *fhc = (fhc_t *)fhcp;
106
    ASSERT(fhc->uart_imap);
115
    ASSERT(fhc->uart_imap);
107
 
116
 
108
    switch (inr) {
117
    switch (inr) {
109
    case FHC_UART_INR:
118
    case FHC_UART_INR:
110
        fhc->uart_imap[FHC_UART_ICLR] = 0;
119
        fhc->uart_imap[FHC_UART_ICLR] = 0;
111
        break;
120
        break;
112
    default:
121
    default:
113
        panic("Unexpected INR (%d)\n", inr);
122
        panic("Unexpected INR (%d).", inr);
114
        break;
123
        break;
115
    }
124
    }
116
}
125
}
117
 
126
 
118
/** @}
127
/** @}