整理一些乱七八糟的代码
This commit is contained in:
parent
f64ff62b75
commit
622f017b6a
|
@ -116,7 +116,7 @@ typedef void (*memm_free_t)(void *allocator, void *mem);
|
||||||
typedef struct __allocator_t
|
typedef struct __allocator_t
|
||||||
{
|
{
|
||||||
#ifndef MEMM_ALLOCATOR_MAGIC
|
#ifndef MEMM_ALLOCATOR_MAGIC
|
||||||
#define MEMM_ALLOCATOR_MAGIC 0x271fe441
|
#define MEMM_ALLOCATOR_MAGIC ((u32)0x271fe441)
|
||||||
#endif
|
#endif
|
||||||
// 分配器有效性由此检验,不为`MEMM_ALLOCATOR_MAGIC_NUM`说明获得了一个错误的分配器地址。
|
// 分配器有效性由此检验,不为`MEMM_ALLOCATOR_MAGIC_NUM`说明获得了一个错误的分配器地址。
|
||||||
// 此值在编译时通过各种方式确定,若
|
// 此值在编译时通过各种方式确定,若
|
||||||
|
|
|
@ -7,7 +7,7 @@ CC = gcc
|
||||||
CCFLAGS = -m64 -mcmodel=large -I ../../include \
|
CCFLAGS = -m64 -mcmodel=large -I ../../include \
|
||||||
-fno-stack-protector -fno-exceptions \
|
-fno-stack-protector -fno-exceptions \
|
||||||
-fno-builtin -nostdinc -nostdlib \
|
-fno-builtin -nostdinc -nostdlib \
|
||||||
-DMEMM_ALLOCATOR_MAGIC=\"${ALLOCATOR_MAGIC}\"
|
-DMEMM_ALLOCATOR_MAGIC="(u32)(0x${ALLOCATOR_MAGIC})"
|
||||||
ifdef release
|
ifdef release
|
||||||
CCFLAGS := ${CCFLAGS} -O2
|
CCFLAGS := ${CCFLAGS} -O2
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -139,7 +139,7 @@ impl KernelLogger {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
true
|
||||||
};
|
};
|
||||||
while !all_end(&indeces, &logs) {
|
while !all_end(&indeces, &logs) {
|
||||||
let mut min_ind = None;
|
let mut min_ind = None;
|
||||||
|
|
|
@ -206,6 +206,19 @@ impl ToString for Message {
|
||||||
/// .build();
|
/// .build();
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
/// 定义了`message!`宏,简化构造消息的代码:
|
||||||
|
///
|
||||||
|
/// ```rust
|
||||||
|
/// use crate::kernel::tty::tty::BuilderFunctions::*;
|
||||||
|
///
|
||||||
|
/// message!(
|
||||||
|
/// Msg("Hello, "),
|
||||||
|
/// Msg("Metaverse"),
|
||||||
|
/// FgColor(Color::GREEN),
|
||||||
|
/// Msg("!\n"),
|
||||||
|
/// );
|
||||||
|
/// ```
|
||||||
|
///
|
||||||
/// 对于特殊情况可以使用非链式调用:
|
/// 对于特殊情况可以使用非链式调用:
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// let mut msg = MessageBuilder::new();
|
/// let mut msg = MessageBuilder::new();
|
||||||
|
|
Reference in New Issue