解决O3下,printk在ap处理器中打印的信息会出现滚动的bug

This commit is contained in:
fslongjin 2022-08-01 23:45:21 +08:00
parent 23fa428274
commit aa7dc4daa5
3 changed files with 6 additions and 6 deletions

View File

@ -7,7 +7,7 @@ export ARCH=__x86_64__
export ROOT_PATH=$(shell pwd)
export DEBUG=DEBUG
export GLOBAL_CFLAGS := -mcmodel=large -fno-builtin -m64 -fno-stack-protector -D $(ARCH)
export GLOBAL_CFLAGS := -mcmodel=large -fno-builtin -m64 -fno-stack-protector -D $(ARCH) -O1
ifeq ($(DEBUG), DEBUG)
GLOBAL_CFLAGS += -g

View File

@ -10,7 +10,7 @@ LIB_FILES := $(foreach DIR,$(DIR_LIB),$(addprefix $(DIR)/,$(lib_patterns)))
# 控制操作系统使用的中断控制器 _INTR_8259A_ _INTR_APIC_
PIC := _INTR_APIC_
CFLAGS = $(GLOBAL_CFLAGS) -D $(PIC) -I $(shell pwd) -O3
CFLAGS = $(GLOBAL_CFLAGS) -D $(PIC) -I $(shell pwd)
export ASFLAGS := --64

View File

@ -10,8 +10,7 @@
#include <driver/uart/uart.h>
#include <driver/video/video.h>
#include "math.h"
#pragma GCC push_options
#pragma GCC optimize("O0")
struct printk_screen_info pos;
extern ul VBE_FB_phys_addr; // 由bootloader传来的帧缓存区的物理地址
static spinlock_t printk_lock;
@ -46,6 +45,8 @@ static uint *get_pos_VBE_FB_addr();
*/
static int cls();
#pragma GCC push_options
#pragma GCC optimize("O0")
/**
* @brief )
*
@ -54,7 +55,7 @@ static int cls();
* @param animation
*/
static int scroll(bool direction, int pixels, bool animation);
#pragma GCC pop_options
/**
* @brief 2~36
*
@ -960,4 +961,3 @@ int sprintk(char *buf, const char *fmt, ...)
return count;
}
#pragma GCC pop_options