Rev 3951 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3951 | Rev 3952 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | /** @file |
32 | /** @file |
33 | * @brief GXemul drivers. |
33 | * @brief GXemul drivers. |
34 | */ |
34 | */ |
35 | 35 | ||
36 | #include <interrupt.h> |
36 | #include <interrupt.h> |
37 | #include <ipc/irq.h> |
- | |
38 | #include <console/chardev.h> |
37 | #include <console/chardev.h> |
39 | #include <arch/drivers/gxemul.h> |
38 | #include <arch/drivers/gxemul.h> |
40 | #include <console/console.h> |
39 | #include <console/console.h> |
41 | #include <sysinfo/sysinfo.h> |
40 | #include <sysinfo/sysinfo.h> |
42 | #include <print.h> |
41 | #include <print.h> |
Line 202... | Line 201... | ||
202 | static irq_ownership_t gxemul_claim(irq_t *irq) |
201 | static irq_ownership_t gxemul_claim(irq_t *irq) |
203 | { |
202 | { |
204 | return IRQ_ACCEPT; |
203 | return IRQ_ACCEPT; |
205 | } |
204 | } |
206 | 205 | ||
207 | - | ||
208 | /** Acquire console back for kernel. */ |
- | |
209 | void gxemul_grab_console(void) |
- | |
210 | { |
- | |
211 | ipl_t ipl = interrupts_disable(); |
- | |
212 | spinlock_lock(&gxemul_console_irq.lock); |
- | |
213 | gxemul_console_irq.notif_cfg.notify = false; |
- | |
214 | spinlock_unlock(&gxemul_console_irq.lock); |
- | |
215 | interrupts_restore(ipl); |
- | |
216 | } |
- | |
217 | - | ||
218 | /** Return console to userspace. */ |
- | |
219 | void gxemul_release_console(void) |
- | |
220 | { |
- | |
221 | ipl_t ipl = interrupts_disable(); |
- | |
222 | spinlock_lock(&gxemul_console_irq.lock); |
- | |
223 | if (gxemul_console_irq.notif_cfg.answerbox) { |
- | |
224 | gxemul_console_irq.notif_cfg.notify = true; |
- | |
225 | } |
- | |
226 | spinlock_unlock(&gxemul_console_irq.lock); |
- | |
227 | interrupts_restore(ipl); |
- | |
228 | } |
- | |
229 | - | ||
230 | /** Initializes console object representing gxemul console. |
206 | /** Initializes console object representing gxemul console. |
231 | * |
207 | * |
232 | * @param devno device number. |
208 | * @param devno device number. |
233 | */ |
209 | */ |
234 | void gxemul_console_init(devno_t devno) |
210 | void gxemul_console_init(devno_t devno) |