move initialization code to PlatformPostInit()
[AROS.git] / arch / x86_64-pc / kernel / kernel_debug.c
blobae66aeb491768807bcdbffe63a40e7e31f045821
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <bootconsole.h>
8 #include "kernel_base.h"
9 #include "kernel_debug.h"
10 #include "kernel_intern.h"
12 #define __save_flags(x) __asm__ __volatile__("pushfq ; popq %0":"=g" (x): /* no input */)
13 #define __restore_flags(x) __asm__ __volatile__("pushq %0 ; popfq": /* no output */ :"g" (x):"memory", "cc")
14 #define __cli() __asm__ __volatile__("cli": : :"memory")
15 #define __sti() __asm__ __volatile__("sti": : :"memory")
17 int krnPutC(int c, struct KernelBase *KernelBase)
19 unsigned long flags;
21 __save_flags(flags);
24 * stegerg: Don't use Disable/Enable, because we want interrupt enabled flag
25 * to stay the same as it was before the Disable() call
27 __cli();
30 * If we got 0x03, this means graphics driver wants to take over the screen.
31 * If VESA hack is activated, it will use only upper half of the screen
32 * because y resolution was adjusted.
33 * In our turn, we need to switch over to lower half.
34 * VESA hack is supported only on graphical console of course. And do not
35 * expect it to work with native mode video driver. :)
37 if ((c == 0x03) && (scr_Type == SCR_GFX) && __KernBootPrivate->debug_framebuffer)
39 /* Reinitialize boot console with decreased height */
40 scr_FrameBuffer = __KernBootPrivate->debug_framebuffer;
41 fb_Resize(__KernBootPrivate->debug_y_resolution);
43 else
44 con_Putc(c);
47 * Interrupt flag is stored in flags - if it was enabled before,
48 * it will be renabled when the flags are restored
50 __restore_flags(flags);
52 return 1;