prism2.device: Compiler delint
[AROS.git] / arch / x86_64-pc / kernel / kernel_debug.c
blobac7e6468febeed5447690264b924bbf21053bb95
1 #include <bootconsole.h>
3 #include "kernel_base.h"
4 #include "kernel_debug.h"
5 #include "kernel_intern.h"
7 #define __save_flags(x) __asm__ __volatile__("pushfq ; popq %0":"=g" (x): /* no input */)
8 #define __restore_flags(x) __asm__ __volatile__("pushq %0 ; popfq": /* no output */ :"g" (x):"memory", "cc")
9 #define __cli() __asm__ __volatile__("cli": : :"memory")
10 #define __sti() __asm__ __volatile__("sti": : :"memory")
12 int krnPutC(int c, struct KernelBase *KernelBase)
14 unsigned long flags;
16 __save_flags(flags);
19 * stegerg: Don't use Disable/Enable, because we want interrupt enabled flag
20 * to stay the same as it was before the Disable() call
22 __cli();
25 * If we got 0x03, this means graphics driver wants to take over the screen.
26 * If VESA hack is activated, it will use only upper half of the screen
27 * because y resolution was adjusted.
28 * In our turn, we need to switch over to lower half.
29 * VESA hack is supported only on graphical console of course. And do not
30 * expect it to work with native mode video driver. :)
32 if ((c == 0x03) && (scr_Type == SCR_GFX) && __KernBootPrivate->debug_framebuffer)
34 /* Reinitialize boot console with decreased height */
35 scr_FrameBuffer = __KernBootPrivate->debug_framebuffer;
36 fb_Resize(__KernBootPrivate->debug_y_resolution);
38 else
39 con_Putc(c);
42 * Interrupt flag is stored in flags - if it was enabled before,
43 * it will be renabled when the flags are restored
45 __restore_flags(flags);
47 return 1;