Rev 1932 | Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1932 | Rev 1944 | ||
---|---|---|---|
Line 72... | Line 72... | ||
72 | }; |
72 | }; |
73 | 73 | ||
74 | /** Initialize keyboard and service interrupts using kernel routine. */ |
74 | /** Initialize keyboard and service interrupts using kernel routine. */ |
75 | void z8530_grab(void) |
75 | void z8530_grab(void) |
76 | { |
76 | { |
- | 77 | ipl_t ipl = interrupts_disable(); |
|
- | 78 | ||
77 | (void) z8530_read_a(&z8530, RR8); |
79 | (void) z8530_read_a(&z8530, RR8); |
78 | 80 | ||
79 | /* |
81 | /* |
80 | * Clear any pending TX interrupts or we never manage |
82 | * Clear any pending TX interrupts or we never manage |
81 | * to set FHC UART interrupt state to idle. |
83 | * to set FHC UART interrupt state to idle. |
Line 87... | Line 89... | ||
87 | /* 8 bits per character and enable receiver */ |
89 | /* 8 bits per character and enable receiver */ |
88 | z8530_write_a(&z8530, WR3, WR3_RX8BITSCH | WR3_RX_ENABLE); |
90 | z8530_write_a(&z8530, WR3, WR3_RX8BITSCH | WR3_RX_ENABLE); |
89 | 91 | ||
90 | z8530_write_a(&z8530, WR9, WR9_MIE); /* Master Interrupt Enable. */ |
92 | z8530_write_a(&z8530, WR9, WR9_MIE); /* Master Interrupt Enable. */ |
91 | 93 | ||
- | 94 | spinlock_lock(&z8530_irq.lock); |
|
92 | z8530_irq.notif_cfg.notify = false; |
95 | z8530_irq.notif_cfg.notify = false; |
- | 96 | spinlock_unlock(&z8530_irq.lock); |
|
- | 97 | interrupts_restore(ipl); |
|
93 | } |
98 | } |
94 | 99 | ||
95 | /** Resume the former IPC notification behavior. */ |
100 | /** Resume the former IPC notification behavior. */ |
96 | void z8530_release(void) |
101 | void z8530_release(void) |
97 | { |
102 | { |
- | 103 | ipl_t ipl = interrupts_disable(); |
|
- | 104 | spinlock_lock(&z8530_irq.lock); |
|
98 | if (z8530_irq.notif_cfg.answerbox) |
105 | if (z8530_irq.notif_cfg.answerbox) |
99 | z8530_irq.notif_cfg.notify = true; |
106 | z8530_irq.notif_cfg.notify = true; |
- | 107 | spinlock_unlock(&z8530_irq.lock); |
|
- | 108 | interrupts_restore(ipl); |
|
100 | } |
109 | } |
101 | 110 | ||
102 | /** Initialize z8530. */ |
111 | /** Initialize z8530. */ |
103 | void z8530_init(devno_t devno, inr_t inr, uintptr_t vaddr) |
112 | void z8530_init(devno_t devno, inr_t inr, uintptr_t vaddr) |
104 | { |
113 | { |