x86/boot: use 'hlt' inside terminal loops
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 29 Apr 2014 13:19:10 +0000 (15:19 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 29 Apr 2014 13:19:10 +0000 (15:19 +0200)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/boot/head.S
xen/arch/x86/boot/x86_64.S

index 0d87b27737c9c8333bc85f08f4651cca0e5ca76f..ca0e97da3b2733c0f7cc56a4ae80a1188bfee8cf 100644 (file)
@@ -54,11 +54,11 @@ print_err:
         mov     $0xB8000,%edi  # VGA framebuffer
 1:      mov     (%esi),%bl
         test    %bl,%bl        # Terminate on '\0' sentinel
-2:      je      2b
+        je      .Lhalt
         mov     $0x3f8+5,%dx   # UART Line Status Register
-3:      in      %dx,%al
+2:      in      %dx,%al
         test    $0x20,%al      # Test THR Empty flag
-        je      3b
+        je      2b
         mov     $0x3f8+0,%dx   # UART Transmit Holding Register
         mov     %bl,%al
         out     %al,%dx        # Send a character over the serial line
@@ -66,6 +66,8 @@ print_err:
         mov     $7,%al
         stosb                  # Write an attribute to the VGA framebuffer
         jmp     1b
+.Lhalt: hlt
+        jmp     .Lhalt
 
 __start:
         cld
index 9652edba66a314cf7afb1deb1baf86b729f9fa06..22645d6cf64ea0e126d992b652d36b88b571e40b 100644 (file)
@@ -73,7 +73,8 @@ ignore_int:
         call    printk
         testq   $0xff8,%rbp
         jnz     0b
-1:      jmp     1b
+1:      hlt
+        jmp     1b
 
         .section .init.rodata, "a", @progbits