mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 16:26:31 +00:00
🆕 完成了简单的内存管理单元,能分配内存页面
This commit is contained in:
59
kernel/common/kprint.h
Normal file
59
kernel/common/kprint.h
Normal file
@ -0,0 +1,59 @@
|
||||
/**
|
||||
* @file kprint.h
|
||||
* @author longjin
|
||||
* @brief 内核日志打印程序
|
||||
* @date 2022-01-28
|
||||
*
|
||||
* @copyright Copyright (c) 2022 longjin
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "printk.h"
|
||||
|
||||
#define kinfo(...) \
|
||||
do \
|
||||
{ \
|
||||
printk("[ INFO ] "); \
|
||||
printk(__VA_ARGS__); \
|
||||
printk("\n"); \
|
||||
} while (0);
|
||||
|
||||
#define kdebug(...) \
|
||||
do \
|
||||
{ \
|
||||
printk("[ DEBUG ] "); \
|
||||
printk(__VA_ARGS__); \
|
||||
printk("\n"); \
|
||||
} while (0);
|
||||
|
||||
#define kwarn(...) \
|
||||
do \
|
||||
{ \
|
||||
printk("[ "); \
|
||||
printk_color(YELLOW, BLACK, "WARN"); \
|
||||
printk(" ] "); \
|
||||
printk(__VA_ARGS__); \
|
||||
printk("\n"); \
|
||||
} while (0);
|
||||
|
||||
#define kerror(...) \
|
||||
do \
|
||||
{ \
|
||||
printk("[ "); \
|
||||
printk_color(RED, BLACK, "ERROR"); \
|
||||
printk(" ] "); \
|
||||
printk(__VA_ARGS__); \
|
||||
printk("\n"); \
|
||||
} while (0);
|
||||
|
||||
#define kterminated(...) \
|
||||
do \
|
||||
{ \
|
||||
printk("[ "); \
|
||||
printk_color(RED, BLACK, "TERMINATED"); \
|
||||
printk(" ] "); \
|
||||
printk(__VA_ARGS__); \
|
||||
printk("\n"); \
|
||||
} while (0);
|
||||
|
Reference in New Issue
Block a user