x86_64: re-implement ml_halt_cpu() in pure assembly
This commit is contained in:
8
arch/x86_64/cpu_ctrl.S
Normal file
8
arch/x86_64/cpu_ctrl.S
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
.global ml_halt_cpu
|
||||||
|
.type ml_halt_cpu, @function
|
||||||
|
|
||||||
|
ml_halt_cpu:
|
||||||
|
1: cli
|
||||||
|
hlt
|
||||||
|
jmp 1b
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include <arch/gdt.h>
|
#include <arch/gdt.h>
|
||||||
|
|
||||||
#define ml_halt_cpu() asm volatile("cli;hlt")
|
|
||||||
|
|
||||||
typedef struct ml_cpu_block {
|
typedef struct ml_cpu_block {
|
||||||
struct gdt c_gdt;
|
struct gdt c_gdt;
|
||||||
@@ -15,4 +14,7 @@ extern int ml_init_bootcpu(void);
|
|||||||
extern int ml_cpu_block_init(ml_cpu_block *p);
|
extern int ml_cpu_block_init(ml_cpu_block *p);
|
||||||
extern int ml_cpu_block_use(ml_cpu_block *p);
|
extern int ml_cpu_block_use(ml_cpu_block *p);
|
||||||
|
|
||||||
|
/* defined in cpu_ctrl.S */
|
||||||
|
extern void ml_halt_cpu(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user