能打印了,系统还跑不起来
This commit is contained in:
		| @@ -19,8 +19,8 @@ typedef struct | ||||
|  | ||||
| // 使用这个宏用于初始化 | ||||
| #define extern_device(name_,putc_,getc_,write_,read_)\ | ||||
|   const char __libc_##name_[] __attribute__((section("name"))) = #name_;\ | ||||
|   __attribute__((used)) const libc_device_file __libc_dev_##name_ __attribute__((section("libc_dev")))=\ | ||||
|   const char __libc_##name_[] __attribute__((section(".name"))) = #name_;\ | ||||
|   __attribute__((used,section(".libc_dev"))) const libc_device_file __libc_dev_##name_ =\ | ||||
|   {\ | ||||
|     .name=__libc_##name_,\ | ||||
|     .putc=putc_,\ | ||||
| @@ -32,8 +32,8 @@ typedef struct | ||||
|    | ||||
| // 使用这个宏用于初始化,包括打开关闭函数 | ||||
| #define extern_device2(name_,open_,close_,putc_,getc_,write_,read_)\ | ||||
|   const char __libc_##name_[] __attribute__((section("name"))) = #name_;\ | ||||
|   __attribute__((used)) const libc_device_file __libc_dev_##name_ __attribute__((section("libc_dev")))=\ | ||||
|   const char __libc_##name_[] __attribute__((section(".name"))) = #name_;\ | ||||
|   __attribute__((used,section(".libc_dev"))) const libc_device_file __libc_dev_##name_ =\ | ||||
|   {\ | ||||
|     .name=__libc_##name_,\ | ||||
|     .open=open_,\ | ||||
| @@ -49,7 +49,7 @@ typedef struct | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| const libc_device_file *libc_find_dev(const char *name); | ||||
|  | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user