]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
remove all trailing whitespace
authorfzielcke <fzielcke@localhost>
Wed, 10 Jun 2009 21:04:23 +0000 (21:04 +0000)
committerfzielcke <fzielcke@localhost>
Wed, 10 Jun 2009 21:04:23 +0000 (21:04 +0000)
222 files changed:
Makefile.in
aclocal.m4
boot/i386/pc/boot.S
boot/i386/pc/cdboot.S
boot/i386/pc/diskboot.S
boot/i386/pc/lnxboot.S
boot/i386/pc/pxeboot.S
bus/usb/ohci.c
bus/usb/uhci.c
bus/usb/usb.c
bus/usb/usbtrans.c
commands/acpi.c
commands/blocklist.c
commands/boot.c
commands/cat.c
commands/cmp.c
commands/echo.c
commands/efi/acpi.c
commands/gptsync.c
commands/help.c
commands/i386/pc/acpi.c
commands/i386/pc/drivemap.c
commands/i386/pc/play.c
commands/i386/pc/vbeinfo.c
commands/i386/pc/vbetest.c
commands/loadenv.c
commands/ls.c
commands/parttool.c
commands/search.c
commands/test.c
commands/usbtest.c
conf/i386-pc.rmk
conf/powerpc-ieee1275.rmk
conf/sparc64-ieee1275.rmk
configure.ac
disk/ata.c
disk/efi/efidisk.c
disk/fs_uuid.c
disk/host.c
disk/i386/pc/biosdisk.c
disk/ieee1275/ofdisk.c
disk/loopback.c
disk/lvm.c
disk/memdisk.c
disk/raid.c
disk/scsi.c
disk/usbms.c
docs/grub.texi
docs/texinfo.tex
efiemu/i386/loadcore32.c
efiemu/i386/loadcore64.c
efiemu/i386/pc/cfgtables.c
efiemu/loadcore.c
efiemu/loadcore_common.c
efiemu/main.c
efiemu/mm.c
efiemu/pnvram.c
efiemu/prepare.c
efiemu/runtime/efiemu.S
efiemu/runtime/efiemu.c
efiemu/runtime/efiemu.sh
efiemu/symbols.c
font/font.c
font/font_cmd.c
fs/affs.c
fs/afs.c
fs/cpio.c
fs/ext2.c
fs/fat.c
fs/fshelp.c
fs/hfs.c
fs/hfsplus.c
fs/iso9660.c
fs/jfs.c
fs/minix.c
fs/ntfs.c
fs/reiserfs.c
fs/sfs.c
fs/udf.c
fs/ufs.c
fs/xfs.c
genmk.rb
genmoddep.awk
include/grub/acpi.h
include/grub/autoefi.h
include/grub/datetime.h
include/grub/disk.h
include/grub/efi/api.h
include/grub/efi/memory.h
include/grub/efi/pe32.h
include/grub/efiemu/efiemu.h
include/grub/fs.h
include/grub/hfs.h
include/grub/i386/efiemu.h
include/grub/i386/linux.h
include/grub/i386/pc/biosdisk.h
include/grub/i386/pc/memory.h
include/grub/i386/pc/vbe.h
include/grub/i386/tsc.h
include/grub/i386/xnu.h
include/grub/ieee1275/ieee1275.h
include/grub/lvm.h
include/grub/macho.h
include/grub/machoload.h
include/grub/memory.h
include/grub/multiboot.h
include/grub/multiboot2.h
include/grub/net.h
include/grub/partition.h
include/grub/parttool.h
include/grub/term.h
include/grub/usbdesc.h
include/grub/video.h
include/grub/xnu.h
include/multiboot.h
io/gzio.c
kern/corecmd.c
kern/device.c
kern/disk.c
kern/dl.c
kern/efi/efi.c
kern/efi/init.c
kern/efi/mm.c
kern/env.c
kern/err.c
kern/file.c
kern/fs.c
kern/generic/millisleep.c
kern/generic/rtc_get_time_ms.c
kern/i386/dl.c
kern/i386/ieee1275/init.c
kern/i386/pc/init.c
kern/i386/pc/lzo1x.S
kern/i386/pc/mmap.c
kern/i386/pc/startup.S
kern/i386/realmode.S
kern/i386/tsc.c
kern/ieee1275/ieee1275.c
kern/main.c
kern/misc.c
kern/parser.c
kern/partition.c
kern/powerpc/dl.c
kern/sparc64/dl.c
kern/term.c
lib/envblk.c
lib/i386/setjmp.S
loader/efi/chainloader.c
loader/i386/bsd.c
loader/i386/bsd_helper.S
loader/i386/bsd_pagetable.c
loader/i386/bsd_trampoline.S
loader/i386/efi/linux.c
loader/i386/linux.c
loader/i386/linux_trampoline.S
loader/i386/multiboot.c
loader/i386/multiboot_elfxx.c
loader/i386/multiboot_helper.S
loader/i386/pc/chainloader.c
loader/i386/pc/linux.c
loader/i386/pc/multiboot2.c
loader/i386/pc/xnu.c
loader/i386/xnu.c
loader/i386/xnu_helper.S
loader/macho.c
loader/multiboot_loader.c
loader/powerpc/ieee1275/linux.c
loader/xnu.c
loader/xnu_resume.c
mmap/efi/mmap.c
mmap/i386/mmap.c
mmap/i386/pc/mmap.c
mmap/i386/pc/mmap_helper.S
mmap/i386/uppermem.c
mmap/mmap.c
normal/cmdline.c
normal/completion.c
normal/datetime.c
normal/main.c
normal/menu_entry.c
normal/menu_viewer.c
normal/misc.c
partmap/acorn.c
partmap/amiga.c
partmap/apple.c
partmap/gpt.c
partmap/pc.c
partmap/sun.c
parttool/pcpart.c
script/sh/function.c
script/sh/lexer.c
term/efi/console.c
term/gfxterm.c
term/i386/pc/serial.c
term/i386/pc/vesafb.c
term/i386/pc/vga.c
term/ieee1275/ofconsole.c
term/terminfo.c
term/usb_keyboard.c
util/console.c
util/getroot.c
util/grub-editenv.c
util/grub-emu.c
util/grub-macho2img.c
util/grub-mkconfig.in
util/grub-mkdevicemap.c
util/grub-probe.c
util/grub.d/10_hurd.in
util/grub.d/30_os-prober.in
util/hostdisk.c
util/hostfs.c
util/i386/efi/grub-mkimage.c
util/i386/pc/grub-mkimage.c
util/i386/pc/grub-setup.c
util/lvm.c
util/misc.c
util/raid.c
util/resolve.c
util/usb.c
video/bitmap.c
video/readers/tga.c
video/video.c

index 5a4965a84ca28b069cdb1a5c8c4ba8d7d57b0cf9..3ccb2651831d7478b755e6f3fca026cbcbeb2a6d 100644 (file)
@@ -124,7 +124,7 @@ PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES)
 SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(grub-mkconfig_SCRIPTS)
 
 CLEANFILES =
-MOSTLYCLEANFILES = 
+MOSTLYCLEANFILES =
 DISTCLEANFILES = config.status config.cache config.log config.h \
        Makefile stamp-h include/grub/cpu include/grub/machine \
        gensymlist.sh genkernsyms.sh build_env.mk
index 10e0ca51405f1535eb5cde1775e6fb75538132c5..b421c72a39db57de8849d812bd2f34f3c6ba8914 100644 (file)
@@ -232,7 +232,7 @@ AC_MSG_CHECKING(dnl
 [whether an absolute indirect call/jump must not be prefixed with an asterisk])
 AC_CACHE_VAL(grub_cv_i386_asm_absolute_without_asterisk,
 [cat > conftest.s <<\EOF
-       lcall   *(offset)       
+       lcall   *(offset)
 offset:
        .long   0
        .word   0
index c22dccd793777865480dc6a430d6ac02de10a866..2cd505e6abc62025125e9ea7870f06b91cd1c443 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <grub/boot.h>
 #include <grub/machine/boot.h>
-       
+
 /*
  *  defines for the code go here
  */
@@ -44,7 +44,7 @@
           in real mode. */
        .code16
 
-.globl _start, start; 
+.globl _start, start;
 _start:
 start:
        /*
@@ -70,7 +70,7 @@ start:
        /* scratch space */
 mode:
        .byte   0
-disk_address_packet:   
+disk_address_packet:
 sectors:
        .long   0
 heads:
@@ -91,7 +91,7 @@ cylinder_start:
         * End of BIOS parameter block.
         */
 
-boot_version:  
+boot_version:
        .byte   GRUB_BOOT_VERSION_MAJOR, GRUB_BOOT_VERSION_MINOR
 kernel_address:
        .word   GRUB_BOOT_MACHINE_KERNEL_ADDR
@@ -99,7 +99,7 @@ kernel_segment:
        .word   GRUB_BOOT_MACHINE_KERNEL_SEG
 kernel_sector:
        .long   1, 0
-boot_drive:    
+boot_drive:
        .byte 0xff      /* the disk to load kernel from */
                        /* 0xff means use the boot drive */
 root_drive:
@@ -124,7 +124,7 @@ boot_drive_check:
         jnz     1f
         movb    $0x80, %dl
 1:
-       
+
        /*
         * ljmp to the next instruction because some bogus BIOSes
         * jump to 07C0:0000 instead of 0000:7C00.
@@ -136,7 +136,7 @@ boot_drive_check:
        ljmp    $0, $ABS(real_start)
 #endif
 
-real_start:    
+real_start:
 
        /* set up %ds and %ss as offset from 0 */
        xorw    %ax, %ax
@@ -176,17 +176,17 @@ real_start:
 #else
        movw    $ABS(disk_address_packet), %si
 #endif
-       
+
        /* do not probe LBA if the drive is a floppy */
        testb   $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl
        jz      chs_mode
-                       
+
        /* check if LBA is supported */
        movb    $0x41, %ah
        movw    $0x55aa, %bx
        int     $0x13
 
-       /* 
+       /*
         *  %dl may have been clobbered by INT 13, AH=41H.
         *  This happens, for example, with AST BIOS 1.04.
         */
@@ -200,15 +200,15 @@ real_start:
 
        andw    $1, %cx
        jz      chs_mode
-       
+
 lba_mode:
        xorw    %ax, %ax
        movw    %ax, 4(%si)
 
-       incw    %ax     
+       incw    %ax
        /* set the mode to non-zero */
        movb    %al, -1(%si)
-       
+
        /* the blocks */
        movw    %ax, 2(%si)
 
@@ -249,8 +249,8 @@ lba_mode:
 
        movw    $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx
        jmp     copy_buffer
-               
-chs_mode:      
+
+chs_mode:
        /*
         *  Determine the hard disk geometry from the BIOS!
         *  We do this first, so that LS-120 IDE floppies work correctly.
@@ -272,7 +272,7 @@ final_init:
        /* set the mode to zero */
        movzbl  %dh, %eax
        movb    %ah, -1(%si)
-       
+
        /* save number of heads */
        incw    %ax
        movl    %eax, 4(%si)
@@ -303,7 +303,7 @@ setup_sectors:
 
        orl     %eax, %eax
        jnz     geometry_error
-       
+
        /* load logical sector start (bottom half) */
 #ifdef APPLE_CC
        movl    (kernel_sector_abs), %eax
@@ -371,7 +371,7 @@ setup_sectors:
        jc      read_error
 
        movw    %es, %bx
-       
+
 copy_buffer:
 #ifdef APPLE_CC
        kernel_segment_abs = ABS (kernel_segment)
@@ -386,14 +386,14 @@ copy_buffer:
         */
        pusha
        pushw   %ds
-       
+
        movw    $0x100, %cx
        movw    %bx, %ds
        xorw    %si, %si
        xorw    %di, %di
-       
+
        cld
-       
+
        rep
        movsw
 
@@ -472,7 +472,7 @@ message:
         */
 
        . = _start + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC
-nt_magic:      
+nt_magic:
        .long 0
        .word 0
 
@@ -482,7 +482,7 @@ nt_magic:
         *  sneaky, huh?
         */
 
-part_start:    
+part_start:
        . = _start + GRUB_BOOT_MACHINE_PART_START
 
 probe_values:
index b32f82ce82f813fa661e2f2affa4eb818c7597ae..688b26c7d01acf32283df338a2208ca8c55a4f91 100644 (file)
@@ -88,7 +88,7 @@ bi_reserved:
 
         /* Root drive will default to boot drive */
         movb    $0xFF, %dh
-        
+
        ljmp    $(DATA_ADDR >> 4), $0
 
 /*
index f29ddaa155a6813347090b5b8df431743195a084..1e817df27598f7dc0c31ed5020579bdaa16c14fa 100644 (file)
@@ -17,7 +17,7 @@
  */
 
 #include <grub/machine/boot.h>
-       
+
 /*
  *  defines for the code go here
  */
@@ -26,7 +26,7 @@
           This makes the assembler generate the address without support
           from the linker. (ELF can't relocate 16-bit addresses!) */
 #define ABS(x) (x-_start+GRUB_BOOT_MACHINE_KERNEL_ADDR)
-       
+
        /* Print message string */
 #ifdef APPLE_CC
 #define MSG(x) x ## _abs = ABS(x); mov $x ## _abs, %esi; call message
 
        .globl  start, _start
 start:
-_start:        
+_start:
        /*
         * _start is loaded at 0x2000 and is jumped to with
         * CS:IP 0:0x2000 in kernel.
         */
 
-       /* 
+       /*
         * we continue to use the stack for boot.img and assume that
         * some registers are set to correct values. See boot.S
         * for more information.
         */
-       
+
        /* save drive reference first thing! */
        pushw   %dx
 
@@ -63,7 +63,7 @@ _start:
        pushw   %si
        MSG(notification_string)
        popw    %si
-       
+
        /* this sets up for the first run through "bootloop" */
 #ifdef APPLE_CC
        firstlist_off_abs = ABS (firstlist - GRUB_BOOT_MACHINE_LIST_SIZE)
@@ -84,14 +84,14 @@ bootloop:
        /* if zero, go to the start function */
        je      bootit
 
-setup_sectors: 
+setup_sectors:
        /* check if we use LBA or CHS */
        cmpb    $0, -1(%si)
 
        /* jump to chs_mode if zero */
        je      chs_mode
 
-lba_mode:      
+lba_mode:
        /* load logical sector start */
        movl    (%di), %ebx
        movl    4(%di), %ecx
@@ -109,7 +109,7 @@ lba_mode:
        /* if less than, set to total */
        movw    8(%di), %ax
 
-1:     
+1:
        /* subtract from total */
        subw    %ax, 8(%di)
 
@@ -154,8 +154,8 @@ lba_mode:
 
        movw    $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx
        jmp     copy_buffer
-                       
-chs_mode:      
+
+chs_mode:
        /* load logical sector start (top half) */
        movl    4(%di), %eax
        orl     %eax, %eax
@@ -202,7 +202,7 @@ chs_mode:
        /* if less than, set to total */
        movw    8(%di), %ax
 
-2:     
+2:
        /* subtract from total */
        subw    %ax, 8(%di)
 
@@ -258,8 +258,8 @@ chs_mode:
 
        /* save source segment */
        movw    %es, %bx
-       
-copy_buffer:   
+
+copy_buffer:
 
        /* load addresses for copy from disk buffer to destination */
        movw    10(%di), %es    /* load destination segment */
@@ -291,7 +291,7 @@ copy_buffer:
        rep             /* sets a repeat */
        movsw           /* this runs the actual copy */
 
-       /* restore addressing regs and print a dot with correct DS 
+       /* restore addressing regs and print a dot with correct DS
           (MSG modifies SI, which is saved, and unused AX and BX) */
        popw    %ds
        MSG(notification_step)
@@ -339,7 +339,7 @@ notification_string:        .asciz "loading"
 
 notification_step:     .asciz "."
 notification_done:     .asciz "\r\n"
-       
+
 geometry_error_string: .asciz "Geom"
 read_error_string:     .asciz "Read"
 general_error_string:  .asciz " Error"
@@ -379,7 +379,7 @@ lastlist:
        .word 0
 
        . = _start + 0x200 - GRUB_BOOT_MACHINE_LIST_SIZE
-       
+
         /* fill the first data listing with the default */
 blocklist_default_start:
        /* this is the sector start parameter, in logical sectors from
@@ -392,5 +392,5 @@ blocklist_default_len:
 blocklist_default_seg:
        /* this is the segment of the starting address to load the data into */
        .word (GRUB_BOOT_MACHINE_KERNEL_SEG + 0x20)
-       
+
 firstlist:     /* this label has to be after the list data!!! */
index f244feccfee41e05ba001cc6be4afc12ad0bf529..14bd0415e049a654950850738c9a80767acf02d5 100644 (file)
@@ -24,7 +24,7 @@
 #include <multiboot.h>
 
         .file   "lnxboot.S"
-               
+
 #ifdef APPLE_CC
 #error Building lnxboot.img with Apple's as results in an unusable image
 #endif
@@ -50,7 +50,7 @@ data_start:
        . = data_start + 0x1F1
 
 setup_sects:
-/* Apple's cc can't fill this value.  */ 
+/* Apple's cc can't fill this value.  */
 #ifdef APPLE_CC
        .byte   0
 #else
@@ -135,8 +135,8 @@ data_leng:
 linux_init:
 
 #ifdef APPLE_CC
-       reg_edx_rel = reg_edx - start 
-       code32_start_rel = code32_start - start 
+       reg_edx_rel = reg_edx - start
+       code32_start_rel = code32_start - start
        movw    %cs:(reg_edx_rel), %dx
        movl    %cs:(code32_start_rel), %ebp
 #else
index b62c1447b85bf719fc1bff62ef2fd384e1afae5b..1b51127f64a49184bfd07299a52de6981c3c21c5 100644 (file)
 
        /* Start with the prehistoric environment... */
        .code16
-       
+
        /* Let's go */
-.globl start, _start; 
+.globl start, _start;
 _start:
-start: 
+start:
 
         /* Root drive will default to boot drive */
         movb   $0xFF, %dh
         movb   $0x7F, %dl
-        
+
        /* Jump to the real world */
        ljmp    $0, $0x8200
 
index 53356dc6925b28f8f4200dfd7d3e8e5476731365..32fb7cf91875d6d7d200502d8c1d0a9f82487267 100644 (file)
@@ -180,13 +180,13 @@ grub_ohci_pci_iter (int bus, int device, int func,
   /* Setup the HCCA.  */
   grub_ohci_writereg32 (o, GRUB_OHCI_REG_HCCA, (grub_uint32_t) o->hcca);
   grub_dprintf ("ohci", "OHCI HCCA\n");
+
   /* Enable the OHCI.  */
   grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROL,
                        (2 << 6));
   grub_dprintf ("ohci", "OHCI enable: 0x%02x\n",
                (grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL) >> 6) & 3);
+
   /* Link to ohci now that initialisation is successful.  */
   o->next = ohci;
   ohci = o;
@@ -227,7 +227,7 @@ grub_ohci_iterate (int (*hook) (grub_usb_controller_t dev))
 }
 
 static void
-grub_ohci_transaction (grub_ohci_td_t td, 
+grub_ohci_transaction (grub_ohci_td_t td,
                       grub_transfer_type_t type, unsigned int toggle,
                       grub_size_t size, char *data)
 {
@@ -305,7 +305,7 @@ grub_ohci_transfer (grub_usb_controller_t dev,
       grub_usb_transaction_t tr = &transfer->transactions[i];
 
       grub_ohci_transaction (&td_list[i], tr->pid, tr->toggle,
-                            tr->size, tr->data); 
+                            tr->size, tr->data);
 
       td_list[i].next_td = grub_cpu_to_le32 (&td_list[i + 1]);
     }
@@ -607,5 +607,5 @@ GRUB_MOD_INIT(ohci)
 
 GRUB_MOD_FINI(ohci)
 {
-  grub_usb_controller_dev_unregister (&usb_controller);  
+  grub_usb_controller_dev_unregister (&usb_controller);
 }
index 1c7b8d965e7b4d89ee11d28f79aaa0390c2ecfe6..84cd48dafb733bfd4d2094fe7a473d45614e4964 100644 (file)
@@ -450,7 +450,7 @@ grub_uhci_transfer (grub_usb_controller_t dev,
 
       td = grub_uhci_transaction (u, transfer->endpoint, tr->pid,
                                  transfer->devaddr, tr->toggle,
-                                 tr->size, tr->data); 
+                                 tr->size, tr->data);
       if (! td)
        {
          /* Terminate and free.  */
@@ -517,7 +517,7 @@ grub_uhci_transfer (grub_usb_controller_t dev,
          /* Check if a babble error occurred.  */
          if (errtd->ctrl_status & (1 << 20))
            err = GRUB_USB_ERR_BABBLE;
+
          /* Check if a NAK occurred.  */
          if (errtd->ctrl_status & (1 << 19))
            err = GRUB_USB_ERR_NAK;
index a30598f006a9ec598576ff2c15349d18035aca26..310b8cc6a97564bfa2758f292c3034f6beff6cec 100644 (file)
@@ -236,7 +236,7 @@ grub_usb_device_initialize (grub_usb_device_t dev)
 
       /* Skip the configuration descriptor.  */
       pos = sizeof (struct grub_usb_desc_config);
-      
+
       /* Read all interfaces.  */
       for (currif = 0; currif < dev->config[i].descconf->numif; currif++)
        {
index fd8295741fda5347f0e6db2436a875b6280a2c51..e4beb4550173baa11e48f9df5da1e62fb43474b6 100644 (file)
@@ -54,7 +54,7 @@ grub_usb_control_msg (grub_usb_device_t dev,
     max = 64;
 
   datablocks = (size + max - 1) / max;
-  
+
   /* XXX: Discriminate between different types of control
      messages.  */
   transfer->transcnt = datablocks + 2;
@@ -110,7 +110,7 @@ grub_usb_control_msg (grub_usb_device_t dev,
     transfer->transactions[datablocks + 1].pid = GRUB_USB_TRANSFER_TYPE_OUT;
   else
     transfer->transactions[datablocks + 1].pid = GRUB_USB_TRANSFER_TYPE_IN;
-  
+
   transfer->transactions[datablocks + 1].toggle = 1;
 
   err = dev->controller.dev->transfer (&dev->controller, transfer);
@@ -184,7 +184,7 @@ grub_usb_bulk_readwrite (grub_usb_device_t dev,
       tr->data = &data[i * max];
       size -= tr->size;
     }
+
   err = dev->controller.dev->transfer (&dev->controller, transfer);
   grub_dprintf ("usb", "toggle=%d\n", toggle);
   dev->toggle[endpoint] = toggle;
index d6dce376a370f4b37a3fb0f4da3dd42535f011cf..d903d446daaa644df2a82e1259b06882e030282d 100644 (file)
 #endif
 
 static const struct grub_arg_option options[] = {
-  {"exclude", 'x', 0, 
-   "Don't load host tables specified by comma-separated list", 
+  {"exclude", 'x', 0,
+   "Don't load host tables specified by comma-separated list",
    0, ARG_TYPE_STRING},
-  {"load-only", 'n', 0, 
+  {"load-only", 'n', 0,
    "Load only tables specified by comma-separated list", 0, ARG_TYPE_STRING},
   {"v1", '1', 0, "Expose v1 tables", 0, ARG_TYPE_NONE},
   {"v2", '2', 0, "Expose v2 and v3 tables", 0, ARG_TYPE_NONE},
   {"oemid", 'o', 0, "Set OEMID of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING},
-  {"oemtable", 't', 0, 
-   "Set OEMTABLE ID of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING},  
-  {"oemtablerev", 'r', 0, 
-   "Set OEMTABLE revision of RSDP, XSDT and RSDT", 0, ARG_TYPE_INT},  
-  {"oemtablecreator", 'c', 0, 
-   "Set creator field of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING},  
-  {"oemtablecreatorrev", 'd', 0, 
-   "Set creator revision of RSDP, XSDT and RSDT", 0, ARG_TYPE_INT},  
+  {"oemtable", 't', 0,
+   "Set OEMTABLE ID of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING},
+  {"oemtablerev", 'r', 0,
+   "Set OEMTABLE revision of RSDP, XSDT and RSDT", 0, ARG_TYPE_INT},
+  {"oemtablecreator", 'c', 0,
+   "Set creator field of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING},
+  {"oemtablecreatorrev", 'd', 0,
+   "Set creator revision of RSDP, XSDT and RSDT", 0, ARG_TYPE_INT},
   {"no-ebda", 'e', 0, "Don't update EBDA. May fix failures or hangs on some"
    " BIOSes but makes it ineffective with OS not receiving RSDP from GRUB",
    0, ARG_TYPE_NONE},
@@ -59,7 +59,7 @@ static const struct grub_arg_option options[] = {
 };
 
 /* Simple checksum by summing all bytes. Used by ACPI and SMBIOS. */
-grub_uint8_t 
+grub_uint8_t
 grub_byte_checksum (void *base, grub_size_t size)
 {
   grub_uint8_t *ptr;
@@ -70,7 +70,7 @@ grub_byte_checksum (void *base, grub_size_t size)
   return ret;
 }
 
-/* rev1 is 1 if ACPIv1 is to be generated, 0 otherwise. 
+/* rev1 is 1 if ACPIv1 is to be generated, 0 otherwise.
    rev2 contains the revision of ACPIv2+ to generate or 0 if none. */
 static int rev1, rev2;
 /* OEMID of RSDP, RSDT and XSDT. */
@@ -128,7 +128,7 @@ grub_acpi_get_rsdpv1 (void)
   return grub_machine_acpi_get_rsdpv1 ();
 }
 
-static inline int 
+static inline int
 iszero (grub_uint8_t *reg, int size)
 {
   int i;
@@ -138,7 +138,7 @@ iszero (grub_uint8_t *reg, int size)
   return 1;
 }
 
-grub_err_t 
+grub_err_t
 grub_acpi_create_ebda (void)
 {
   int ebda_kb_len;
@@ -149,9 +149,9 @@ grub_acpi_create_ebda (void)
   grub_uint8_t *targetebda, *target;
   struct grub_acpi_rsdp_v10 *v1;
   struct grub_acpi_rsdp_v20 *v2;
-  auto int NESTED_FUNC_ATTR find_hook (grub_uint64_t, grub_uint64_t, 
+  auto int NESTED_FUNC_ATTR find_hook (grub_uint64_t, grub_uint64_t,
                                       grub_uint32_t);
-  int NESTED_FUNC_ATTR find_hook (grub_uint64_t start, grub_uint64_t size, 
+  int NESTED_FUNC_ATTR find_hook (grub_uint64_t start, grub_uint64_t size,
                                  grub_uint32_t type)
   {
     grub_uint64_t end = start + size;
@@ -164,7 +164,7 @@ grub_acpi_create_ebda (void)
       highestlow = (end - ebda_len) & (~0xf);
     return 0;
   }
-  
+
   ebda = (grub_uint8_t *) UINT_TO_PTR ((*((grub_uint16_t *)0x40e)) << 4);
   ebda_kb_len = *(grub_uint16_t *) ebda;
   if (! ebda || ebda_kb_len > 16)
@@ -177,10 +177,10 @@ grub_acpi_create_ebda (void)
   grub_dprintf ("acpi", "creating ebda @%llx\n",
                (unsigned long long) highestlow);
   if (! highestlow)
-    return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+    return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                       "couldn't find space for the new EBDA");
 
-  mmapregion = grub_mmap_register (PTR_TO_UINT64 (targetebda), ebda_len, 
+  mmapregion = grub_mmap_register (PTR_TO_UINT64 (targetebda), ebda_len,
                                   GRUB_MACHINE_MEMORY_RESERVED);
   if (! mmapregion)
     return grub_errno;
@@ -198,13 +198,13 @@ grub_acpi_create_ebda (void)
   if (v2 && v2->length > 40)
     v2 = 0;
 
-  /* First try to replace already existing rsdp. */ 
+  /* First try to replace already existing rsdp. */
   if (v2)
     {
       grub_dprintf ("acpi", "Scanning EBDA for old rsdpv2\n");
       for (; target < targetebda + 0x400 - v2->length; target += 0x10)
        if (grub_memcmp (target, "RSD PTR ", 8) == 0
-           && grub_byte_checksum (target, 
+           && grub_byte_checksum (target,
                                   sizeof (struct grub_acpi_rsdp_v10)) == 0
            && ((struct grub_acpi_rsdp_v10 *) target)->revision != 0
            && ((struct grub_acpi_rsdp_v20 *) target)->length <= v2->length)
@@ -222,10 +222,10 @@ grub_acpi_create_ebda (void)
   if (v1)
     {
       grub_dprintf ("acpi", "Scanning EBDA for old rsdpv1\n");
-      for (; target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); 
+      for (; target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10);
           target += 0x10)
        if (grub_memcmp (target, "RSD PTR ", 8) == 0
-           && grub_byte_checksum (target, 
+           && grub_byte_checksum (target,
                                   sizeof (struct grub_acpi_rsdp_v10)) == 0)
          {
            grub_memcpy (target, v1, sizeof (struct grub_acpi_rsdp_v10));
@@ -260,7 +260,7 @@ grub_acpi_create_ebda (void)
   if (v1)
     {
       grub_dprintf ("acpi", "Scanning EBDA for block of zeros\n");
-      for (; target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); 
+      for (; target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10);
           target += 0x10)
        if (iszero (target, sizeof (struct grub_acpi_rsdp_v10)))
          {
@@ -277,16 +277,16 @@ grub_acpi_create_ebda (void)
   if (v1 || v2)
     {
       grub_mmap_unregister (mmapregion);
-      return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+      return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                         "Couldn't find suitable spot in EBDA");
     }
 
   /* Remove any other RSDT. */
-  for (target = targetebda; 
-       target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); 
+  for (target = targetebda;
+       target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10);
        target += 0x10)
     if (grub_memcmp (target, "RSD PTR ", 8) == 0
-       && grub_byte_checksum (target, 
+       && grub_byte_checksum (target,
                               sizeof (struct grub_acpi_rsdp_v10)) == 0
        && target != v1inebda && target != v2inebda)
       *target = 0;
@@ -312,7 +312,7 @@ setup_common_tables (void)
   grub_free (table_dsdt);
   table_dsdt = playground_ptr;
   playground_ptr += dsdt_size;
-  
+
   /* Treat other tables. */
   for (cur = acpi_tables; cur; cur = cur->next)
     {
@@ -342,7 +342,7 @@ setup_common_tables (void)
          fadt->hdr.checksum = 1 + ~grub_byte_checksum (fadt, fadt->hdr.length);
        }
     }
+
   /* Fill RSDT entries. */
   numoftables = 0;
   for (cur = acpi_tables; cur; cur = cur->next)
@@ -365,7 +365,7 @@ setup_common_tables (void)
 
   for (cur = acpi_tables; cur; cur = cur->next)
     *(rsdt_entry++) = PTR_TO_UINT32 (cur->addr);
-  
+
   /* Recompute checksum. */
   rsdt->checksum = 0;
   rsdt->checksum = 1 + ~grub_byte_checksum (rsdt, rsdt->length);
@@ -383,8 +383,8 @@ setv1table (void)
   rsdpv1_new->revision = 0;
   rsdpv1_new->rsdt_addr = PTR_TO_UINT32 (rsdt_addr);
   rsdpv1_new->checksum = 0;
-  rsdpv1_new->checksum = 1 + ~grub_byte_checksum (rsdpv1_new, 
-                                                 sizeof (*rsdpv1_new));  
+  rsdpv1_new->checksum = 1 + ~grub_byte_checksum (rsdpv1_new,
+                                                 sizeof (*rsdpv1_new));
   grub_dprintf ("acpi", "Generated ACPIv1 tables\n");
 }
 
@@ -421,19 +421,19 @@ setv2table (void)
   /* Create RSDPv2. */
   rsdpv2_new = (struct grub_acpi_rsdp_v20 *) playground_ptr;
   playground_ptr += sizeof (struct grub_acpi_rsdp_v20);
-  grub_memcpy (&(rsdpv2_new->rsdpv1.signature), "RSD PTR ", 
+  grub_memcpy (&(rsdpv2_new->rsdpv1.signature), "RSD PTR ",
               sizeof (rsdpv2_new->rsdpv1.signature));
-  grub_memcpy (&(rsdpv2_new->rsdpv1.oemid), root_oemid, 
+  grub_memcpy (&(rsdpv2_new->rsdpv1.oemid), root_oemid,
               sizeof (rsdpv2_new->rsdpv1.oemid));
   rsdpv2_new->rsdpv1.revision = rev2;
   rsdpv2_new->rsdpv1.rsdt_addr = PTR_TO_UINT32 (rsdt_addr);
   rsdpv2_new->rsdpv1.checksum = 0;
-  rsdpv2_new->rsdpv1.checksum = 1 + ~grub_byte_checksum 
+  rsdpv2_new->rsdpv1.checksum = 1 + ~grub_byte_checksum
     (&(rsdpv2_new->rsdpv1), sizeof (rsdpv2_new->rsdpv1));
   rsdpv2_new->length = sizeof (*rsdpv2_new);
   rsdpv2_new->xsdt_addr = PTR_TO_UINT64 (xsdt);
   rsdpv2_new->checksum = 0;
-  rsdpv2_new->checksum = 1 + ~grub_byte_checksum (rsdpv2_new, 
+  rsdpv2_new->checksum = 1 + ~grub_byte_checksum (rsdpv2_new,
                                                  rsdpv2_new->length);
   grub_dprintf ("acpi", "Generated ACPIv2 tables\n");
 }
@@ -465,7 +465,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
   grub_err_t err;
   int i, mmapregion;
   int numoftables;
-  
+
   /* Default values if no RSDP is found. */
   rev1 = 1;
   rev2 = 3;
@@ -473,7 +473,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
   facs_addr = 0;
   playground = playground_ptr = 0;
   playground_size = 0;
-  
+
   rsdp = (struct grub_acpi_rsdp_v10 *) grub_machine_acpi_get_rsdpv2 ();
 
   if (! rsdp)
@@ -508,37 +508,37 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
       rsdt = (struct grub_acpi_table_header *) UINT_TO_PTR (rsdp->rsdt_addr);
       /* Load host tables. */
       for (entry_ptr = (grub_uint32_t *) (rsdt + 1);
-          entry_ptr < (grub_uint32_t *) (((grub_uint8_t *) rsdt) 
+          entry_ptr < (grub_uint32_t *) (((grub_uint8_t *) rsdt)
                                          + rsdt->length);
           entry_ptr++)
        {
          char signature[5];
          struct efiemu_acpi_table *table;
-         struct grub_acpi_table_header *curtable 
+         struct grub_acpi_table_header *curtable
            = (struct grub_acpi_table_header *) UINT_TO_PTR (*entry_ptr);
          signature[4] = 0;
          for (i = 0; i < 4;i++)
            signature[i] = grub_tolower (curtable->signature[i]);
-         
+
          /* If it's FADT it contains addresses of DSDT and FACS. */
          if (grub_strcmp (signature, "facp") == 0)
            {
              struct grub_acpi_table_header *dsdt;
              struct grub_acpi_fadt *fadt = (struct grub_acpi_fadt *) curtable;
 
-             /* Set root header variables to the same values 
+             /* Set root header variables to the same values
                 as FACP by default. */
-             grub_memcpy (&root_oemid, &(fadt->hdr.oemid), 
+             grub_memcpy (&root_oemid, &(fadt->hdr.oemid),
                           sizeof (root_oemid));
-             grub_memcpy (&root_oemtable, &(fadt->hdr.oemtable), 
+             grub_memcpy (&root_oemtable, &(fadt->hdr.oemtable),
                           sizeof (root_oemtable));
              root_oemrev = fadt->hdr.oemrev;
-             grub_memcpy (&root_creator_id, &(fadt->hdr.creator_id), 
+             grub_memcpy (&root_creator_id, &(fadt->hdr.creator_id),
                           sizeof (root_creator_id));
              root_creator_rev = fadt->hdr.creator_rev;
 
              /* Load DSDT if not excluded. */
-             dsdt = (struct grub_acpi_table_header *) 
+             dsdt = (struct grub_acpi_table_header *)
                UINT_TO_PTR (fadt->dsdt_addr);
              if (dsdt && (! exclude || ! grub_strword (exclude, "dsdt"))
                  && (! load_only || grub_strword (load_only, "dsdt"))
@@ -551,7 +551,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
                      free_tables ();
                      grub_free (exclude);
                      grub_free (load_only);
-                     return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+                     return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                                         "Could allocate table");
                    }
                  grub_memcpy (table_dsdt, dsdt, dsdt->length);
@@ -560,7 +560,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
              /* Save FACS address. FACS shouldn't be overridden. */
              facs_addr = fadt->facs_addr;
            }
-  
+
          /* Skip excluded tables. */
          if (exclude && grub_strword (exclude, signature))
            continue;
@@ -570,15 +570,15 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
          /* Sanity check. */
          if (curtable->length < sizeof (*curtable))
            continue;
-         
-         table = (struct efiemu_acpi_table *) grub_malloc 
+
+         table = (struct efiemu_acpi_table *) grub_malloc
            (sizeof (struct efiemu_acpi_table));
          if (! table)
            {
              free_tables ();
              grub_free (exclude);
              grub_free (load_only);
-             return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+             return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                                 "Could allocate table structure");
            }
          table->size = curtable->length;
@@ -587,7 +587,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
          if (! table->addr)
            {
              free_tables ();
-             return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+             return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                                 "Could allocate table");
            }
          table->next = acpi_tables;
@@ -595,7 +595,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
          grub_memcpy (table->addr, curtable, table->size);
        }
       grub_free (exclude);
-      grub_free (load_only);      
+      grub_free (load_only);
     }
 
   /* Does user specify versions to generate? */
@@ -647,7 +647,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
        {
          grub_file_close (file);
          free_tables ();
-         return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+         return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                             "couldn't read file %s", args[i]);
        }
 
@@ -657,9 +657,9 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
          free_tables ();
          return grub_error (GRUB_ERR_BAD_OS, "couldn't read file %s", args[i]);
        }
-      grub_file_close (file);      
+      grub_file_close (file);
 
-      if (grub_memcmp (((struct grub_acpi_table_header *) buf)->signature, 
+      if (grub_memcmp (((struct grub_acpi_table_header *) buf)->signature,
                       "DSDT", 4) == 0)
        {
          grub_free (table_dsdt);
@@ -669,12 +669,12 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
       else
        {
          struct efiemu_acpi_table *table;
-         table = (struct efiemu_acpi_table *) grub_malloc 
+         table = (struct efiemu_acpi_table *) grub_malloc
            (sizeof (struct efiemu_acpi_table));
          if (! table)
            {
              free_tables ();
-             return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+             return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                                 "Could allocate table structure");
            }
 
@@ -698,15 +698,15 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
   playground_size += sizeof (struct grub_acpi_table_header) + 8 * numoftables;
   /* RSDPv2. */
   playground_size += sizeof (struct grub_acpi_rsdp_v20);
-  
-  playground = playground_ptr 
+
+  playground = playground_ptr
     = grub_mmap_malign_and_register (1, playground_size, &mmapregion,
                                     GRUB_MACHINE_MEMORY_ACPI, 0);
 
   if (! playground)
     {
       free_tables ();
-      return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+      return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                         "Couldn't allocate space for ACPI tables");
     }
 
@@ -741,9 +741,9 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
     struct grub_efi_guid acpi = GRUB_EFI_ACPI_TABLE_GUID;
     struct grub_efi_guid acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID;
 
-    grub_efi_system_table->boot_services->install_configuration_table 
+    grub_efi_system_table->boot_services->install_configuration_table
       (&acpi20, grub_acpi_get_rsdpv2 ());
-    grub_efi_system_table->boot_services->install_configuration_table 
+    grub_efi_system_table->boot_services->install_configuration_table
       (&acpi, grub_acpi_get_rsdpv1 ());
   }
 #endif
@@ -755,13 +755,13 @@ static grub_extcmd_t cmd;
 
 GRUB_MOD_INIT(acpi)
 {
-  cmd = grub_register_extcmd ("acpi", grub_cmd_acpi, 
+  cmd = grub_register_extcmd ("acpi", grub_cmd_acpi,
                              GRUB_COMMAND_FLAG_BOTH,
                              "acpi [-1|-2] [--exclude=table1,table2|"
                              "--load-only=table1,table2] filename1 "
                              " [filename2] [...]",
                              "Load host acpi tables and tables "
-                             "specified by arguments", 
+                             "specified by arguments",
                              options);
 }
 
index 2057291afd512fa7217f1d0d40a60f1ec3607afa..b457b7c3958bd7863067c2d0be8f9332e3ad3329 100644 (file)
@@ -39,7 +39,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)),
                            unsigned length);
   auto void NESTED_FUNC_ATTR print_blocklist (grub_disk_addr_t sector, unsigned num,
                             unsigned offset, unsigned length);
-  
+
   void NESTED_FUNC_ATTR read_blocklist (grub_disk_addr_t sector, unsigned offset,
                       unsigned length)
     {
@@ -51,7 +51,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)),
              num_sectors++;
              return;
            }
-         
+
          print_blocklist (start_sector, num_sectors, 0, 0);
          num_sectors = 0;
        }
@@ -64,7 +64,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)),
       else
        print_blocklist (sector, 0, offset, length);
     }
-  
+
   void NESTED_FUNC_ATTR print_blocklist (grub_disk_addr_t sector, unsigned num,
                        unsigned offset, unsigned length)
     {
@@ -77,7 +77,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)),
       if (offset != 0 || length != 0)
        grub_printf ("[%u-%u]", offset, offset + length);
     }
-  
+
   if (argc < 1)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified");
 
@@ -91,7 +91,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)),
 
   if (file->device->disk->partition)
     part_start = grub_partition_get_start (file->device->disk->partition);
-  
+
   file->read_hook = read_blocklist;
 
   while (grub_file_read (file, buf, sizeof (buf)) > 0)
@@ -99,7 +99,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)),
 
   if (num_sectors > 0)
     print_blocklist (start_sector, num_sectors, 0, 0);
-  
+
   grub_file_close (file);
 
   return grub_errno;
index 40ee9f8c48175379c89cf6f3bbc2c3a11874f18a..e77b5ceb86a4abd58ee24720f12325e68275a410 100644 (file)
@@ -38,7 +38,7 @@ struct grub_preboot_t
 };
 
 static int grub_loader_loaded;
-static struct grub_preboot_t *preboots_head = 0, 
+static struct grub_preboot_t *preboots_head = 0,
   *preboots_tail = 0;
 
 int
@@ -58,7 +58,7 @@ grub_loader_register_preboot_hook (grub_err_t (*preboot_func) (int noreturn),
   if (! preboot_func && ! preboot_rest_func)
     return 0;
 
-  new_preboot = (struct grub_preboot_t *) 
+  new_preboot = (struct grub_preboot_t *)
     grub_malloc (sizeof (struct grub_preboot_t));
   if (! new_preboot)
     {
@@ -92,7 +92,7 @@ grub_loader_register_preboot_hook (grub_err_t (*preboot_func) (int noreturn),
   return new_preboot;
 }
 
-void 
+void
 grub_loader_unregister_preboot_hook (void *hnd)
 {
   struct grub_preboot_t *preb = hnd;
@@ -116,11 +116,11 @@ grub_loader_set (grub_err_t (*boot) (void),
 {
   if (grub_loader_loaded && grub_loader_unload_func)
     grub_loader_unload_func ();
-  
+
   grub_loader_boot_func = boot;
   grub_loader_unload_func = unload;
   grub_loader_noreturn = noreturn;
-  
+
   grub_loader_loaded = 1;
 }
 
@@ -129,7 +129,7 @@ grub_loader_unset(void)
 {
   if (grub_loader_loaded && grub_loader_unload_func)
     grub_loader_unload_func ();
-  
+
   grub_loader_boot_func = 0;
   grub_loader_unload_func = 0;
 
@@ -161,7 +161,7 @@ grub_loader_boot (void)
   err = (grub_loader_boot_func) ();
 
   for (cur = preboots_tail; cur; cur = cur->prev)
-    if (! err) 
+    if (! err)
       err = cur->preboot_rest_func ();
     else
       cur->preboot_rest_func ();
index f2d5f1c1af3f9f6a360553cd64081423e3d6dc07..1a23743608c5bfeaac9948b8f5499657d0769bfb 100644 (file)
@@ -41,16 +41,16 @@ grub_cmd_cat (grub_command_t cmd __attribute__ ((unused)),
   file = grub_gzfile_open (args[0], 1);
   if (! file)
     return 0;
-  
+
   while ((size = grub_file_read (file, buf, sizeof (buf))) > 0
         && key != GRUB_TERM_ESC)
     {
       int i;
-      
+
       for (i = 0; i < size; i++)
        {
          unsigned char c = buf[i];
-         
+
          if ((grub_isprint (c) || grub_isspace (c)) && c != '\r')
            grub_putchar (c);
          else
@@ -69,7 +69,7 @@ grub_cmd_cat (grub_command_t cmd __attribute__ ((unused)),
   grub_putchar ('\n');
   grub_refresh ();
   grub_file_close (file);
-  
+
   return 0;
 }
 
index b5d4f8dacbd4a1cf695f187b4e088f30fe59403e..1258b1d63c99ad65efda26764b4538aea2b9991b 100644 (file)
@@ -49,7 +49,7 @@ grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)),
     goto cleanup;
 
   if (grub_file_size (file1) != grub_file_size (file2))
-    grub_printf ("Differ in size: %llu [%s], %llu [%s]\n", 
+    grub_printf ("Differ in size: %llu [%s], %llu [%s]\n",
                 (unsigned long long) grub_file_size (file1), args[0],
                 (unsigned long long) grub_file_size (file2), args[1]);
   else
@@ -58,14 +58,14 @@ grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)),
 
       buf1 = grub_malloc (BUFFER_SIZE);
       buf2 = grub_malloc (BUFFER_SIZE);
-      
+
       if (! buf1 || ! buf2)
         goto cleanup;
-      
+
       do
        {
          int i;
-         
+
          rd1 = grub_file_read (file1, buf1, BUFFER_SIZE);
          rd2 = grub_file_read (file2, buf2, BUFFER_SIZE);
 
@@ -83,15 +83,15 @@ grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)),
                }
            }
          pos += BUFFER_SIZE;
-         
+
        }
       while (rd2);
-      
+
       grub_printf ("The files are identical.\n");
     }
 
 cleanup:
-  
+
   if (buf1)
     grub_free (buf1);
   if (buf2)
index f3b5f873dbe25a03a4813431b8d95764efd9feb8..eb250052f6a6c33ec286efdfb267355c96eac24a 100644 (file)
@@ -90,7 +90,7 @@ grub_cmd_echo (grub_extcmd_t cmd, int argc, char **args)
              arg++;
              continue;
            }
-         
+
          /* This was not an escaped character, or escaping is not
             enabled.  */
          grub_printf ("%c", *arg);
index 443f7495315a059f3cec10eba91b50c3e8fa60e4..93a560d9c52a40294d47bb9c13b51b3f4c26ba47 100644 (file)
@@ -34,7 +34,7 @@ grub_machine_acpi_get_rsdpv1 (void)
        &grub_efi_system_table->configuration_table[i].vendor_guid;
 
       if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t)))
-       return (struct grub_acpi_rsdp_v10 *) 
+       return (struct grub_acpi_rsdp_v10 *)
          grub_efi_system_table->configuration_table[i].vendor_table;
     }
   return 0;
@@ -52,7 +52,7 @@ grub_machine_acpi_get_rsdpv2 (void)
        &grub_efi_system_table->configuration_table[i].vendor_guid;
 
       if (! grub_memcmp (guid, &acpi20_guid, sizeof (grub_efi_guid_t)))
-       return (struct grub_acpi_rsdp_v20 *) 
+       return (struct grub_acpi_rsdp_v20 *)
          grub_efi_system_table->configuration_table[i].vendor_table;
     }
   return 0;
index 73dafdeb30e738f236aad0b35cf52004d9c3291e..600309f70dc0589f09c4383d79ed9a5df5350f5a 100644 (file)
 
 /* Convert a LBA address to a CHS address in the INT 13 format.  */
 /* Taken from grub1. */
-/* XXX: use hardcoded geometry of C = 1024, H = 255, S = 63. 
+/* XXX: use hardcoded geometry of C = 1024, H = 255, S = 63.
    Is it a problem?
 */
-static void 
-lba_to_chs (int lba, grub_uint8_t *cl, grub_uint8_t *ch, 
+static void
+lba_to_chs (int lba, grub_uint8_t *cl, grub_uint8_t *ch,
            grub_uint8_t *dh)
 {
   int cylinder, head, sector;
   int sectors = 63, heads = 255, cylinders = 1024;
-  
+
   sector = lba % sectors + 1;
   head = (lba / sectors) % heads;
   cylinder = lba / (sectors * heads);
-  
+
   if (cylinder >= cylinders)
     {
       *cl = *ch = *dh = 0xff;
       return;
     }
-  
+
   *cl = sector | ((cylinder & 0x300) >> 2);
   *ch = cylinder & 0xFF;
   *dh = head;
 }
 
 static grub_err_t
-grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), 
+grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)),
                  int argc, char **args)
 {
   grub_device_t dev;
@@ -74,11 +74,11 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)),
   if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')')
     {
       args[0][grub_strlen (args[0]) - 1] = 0;
-      dev = grub_device_open (args[0] + 1); 
+      dev = grub_device_open (args[0] + 1);
       args[0][grub_strlen (args[0])] = ')';
     }
   else
-    dev = grub_device_open (args[0]); 
+    dev = grub_device_open (args[0]);
 
   if (! dev)
     return grub_errno;
@@ -99,7 +99,7 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)),
   /* Check if it is valid.  */
   if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE))
     {
-      grub_device_close (dev);    
+      grub_device_close (dev);
       return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature");
     }
 
@@ -109,7 +109,7 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)),
       grub_device_close (dev);
       return grub_error (GRUB_ERR_BAD_PART_TABLE, "no GPT partition map found");
     }
-  
+
   int i;
   first_sector = dev->disk->total_sectors;
   for (i = 1; i < argc; i++)
@@ -128,19 +128,19 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)),
       if (separator)
        *separator = csep;
       if (! partition)
-       {  
+       {
          grub_device_close (dev);
          return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such partition");
        }
 
       if (partition->start + partition->len > 0xffffffff)
-       {  
+       {
          grub_device_close (dev);
-         return grub_error (GRUB_ERR_OUT_OF_RANGE, 
+         return grub_error (GRUB_ERR_OUT_OF_RANGE,
                             "only partitions resding in the first 2TB "
                             "can be presen in hybrid MBR");
        }
-       
+
 
       if (first_sector > partition->start)
        first_sector = partition->start;
@@ -182,17 +182,17 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)),
          if (numactive == 2)
            {
              grub_device_close (dev);
-             return grub_error (GRUB_ERR_BAD_ARGUMENT, 
+             return grub_error (GRUB_ERR_BAD_ARGUMENT,
                                 "only one partition can be active");
            }
        }
       mbr.entries[i].type = type;
       mbr.entries[i].start = grub_cpu_to_le32 (partition->start);
-      lba_to_chs (partition->start, 
+      lba_to_chs (partition->start,
                  &(mbr.entries[i].start_sector),
                  &(mbr.entries[i].start_cylinder),
                  &(mbr.entries[i].start_head));
-      lba_to_chs (partition->start + partition->len - 1, 
+      lba_to_chs (partition->start + partition->len - 1,
                  &(mbr.entries[i].end_sector),
                  &(mbr.entries[i].end_cylinder),
                  &(mbr.entries[i].end_head));
@@ -210,11 +210,11 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)),
   mbr.entries[0].flag = 0;
   mbr.entries[0].type = GRUB_PC_PARTITION_TYPE_GPT_DISK;
   mbr.entries[0].start = grub_cpu_to_le32 (1);
-  lba_to_chs (1, 
+  lba_to_chs (1,
              &(mbr.entries[0].start_sector),
              &(mbr.entries[0].start_cylinder),
              &(mbr.entries[0].start_head));
-  lba_to_chs (first_sector, 
+  lba_to_chs (first_sector,
              &(mbr.entries[0].end_sector),
              &(mbr.entries[0].end_cylinder),
              &(mbr.entries[0].end_head));
@@ -239,8 +239,8 @@ static grub_command_t cmd;
 GRUB_MOD_INIT(gptsync)
 {
   (void) mod;                  /* To stop warning. */
-  cmd = grub_register_command ("gptsync", grub_cmd_gptsync, 
-                              "gptsync DEVICE [PARTITION[+/-[TYPE]]] ...", 
+  cmd = grub_register_command ("gptsync", grub_cmd_gptsync,
+                              "gptsync DEVICE [PARTITION[+/-[TYPE]]] ...",
                               "Fill hybrid MBR of GPT drive DEVICE. "
                               "specified partitions will be a part "
                               "of hybrid mbr. Up to 3 partitions are "
index 6159a6333a2faf649c6666ad7bcdf5d2a00eb7c1..c18ec6b83ca1d68997ac278f23db49a62c9c7c7d 100644 (file)
@@ -28,7 +28,7 @@ grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc,
 {
   int cnt = 0;
   char *currarg;
-  
+
   auto int print_command_info (grub_command_t cmd);
   auto int print_command_help (grub_command_t cmd);
 
@@ -61,7 +61,7 @@ grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc,
            {
              if (cnt++ > 0)
                grub_printf ("\n\n");
-             
+
              if (cmd->flags & GRUB_COMMAND_FLAG_EXTCMD)
                grub_arg_show_help ((grub_extcmd_t) cmd->data);
              else
@@ -71,20 +71,20 @@ grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc,
        }
       return 0;
     }
-  
+
   if (argc == 0)
     grub_command_iterate (print_command_info);
   else
     {
       int i;
-      
+
       for (i = 0; i < argc; i++)
        {
          currarg = args[i];
          grub_command_iterate (print_command_help);
        }
     }
-  
+
   return 0;
 }
 
index e02cf4960a7c3776f70d5ac67f5bcc7f73246110..88e4f55cf604557351b36872b19cd70babf1c149 100644 (file)
@@ -26,7 +26,7 @@ grub_machine_acpi_get_rsdpv1 (void)
   int ebda_len;
   grub_uint8_t *ebda, *ptr;
 
-  grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n");  
+  grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n");
   ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4);
   ebda_len = * (grub_uint16_t *) ebda;
   if (! ebda_len)
@@ -37,7 +37,7 @@ grub_machine_acpi_get_rsdpv1 (void)
        && ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0)
       return (struct grub_acpi_rsdp_v10 *) ptr;
 
-  grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n");  
+  grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n");
   for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000;
        ptr += 16)
     if (grub_memcmp (ptr, "RSD PTR ", 8) == 0
@@ -53,7 +53,7 @@ grub_machine_acpi_get_rsdpv2 (void)
   int ebda_len;
   grub_uint8_t *ebda, *ptr;
 
-  grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n");  
+  grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n");
   ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4);
   ebda_len = * (grub_uint16_t *) ebda;
   if (! ebda_len)
@@ -67,7 +67,7 @@ grub_machine_acpi_get_rsdpv2 (void)
        == 0)
       return (struct grub_acpi_rsdp_v20 *) ptr;
 
-  grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n");  
+  grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n");
   for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000;
        ptr += 16)
     if (grub_memcmp (ptr, "RSD PTR ", 8) == 0
index 898fb5167fcdb942a818b2e7e5f4da339720d260..aeb354f1b402b2aa5ffa21bcdf9477aebf16567f 100644 (file)
@@ -184,7 +184,7 @@ list_mappings (void)
     {
       grub_printf ("%cD #%-3u (0x%02x)       %cd%d\n",
                   (curnode->newdrive & 0x80) ? 'H' : 'F',
-                  curnode->newdrive & 0x7F, curnode->newdrive, 
+                  curnode->newdrive & 0x7F, curnode->newdrive,
                   (curnode->redirto & 0x80) ? 'h' : 'f',
                   curnode->redirto & 0x7F
                   );
index f9512cee54a4a2d20c1a90b14840d6ba80e7aac4..0c0301aab69470ad1dd2fad4d78afcfd91ecbad1 100644 (file)
@@ -171,7 +171,7 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)),
                          sizeof (struct note)) == sizeof (struct note)
          && buf.pitch != T_FINE && grub_checkkey () < 0)
     {
-      
+
       grub_dprintf ("play", "pitch = %d, duration = %d\n", buf.pitch,
                     buf.duration);
 
index 3c397a14d4ae229df81e80ad5bfaedff1381da6c..ee9f3c1868cda8faadd35bf7acd8a4d3be2b6373 100644 (file)
@@ -66,14 +66,14 @@ grub_cmd_vbeinfo (grub_command_t cmd __attribute__ ((unused)),
   p = video_mode_list = real2pm (controller_info.video_mode_ptr);
   while (*p++ != 0xFFFF)
     ;
-  
+
   video_mode_list_size = (grub_addr_t) p - (grub_addr_t) video_mode_list;
   saved_video_mode_list = grub_malloc (video_mode_list_size);
   if (! saved_video_mode_list)
     return grub_errno;
 
   grub_memcpy (saved_video_mode_list, video_mode_list, video_mode_list_size);
-  
+
   grub_printf ("List of compatible video modes:\n");
   grub_printf ("Legend: P=Packed pixel, D=Direct color, "
               "mask/pos=R/G/B/reserved\n");
@@ -83,7 +83,7 @@ grub_cmd_vbeinfo (grub_command_t cmd __attribute__ ((unused)),
     {
       const char *memory_model = 0;
       grub_uint32_t mode = (grub_uint32_t) *p;
-      
+
       err = grub_vbe_get_video_mode_info (mode, &mode_info_tmp);
       if (err != GRUB_ERR_NONE)
        {
@@ -127,7 +127,7 @@ grub_cmd_vbeinfo (grub_command_t cmd __attribute__ ((unused)),
       if (! memory_model)
        continue;
 
-      grub_printf ("0x%03x:  %4d x %4d x %2d  %s", 
+      grub_printf ("0x%03x:  %4d x %4d x %2d  %s",
                    mode,
                    mode_info_tmp.x_resolution,
                    mode_info_tmp.y_resolution,
@@ -149,7 +149,7 @@ grub_cmd_vbeinfo (grub_command_t cmd __attribute__ ((unused)),
     }
 
   grub_free (saved_video_mode_list);
-  
+
   /* Check existence of vbe_mode environment variable.  */
   modevar = grub_env_get ("vbe_mode");
 
index bfcf215d06a81934d8289619b4efd8c41473ab8b..3cbc3014ce4676ada66890ce19de4cebfce9ec03 100644 (file)
@@ -73,7 +73,7 @@ grub_cmd_vbetest (grub_command_t cmd __attribute__ ((unused)),
     grub_printf ("Old video mode = %04x\n", old_mode);
   else
     grub_errno = GRUB_ERR_NONE;
-  
+
   /* Check existence of vbe_mode environment variable.  */
   modevar = grub_env_get ("vbe_mode");
   if (modevar != 0)
@@ -90,7 +90,7 @@ grub_cmd_vbetest (grub_command_t cmd __attribute__ ((unused)),
   err = grub_vbe_get_video_mode_info (use_mode, &mode_info);
   if (err != GRUB_ERR_NONE)
     return err;
-  
+
   /* Dump out details about the mode being tested.  */
   grub_printf ("mode: 0x%03x\n",
                use_mode);
index 1c2020b3069365f149dbee6c63fbee5ade1a5bbf..22665f9fe20fa0cda79c9309018fa150e356874e 100644 (file)
@@ -51,7 +51,7 @@ open_envblk_file (char *filename)
           filename = grub_malloc (len + 1 + sizeof (GRUB_ENVBLK_DEFCFG));
           if (! filename)
             return 0;
-          
+
           grub_strcpy (filename, prefix);
           filename[len] = '/';
           grub_strcpy (filename + len + 1, GRUB_ENVBLK_DEFCFG);
@@ -80,7 +80,7 @@ read_envblk_file (grub_file_t file)
   buf = grub_malloc (size);
   if (! buf)
     return 0;
-  
+
   while (size > 0)
     {
       grub_ssize_t ret;
@@ -124,7 +124,7 @@ grub_cmd_load_env (grub_extcmd_t cmd,
     grub_env_set (name, value);
     return 0;
   }
-  
+
   file = open_envblk_file ((state[0].set) ? state[0].arg : 0);
   if (! file)
     return grub_errno;
@@ -135,7 +135,7 @@ grub_cmd_load_env (grub_extcmd_t cmd,
 
   grub_envblk_iterate (envblk, set_var);
   grub_envblk_close (envblk);
-  
+
  fail:
   grub_file_close (file);
   return grub_errno;
@@ -157,7 +157,7 @@ grub_cmd_list_env (grub_extcmd_t cmd,
       grub_printf ("%s=%s\n", name, value);
       return 0;
     }
+
   file = open_envblk_file ((state[0].set) ? state[0].arg : 0);
   if (! file)
     return grub_errno;
@@ -168,7 +168,7 @@ grub_cmd_list_env (grub_extcmd_t cmd,
 
   grub_envblk_iterate (envblk, print_var);
   grub_envblk_close (envblk);
-  
+
  fail:
   grub_file_close (file);
   return grub_errno;
@@ -205,7 +205,7 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists,
   grub_disk_addr_t part_start;
   struct blocklist *p;
   char *buf;
-  
+
   /* Sanity checks.  */
   total_length = 0;
   for (p = blocklists; p; p = p->next)
@@ -222,10 +222,10 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists,
               return 0;
             }
         }
-      
+
       total_length += p->length;
     }
-  
+
   if (total_length != grub_file_size (file))
     {
       /* Maybe sparse, unallocated sectors. No way in GRUB.  */
@@ -245,7 +245,7 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists,
   for (p = blocklists, index = 0; p; p = p->next, index += p->length)
     {
       char blockbuf[GRUB_DISK_SECTOR_SIZE];
-      
+
       if (grub_disk_read (disk, p->sector - part_start,
                           p->offset, p->length, blockbuf))
         return 0;
@@ -269,7 +269,7 @@ write_blocklists (grub_envblk_t envblk, struct blocklist *blocklists,
   grub_disk_addr_t part_start;
   struct blocklist *p;
   grub_size_t index;
-  
+
   buf = grub_envblk_buffer (envblk);
   disk = file->device->disk;
   if (disk->partition)
@@ -296,7 +296,7 @@ grub_cmd_save_env (grub_extcmd_t cmd, int argc, char **args)
   grub_envblk_t envblk;
   struct blocklist *head = 0;
   struct blocklist *tail = 0;
-  
+
   /* Store blocklists in a linked list.  */
   auto void NESTED_FUNC_ATTR read_hook (grub_disk_addr_t sector,
                                         unsigned offset,
@@ -309,7 +309,7 @@ grub_cmd_save_env (grub_extcmd_t cmd, int argc, char **args)
       if (offset + length > GRUB_DISK_SECTOR_SIZE)
         /* Seemingly a bug.  */
         return;
-      
+
       block = grub_malloc (sizeof (*block));
       if (! block)
         return;
@@ -348,7 +348,7 @@ grub_cmd_save_env (grub_extcmd_t cmd, int argc, char **args)
 
   if (! check_blocklists (envblk, head, file))
     goto fail;
-  
+
   while (argc)
     {
       char *value;
@@ -368,7 +368,7 @@ grub_cmd_save_env (grub_extcmd_t cmd, int argc, char **args)
     }
 
   write_blocklists (envblk, head, file);
-  
+
  fail:
   if (envblk)
     grub_envblk_close (envblk);
index fb38fab99ef5923ca04890f600dc58e4ec7f3ce2..15b4c6bab6219a7a49ea3fed2cdfa1a2ae9632b6 100644 (file)
@@ -51,10 +51,10 @@ grub_ls_list_devices (int longlist)
        grub_normal_print_device_info (name);
       else
        grub_printf ("(%s) ", name);
-  
+
       return 0;
     }
-  
+
   grub_device_iterate (grub_ls_print_devices);
   grub_putchar ('\n');
   grub_refresh ();
@@ -70,20 +70,20 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
   const char *path;
   grub_device_t dev;
 
-  auto int print_files (const char *filename, 
+  auto int print_files (const char *filename,
                        const struct grub_dirhook_info *info);
-  auto int print_files_long (const char *filename, 
+  auto int print_files_long (const char *filename,
                             const struct grub_dirhook_info *info);
-  
+
   int print_files (const char *filename, const struct grub_dirhook_info *info)
     {
       if (all || filename[0] != '.')
        grub_printf ("%s%s ", filename, info->dir ? "/" : "");
-      
+
       return 0;
     }
-     
-  int print_files_long (const char *filename, 
+
+  int print_files_long (const char *filename,
                        const struct grub_dirhook_info *info)
     {
       char pathname[grub_strlen (dirname) + grub_strlen (filename) + 1];
@@ -94,7 +94,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
       if (! info->dir)
        {
          grub_file_t file;
-         
+
          if (dirname[grub_strlen (dirname) - 1] == '/')
            grub_sprintf (pathname, "%s%s", dirname, filename);
          else
@@ -117,7 +117,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
              int fsz = file->size;
              int units = 0;
              char buf[20];
-             
+
              while (fsz / 1024)
                {
                  fsize = (fsize + 512) / 1024;
@@ -136,7 +136,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
                }
              else
                grub_printf ("%-12llu", (unsigned long long) file->size);
-             
+
            }
          grub_file_close (file);
        }
@@ -150,13 +150,13 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
          if (human)
            grub_printf (" %d-%02d-%02d %02d:%02d:%02d %-11s ",
                         datetime.year, datetime.month, datetime.day,
-                        datetime.hour, datetime.minute, 
+                        datetime.hour, datetime.minute,
                         datetime.second,
                         grub_get_weekday_name (&datetime));
          else
            grub_printf (" %04d%02d%02d%02d%02d%02d ",
-                        datetime.year, datetime.month, 
-                        datetime.day, datetime.hour, 
+                        datetime.year, datetime.month,
+                        datetime.day, datetime.hour,
                         datetime.minute, datetime.second);
        }
       grub_printf ("%s%s\n", filename, info->dir ? "/" : "");
@@ -175,13 +175,13 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
     path = dirname;
   else
     path++;
-  
+
   if (! path && ! device_name)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument");
       goto fail;
     }
-      
+
   if (! *path)
     {
       if (grub_errno == GRUB_ERR_UNKNOWN_FS)
@@ -204,13 +204,13 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
          grub_file_t file;
          struct grub_dirhook_info info;
          grub_errno = 0;
-         
+
          file = grub_file_open (dirname);
          if (! file)
            goto fail;
-         
+
          grub_file_close (file);
-         
+
          p = grub_strrchr (dirname, '/') + 1;
          dirname = grub_strndup (dirname, p - dirname);
          if (! dirname)
@@ -228,14 +228,14 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
 
       if (grub_errno == GRUB_ERR_NONE)
        grub_putchar ('\n');
-      
+
       grub_refresh ();
     }
 
  fail:
   if (dev)
     grub_device_close (dev);
-      
+
   grub_free (device_name);
 
   return 0;
index 58751ca2f1e82cf3bc85f9b8ed8c56193536d781..c807f066b8f9f9e795653f7fc3fdf69310a12112 100644 (file)
@@ -38,8 +38,8 @@ static char helpmsg[] =
   "Use \"parttool PARTITION help\" for the list "
   "of available commands";
 
-int 
-grub_parttool_register(const char *part_name, 
+int
+grub_parttool_register(const char *part_name,
                       const grub_parttool_function_t func,
                       const struct grub_parttool_argdesc *args)
 {
@@ -55,11 +55,11 @@ grub_parttool_register(const char *part_name,
   cur->handle = curhandle++;
   for (nargs = 0; args[nargs].name != 0; nargs++);
   cur->nargs = nargs;
-  cur->args = (struct grub_parttool_argdesc *) 
+  cur->args = (struct grub_parttool_argdesc *)
     grub_malloc ((nargs + 1) * sizeof (struct grub_parttool_argdesc));
-  grub_memcpy (cur->args, args, 
+  grub_memcpy (cur->args, args,
               (nargs + 1) * sizeof (struct grub_parttool_argdesc));
-  
+
   cur->func = func;
   parts = cur;
   return cur->handle;
@@ -113,22 +113,22 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
          for (curarg = cur->args; curarg->name; curarg++)
            {
              int spacing = 20;
-             
+
              spacing -= grub_strlen (curarg->name);
              grub_printf ("%s", curarg->name);
-             
+
              switch (curarg->type)
                {
                case GRUB_PARTTOOL_ARG_BOOL:
                  grub_printf ("+/-");
                  spacing -= 3;
                  break;
-                 
-               case GRUB_PARTTOOL_ARG_VAL:                   
+
+               case GRUB_PARTTOOL_ARG_VAL:
                  grub_printf ("=VAL");
                  spacing -= 4;
                  break;
-                 
+
                    case GRUB_PARTTOOL_ARG_END:
                      break;
                }
@@ -138,7 +138,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
            }
        }
     if (! found)
-      grub_printf ("Sorry no parttool is available for %s\n", 
+      grub_printf ("Sorry no parttool is available for %s\n",
                   dev->disk->partition->partmap->name);
     return GRUB_ERR_NONE;
   }
@@ -152,11 +152,11 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
   if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')')
     {
       args[0][grub_strlen (args[0]) - 1] = 0;
-      dev = grub_device_open (args[0] + 1); 
+      dev = grub_device_open (args[0] + 1);
       args[0][grub_strlen (args[0]) - 1] = ')';
     }
   else
-    dev = grub_device_open (args[0]); 
+    dev = grub_device_open (args[0]);
 
   if (! dev)
     return grub_errno;
@@ -186,7 +186,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
        if (filename)
          {
            grub_file_t file;
-           
+
            grub_sprintf (filename, "%s/parttool.lst", prefix);
            file = grub_file_open (filename);
            if (file)
@@ -197,36 +197,36 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
                    char *p, *name;
 
                    buf = grub_file_getline (file);
-                   
+
                    if (! buf)
                      break;
-                 
+
                    name = buf;
 
                    if (! grub_isgraph (name[0]))
                      continue;
-                   
+
                    p = grub_strchr (name, ':');
                    if (! p)
                      continue;
-                   
+
                    *p = '\0';
                    while (*++p == ' ')
                      ;
 
                    if (! grub_isgraph (*p))
                      continue;
-                   
+
                    if (grub_strcmp (name, dev->disk->partition->partmap->name)
                        != 0)
                      continue;
-                   
+
                    grub_dl_load (p);
                  }
-               
+
                grub_file_close (file);
              }
-           
+
            grub_free (filename);
          }
       }
@@ -254,15 +254,15 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
          if (grub_strcmp (dev->disk->partition->partmap->name, cur->name) == 0)
            {
              for (curarg = cur->args; curarg->name; curarg++)
-               if (grub_strncmp (curarg->name, args[i], 
+               if (grub_strncmp (curarg->name, args[i],
                                  grub_strlen (curarg->name)) == 0
-                   && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL 
-                        && (args[i][grub_strlen (curarg->name)] == '+' 
+                   && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL
+                        && (args[i][grub_strlen (curarg->name)] == '+'
                             || args[i][grub_strlen (curarg->name)] == '-'
                             || args[i][grub_strlen (curarg->name)] == 0))
                        || (curarg->type == GRUB_PARTTOOL_ARG_VAL
                            && args[i][grub_strlen (curarg->name)] == '=')))
-                   
+
                  break;
              if (curarg->name)
                break;
@@ -271,18 +271,18 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
          return grub_error (GRUB_ERR_BAD_ARGUMENT, "unrecognised argument %s",
                             args[i]);
        ptool = cur;
-       pargs = (struct grub_parttool_args *) 
+       pargs = (struct grub_parttool_args *)
          grub_malloc (ptool->nargs * sizeof (struct grub_parttool_args));
-       grub_memset (pargs, 0, 
+       grub_memset (pargs, 0,
                     ptool->nargs * sizeof (struct grub_parttool_args));
        for (j = i; j < argc; j++)
          if (! parsed[j])
            {
              for (curarg = ptool->args; curarg->name; curarg++)
-               if (grub_strncmp (curarg->name, args[i], 
+               if (grub_strncmp (curarg->name, args[i],
                                   grub_strlen (curarg->name)) == 0
-                   && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL 
-                        && (args[j][grub_strlen (curarg->name)] == '+' 
+                   && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL
+                        && (args[j][grub_strlen (curarg->name)] == '+'
                             || args[j][grub_strlen (curarg->name)] == '-'
                             || args[j][grub_strlen (curarg->name)] == 0))
                        || (curarg->type == GRUB_PARTTOOL_ARG_VAL
@@ -293,15 +293,15 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
                    switch (curarg->type)
                      {
                      case GRUB_PARTTOOL_ARG_BOOL:
-                       pargs[curarg - ptool->args].bool 
+                       pargs[curarg - ptool->args].bool
                          = (args[j][grub_strlen (curarg->name)] != '-');
                        break;
 
                      case GRUB_PARTTOOL_ARG_VAL:
-                       pargs[curarg - ptool->args].str 
+                       pargs[curarg - ptool->args].str
                          = (args[j] + grub_strlen (curarg->name) + 1);
                        break;
-                       
+
                      case GRUB_PARTTOOL_ARG_END:
                        break;
                      }
@@ -324,8 +324,8 @@ static grub_command_t cmd;
 GRUB_MOD_INIT(parttool)
 {
   mymod = mod;
-  cmd = grub_register_command ("parttool", grub_cmd_parttool, 
-                              "parttool PARTITION COMMANDS", 
+  cmd = grub_register_command ("parttool", grub_cmd_parttool,
+                              "parttool PARTITION COMMANDS",
                               helpmsg);
 }
 
index 301b663e5d191dc3815e067a55fe6728d7d04ce9..cfcc6b9593b647242af7bd8d0563ddede73e7692 100644 (file)
@@ -42,7 +42,7 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid)
 {
   int count = 0;
   auto int iterate_device (const char *name);
-  
+
   int iterate_device (const char *name)
     {
       grub_device_t dev;
@@ -53,12 +53,12 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid)
          name[0] == 'f' && name[1] == 'd' &&
          name[2] >= '0' && name[2] <= '9')
        return 0;
-      
+
       dev = grub_device_open (name);
       if (dev)
        {
          grub_fs_t fs;
-         
+
          fs = grub_fs_probe (dev);
 
 #define QUID(x)        (is_uuid ? (x)->uuid : (x)->label)
@@ -66,7 +66,7 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid)
          if (fs && QUID(fs))
            {
              char *quid;
-             
+
              (QUID(fs)) (dev, &quid);
              if (grub_errno == GRUB_ERR_NONE && quid)
                {
@@ -82,20 +82,20 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid)
                      else
                          grub_printf (" %s", name);
                    }
-                 
+
                  grub_free (quid);
                }
            }
-         
+
          grub_device_close (dev);
        }
-      
+
       grub_errno = GRUB_ERR_NONE;
       return abort;
     }
-  
+
   grub_device_iterate (iterate_device);
-  
+
   if (count == 0)
     grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such device: %s", key);
 }
@@ -113,13 +113,13 @@ search_file (const char *key, const char *var, int no_floppy)
       char *p;
       grub_file_t file;
       int abort = 0;
-      
+
       /* Skip floppy drives when requested.  */
       if (no_floppy &&
          name[0] == 'f' && name[1] == 'd' &&
          name[2] >= '0' && name[2] <= '9')
        return 0;
-      
+
       len = grub_strlen (name) + 2 + grub_strlen (key) + 1;
       p = grub_realloc (buf, len);
       if (! p)
@@ -127,7 +127,7 @@ search_file (const char *key, const char *var, int no_floppy)
 
       buf = p;
       grub_sprintf (buf, "(%s)%s", name, key);
-      
+
       file = grub_file_open (buf);
       if (file)
        {
@@ -143,15 +143,15 @@ search_file (const char *key, const char *var, int no_floppy)
 
          grub_file_close (file);
        }
-      
+
       grub_errno = GRUB_ERR_NONE;
       return abort;
     }
-  
+
   grub_device_iterate (iterate_device);
-  
+
   grub_free (buf);
-  
+
   if (grub_errno == GRUB_ERR_NONE && count == 0)
     grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such device");
 }
@@ -161,13 +161,13 @@ grub_cmd_search (grub_extcmd_t cmd, int argc, char **args)
 {
   struct grub_arg_list *state = cmd->state;
   const char *var = 0;
-  
+
   if (argc == 0)
     return grub_error (GRUB_ERR_INVALID_COMMAND, "no argument specified");
 
   if (state[3].set)
     var = state[3].arg ? state[3].arg : "root";
-  
+
   if (state[1].set)
     search_fs (args[0], var, state[4].set, 0);
   else if (state[2].set)
index bbeeed0e896a49d847dc448c1b3b8ea01adeea3e..26df8b5c5b73fe4be7264a6e72f1a59a47a47a23 100644 (file)
@@ -63,9 +63,9 @@ test_parse (char **args, int *argn, int argc)
     grub_device_t dev;
 
     /* A hook for iterating directories. */
-    auto int find_file (const char *cur_filename, 
+    auto int find_file (const char *cur_filename,
                        const struct grub_dirhook_info *info);
-    int find_file (const char *cur_filename, 
+    int find_file (const char *cur_filename,
                   const struct grub_dirhook_info *info)
     {
       if ((info->case_insensitive ? grub_strcasecmp (cur_filename, filename)
@@ -77,7 +77,7 @@ test_parse (char **args, int *argn, int argc)
        }
       return 0;
     }
-    
+
     file_exists = 0;
     device_name = grub_file_get_device_name (path);
     dev = grub_device_open (device_name);
@@ -93,7 +93,7 @@ test_parse (char **args, int *argn, int argc)
       pathname = path;
     else
       pathname++;
-    
+
     /* Remove trailing '/'. */
     while (*pathname && pathname[grub_strlen (pathname) - 1] == '/')
       pathname[grub_strlen (pathname) - 1] = 0;
@@ -132,7 +132,7 @@ test_parse (char **args, int *argn, int argc)
     else
       (fs->dir) (dev, path, find_file);
 
-    grub_device_close (dev); 
+    grub_device_close (dev);
     grub_free (path);
     grub_free (device_name);
   }
@@ -158,7 +158,7 @@ test_parse (char **args, int *argn, int argc)
              (*argn) += 3;
              continue;
            }
-         
+
          /* GRUB extension: lexicographical sorting. */
          if (grub_strcmp (args[*argn + 1], "<") == 0)
            {
@@ -166,21 +166,21 @@ test_parse (char **args, int *argn, int argc)
              (*argn) += 3;
              continue;
            }
-         
+
          if (grub_strcmp (args[*argn + 1], "<=") == 0)
            {
              update_val (grub_strcmp (args[*argn], args[*argn + 2]) <= 0);
              (*argn) += 3;
              continue;
            }
-         
+
          if (grub_strcmp (args[*argn + 1], ">") == 0)
            {
              update_val (grub_strcmp (args[*argn], args[*argn + 2]) > 0);
              (*argn) += 3;
              continue;
            }
-         
+
          if (grub_strcmp (args[*argn + 1], ">=") == 0)
            {
              update_val (grub_strcmp (args[*argn], args[*argn + 2]) >= 0);
@@ -191,7 +191,7 @@ test_parse (char **args, int *argn, int argc)
          /* Number tests. */
          if (grub_strcmp (args[*argn + 1], "-eq") == 0)
            {
-             update_val (grub_strtosl (args[*argn], 0, 0) 
+             update_val (grub_strtosl (args[*argn], 0, 0)
                          == grub_strtosl (args[*argn + 2], 0, 0));
              (*argn) += 3;
              continue;
@@ -199,15 +199,15 @@ test_parse (char **args, int *argn, int argc)
 
          if (grub_strcmp (args[*argn + 1], "-ge") == 0)
            {
-             update_val (grub_strtosl (args[*argn], 0, 0) 
+             update_val (grub_strtosl (args[*argn], 0, 0)
                          >= grub_strtosl (args[*argn + 2], 0, 0));
              (*argn) += 3;
              continue;
            }
-         
+
          if (grub_strcmp (args[*argn + 1], "-gt") == 0)
            {
-             update_val (grub_strtosl (args[*argn], 0, 0) 
+             update_val (grub_strtosl (args[*argn], 0, 0)
                          > grub_strtosl (args[*argn + 2], 0, 0));
              (*argn) += 3;
              continue;
@@ -215,55 +215,55 @@ test_parse (char **args, int *argn, int argc)
 
          if (grub_strcmp (args[*argn + 1], "-le") == 0)
            {
-             update_val (grub_strtosl (args[*argn], 0, 0) 
+             update_val (grub_strtosl (args[*argn], 0, 0)
                      <= grub_strtosl (args[*argn + 2], 0, 0));
              (*argn) += 3;
              continue;
            }
-         
+
          if (grub_strcmp (args[*argn + 1], "-lt") == 0)
            {
-             update_val (grub_strtosl (args[*argn], 0, 0) 
+             update_val (grub_strtosl (args[*argn], 0, 0)
                          < grub_strtosl (args[*argn + 2], 0, 0));
              (*argn) += 3;
              continue;
            }
-         
+
          if (grub_strcmp (args[*argn + 1], "-ne") == 0)
            {
-             update_val (grub_strtosl (args[*argn], 0, 0) 
+             update_val (grub_strtosl (args[*argn], 0, 0)
                          != grub_strtosl (args[*argn + 2], 0, 0));
              (*argn) += 3;
              continue;
            }
 
-         /* GRUB extension: compare numbers skipping prefixes. 
+         /* GRUB extension: compare numbers skipping prefixes.
             Useful for comparing versions. E.g. vmlinuz-2 -plt vmlinuz-11. */
          if (grub_strcmp (args[*argn + 1], "-pgt") == 0
              || grub_strcmp (args[*argn + 1], "-plt") == 0)
            {
              int i;
              /* Skip common prefix. */
-             for (i = 0; args[*argn][i] == args[*argn + 2][i] 
+             for (i = 0; args[*argn][i] == args[*argn + 2][i]
                     && args[*argn][i]; i++);
-             
+
              /* Go the digits back. */
              i--;
              while (grub_isdigit (args[*argn][i]) && i > 0)
                i--;
              i++;
-             
+
              if (grub_strcmp (args[*argn + 1], "-pgt") == 0)
-               update_val (grub_strtoul (args[*argn] + i, 0, 0) 
+               update_val (grub_strtoul (args[*argn] + i, 0, 0)
                            > grub_strtoul (args[*argn + 2] + i, 0, 0));
              else
-               update_val (grub_strtoul (args[*argn] + i, 0, 0) 
+               update_val (grub_strtoul (args[*argn] + i, 0, 0)
                            < grub_strtoul (args[*argn + 2] + i, 0, 0));
              (*argn) += 3;
              continue;
            }
 
-         /* -nt and -ot tests. GRUB extension: when doing -?t<bias> bias 
+         /* -nt and -ot tests. GRUB extension: when doing -?t<bias> bias
             will be added to the first mtime. */
          if (grub_memcmp (args[*argn + 1], "-nt", 3) == 0
              || grub_memcmp (args[*argn + 1], "-ot", 3) == 0)
@@ -271,16 +271,16 @@ test_parse (char **args, int *argn, int argc)
              struct grub_dirhook_info file1;
              int file1exists;
              int bias = 0;
-             
+
              /* Fetch fileinfo. */
              get_fileinfo (args[*argn]);
              file1 = file_info;
              file1exists = file_exists;
              get_fileinfo (args[*argn + 2]);
-             
+
              if (args[*argn + 1][3])
                bias = grub_strtosl (args[*argn + 1] + 3, 0, 0);
-             
+
              if (grub_memcmp (args[*argn + 1], "-nt", 3) == 0)
                update_val ((file1exists && ! file_exists)
                            || (file1.mtimeset && file_info.mtimeset
@@ -305,7 +305,7 @@ test_parse (char **args, int *argn, int argc)
              (*argn) += 2;
              return ret;
            }
-         
+
          if (grub_strcmp (args[*argn], "-e") == 0)
            {
              get_fileinfo (args[*argn + 1]);
@@ -322,7 +322,7 @@ test_parse (char **args, int *argn, int argc)
              (*argn) += 2;
              return ret;
            }
-         
+
          if (grub_strcmp (args[*argn], "-s") == 0)
            {
              grub_file_t file;
@@ -334,12 +334,12 @@ test_parse (char **args, int *argn, int argc)
              (*argn) += 2;
              return ret;
            }
-         
+
          /* String tests. */
          if (grub_strcmp (args[*argn], "-n") == 0)
            {
              update_val (args[*argn + 1][0]);
-             
+
              (*argn) += 2;
              continue;
            }
@@ -352,7 +352,7 @@ test_parse (char **args, int *argn, int argc)
        }
 
       /* Special modifiers. */
-      
+
       /* End of expression. return to parent. */
       if (grub_strcmp (args[*argn], ")") == 0)
        {
@@ -366,7 +366,7 @@ test_parse (char **args, int *argn, int argc)
          update_val (test_parse (args, argn, argc));
          continue;
        }
-      
+
       if (grub_strcmp (args[*argn], "!") == 0)
        {
          invert = ! invert;
@@ -404,7 +404,7 @@ grub_cmd_test (grub_command_t cmd __attribute__ ((unused)),
   if (argc >= 1 && grub_strcmp (args[argc - 1], "]") == 0)
     argc--;
 
-  return test_parse (args, &argn, argc) ? GRUB_ERR_NONE 
+  return test_parse (args, &argn, argc) ? GRUB_ERR_NONE
     : grub_error (GRUB_ERR_TEST_FAILURE, "false");
 }
 
index 019d3fe7844194771ac3b1b0f18a0f31b38c8514..018c1a25bb63f4375d9f3e4af907084972085adf 100644 (file)
@@ -51,7 +51,7 @@ static const char *usb_endp_type[] =
     "Interrupt"
   };
 
-static const char *usb_devspeed[] = 
+static const char *usb_devspeed[] =
   {
     "",
     "Low",
@@ -84,7 +84,7 @@ usb_iterate (grub_usb_device_t dev)
   usb_print_str ("Product", dev, descdev->strprod);
   usb_print_str ("Vendor", dev, descdev->strvendor);
   usb_print_str ("Serial", dev, descdev->strserial);
-  
+
   if (descdev->class > 0 && descdev->class <= 0x0E)
     grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n",
                 descdev->class, usb_classes[descdev->class],
index 0af07f994935e7cef78c0dfca5b2b4d13ccc2f83..4a94443b694564f7df0a7d754d8a860ae0938a86 100644 (file)
@@ -162,7 +162,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
        commands/parttool.c parttool/pcpart.c                           \
        grub_emu_init.c
 
-grub_emu_LDFLAGS = $(LIBCURSES) 
+grub_emu_LDFLAGS = $(LIBCURSES)
 
 ifeq ($(enable_grub_emu_usb), yes)
 grub_emu_SOURCES += disk/usbms.c util/usb.c bus/usb/usb.c      \
index 8b5be2bba29169341fe303d5412662a5cb10d8d8..6411111b4e29d78ae8b674c4872864648008739e 100644 (file)
@@ -33,7 +33,7 @@ sbin_UTILITIES = grub-mkdevicemap
 ifeq ($(enable_grub_emu), yes)
 sbin_UTILITIES += grub-emu
 endif
+
 # For grub-mkdevicemap.
 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
        util/devicemap.c util/misc.c
@@ -144,7 +144,7 @@ multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \
                          loader/multiboot2.c \
                          loader/multiboot_loader.c
 multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
-multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) 
+multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # For memdisk.mod.
 memdisk_mod_SOURCES = disk/memdisk.c
index d16501bdc4c7050a89011e8b7149120df4952171..d061416a21663ec86e1cd18f6b1c352172de807c 100644 (file)
@@ -66,7 +66,7 @@ endif
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \
-        util/resolve.c 
+        util/resolve.c
 
 # For grub-setup.
 util/sparc64/ieee1275/grub-setup.c_DEPENDENCIES = grub_setup_init.h
index e29495a9736a357d6817160de7fa3d71a30e231a..6757d4f1c7817a568696bb5987f307a8c54ab617 100644 (file)
@@ -354,7 +354,7 @@ if test "$target_cpu"-"$platform" = x86_64-efi; then
   ])
   if test "x$grub_cv_cc_mcmodel" = xno; then
     CFLAGS="$SAVED_CFLAGS -m64 -DMCMODEL_SMALL=1"
-    TARGET_CFLAGS="$TARGET_CFLAGS -DMCMODEL_SMALL=1"    
+    TARGET_CFLAGS="$TARGET_CFLAGS -DMCMODEL_SMALL=1"
     AC_MSG_WARN([-mcmodel=large not supported. You wan't be able to use the memory over 4GiB. Upgrade your gcc])
   else
     TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
@@ -451,7 +451,7 @@ LIBS="$tmp_LIBS"
 #
 
 # Memory manager debugging.
-AC_ARG_ENABLE([mm-debug], 
+AC_ARG_ENABLE([mm-debug],
              AS_HELP_STRING([--enable-mm-debug],
                              [include memory manager debugging]),
               [AC_DEFINE([MM_DEBUG], [1],
index b186f6dc9ac0fbc5a0b40411286ef94ccb657690..78d396526c757206e01a8686e035874ca116b32a 100644 (file)
@@ -357,7 +357,7 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2)
   /* Try to detect if the port is in use by writing to it,
      waiting for a while and reading it again.  If the value
      was preserved, there is a device connected.  */
-  grub_ata_regset (dev, GRUB_ATA_REG_SECTORS, 0x5A);  
+  grub_ata_regset (dev, GRUB_ATA_REG_SECTORS, 0x5A);
   grub_ata_wait ();
   grub_uint8_t sec = grub_ata_regget (dev, GRUB_ATA_REG_SECTORS);
   grub_dprintf ("ata", "sectors=0x%x\n", sec);
@@ -435,7 +435,7 @@ grub_ata_pciinit (int bus, int device, int func,
          bar2 = grub_pci_read (addr);
 
          /* Check if the BARs describe an IO region.  */
-         if ((bar1 & 1) && (bar2 & 1))   
+         if ((bar1 & 1) && (bar2 & 1))
            {
              rega = bar1 & ~3;
              regb = bar2 & ~3;
@@ -682,7 +682,7 @@ grub_ata_open (const char *name, grub_disk_t disk)
   disk->total_sectors = dev->size;
 
   disk->id = (unsigned long) dev;
-  
+
   disk->has_partitions = 1;
   disk->data = dev;
 
@@ -692,7 +692,7 @@ grub_ata_open (const char *name, grub_disk_t disk)
 static void
 grub_ata_close (grub_disk_t disk __attribute__((unused)))
 {
-  
+
 }
 
 static grub_err_t
@@ -841,7 +841,7 @@ static struct grub_scsi_dev grub_atapi_dev =
     .close = grub_atapi_close,
     .read = grub_atapi_read,
     .write = grub_atapi_write
-  }; 
+  };
 
 \f
 
@@ -854,7 +854,7 @@ GRUB_MOD_INIT(ata)
       grub_disk_firmware_fini ();
       grub_disk_firmware_fini = NULL;
     }
-  
+
   /* ATA initialization.  */
   grub_ata_initialize ();
 
index 767ebf8ce97f8e5b16e1959bda98968c29f8e086..de848594a1861f400c9a0609cbb63be378b3d20d 100644 (file)
@@ -51,7 +51,7 @@ duplicate_device_path (const grub_efi_device_path_t *dp)
 {
   grub_efi_device_path_t *p;
   grub_size_t total_size = 0;
-  
+
   for (p = (grub_efi_device_path_t *) dp;
        ;
        p = GRUB_EFI_NEXT_DEVICE_PATH (p))
@@ -94,14 +94,14 @@ compare_device_paths (const grub_efi_device_path_t *dp1,
   if (! dp1 || ! dp2)
     /* Return non-zero.  */
     return 1;
-  
+
   while (1)
     {
       grub_efi_uint8_t type1, type2;
       grub_efi_uint8_t subtype1, subtype2;
       grub_efi_uint16_t len1, len2;
       int ret;
-      
+
       type1 = GRUB_EFI_DEVICE_PATH_TYPE (dp1);
       type2 = GRUB_EFI_DEVICE_PATH_TYPE (dp2);
 
@@ -110,7 +110,7 @@ compare_device_paths (const grub_efi_device_path_t *dp1,
 
       subtype1 = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp1);
       subtype2 = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp2);
-      
+
       if (subtype1 != subtype2)
        return (int) subtype1 - (int) subtype2;
 
@@ -141,7 +141,7 @@ make_devices (void)
   grub_efi_handle_t *handles;
   grub_efi_handle_t *handle;
   struct grub_efidisk_data *devices = 0;
-  
+
   /* Find handles which support the disk io interface.  */
   handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, &disk_io_guid,
                                    0, &num_handles);
@@ -156,7 +156,7 @@ make_devices (void)
       struct grub_efidisk_data *d;
       grub_efi_block_io_t *bio;
       grub_efi_disk_io_t *dio;
-      
+
       dp = grub_efi_get_device_path (*handle);
       if (! dp)
        continue;
@@ -165,7 +165,7 @@ make_devices (void)
       if (! ldp)
        /* This is empty. Why?  */
        continue;
-      
+
       bio = grub_efi_open_protocol (*handle, &block_io_guid,
                                    GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
       dio = grub_efi_open_protocol (*handle, &disk_io_guid,
@@ -173,7 +173,7 @@ make_devices (void)
       if (! bio || ! dio)
        /* This should not happen... Why?  */
        continue;
-       
+
       d = grub_malloc (sizeof (*d));
       if (! d)
        {
@@ -192,7 +192,7 @@ make_devices (void)
     }
 
   grub_free (handles);
-  
+
   return devices;
 }
 
@@ -203,7 +203,7 @@ find_parent_device (struct grub_efidisk_data *devices,
 {
   grub_efi_device_path_t *dp, *ldp;
   struct grub_efidisk_data *parent;
-  
+
   dp = duplicate_device_path (d->device_path);
   if (! dp)
     return 0;
@@ -219,13 +219,13 @@ find_parent_device (struct grub_efidisk_data *devices,
       /* Ignore itself.  */
       if (parent == d)
        continue;
-      
+
       if (compare_device_paths (parent->device_path, dp) == 0)
        {
          /* Found.  */
          if (! parent->last_device_path)
            parent = 0;
-         
+
          break;
        }
     }
@@ -240,7 +240,7 @@ iterate_child_devices (struct grub_efidisk_data *devices,
                       int (*hook) (struct grub_efidisk_data *child))
 {
   struct grub_efidisk_data *p;
-  
+
   for (p = devices; p; p = p->next)
     {
       grub_efi_device_path_t *dp, *ldp;
@@ -248,13 +248,13 @@ iterate_child_devices (struct grub_efidisk_data *devices,
       dp = duplicate_device_path (p->device_path);
       if (! dp)
        return 0;
-      
+
       ldp = find_last_device_path (dp);
       ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE;
       ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE;
       ldp->length[0] = sizeof (*ldp);
       ldp->length[1] = 0;
-      
+
       if (compare_device_paths (dp, d->device_path) == 0)
        if (hook (p))
          {
@@ -304,7 +304,7 @@ static void
 name_devices (struct grub_efidisk_data *devices)
 {
   struct grub_efidisk_data *d;
-  
+
   /* First, identify devices by media device paths.  */
   for (d = devices; d; d = d->next)
     {
@@ -313,11 +313,11 @@ name_devices (struct grub_efidisk_data *devices)
       dp = d->last_device_path;
       if (! dp)
        continue;
-      
+
       if (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE)
        {
          int is_hard_drive = 0;
-         
+
          switch (GRUB_EFI_DEVICE_PATH_SUBTYPE (dp))
            {
            case GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE:
@@ -346,7 +346,7 @@ name_devices (struct grub_efidisk_data *devices)
 #endif
                        add_device (&cd_devices, parent);
                      }
-                   
+
                    /* Mark the parent as used.  */
                    parent->last_device_path = 0;
                  }
@@ -367,7 +367,7 @@ name_devices (struct grub_efidisk_data *devices)
     {
       grub_efi_device_path_t *dp;
       grub_efi_block_io_media_t *m;
-      
+
       dp = d->last_device_path;
       if (! dp)
        continue;
@@ -409,7 +409,7 @@ static void
 free_devices (struct grub_efidisk_data *devices)
 {
   struct grub_efidisk_data *p, *q;
-  
+
   for (p = devices; p; p = q)
     {
       q = p->next;
@@ -422,11 +422,11 @@ static void
 enumerate_disks (void)
 {
   struct grub_efidisk_data *devices;
-  
+
   devices = make_devices ();
   if (! devices)
     return;
-  
+
   name_devices (devices);
   free_devices (devices);
 }
@@ -437,7 +437,7 @@ grub_efidisk_iterate (int (*hook) (const char *name))
   struct grub_efidisk_data *d;
   char buf[16];
   int count;
-  
+
   for (d = fd_devices, count = 0; d; d = d->next, count++)
     {
       grub_sprintf (buf, "fd%d", count);
@@ -445,7 +445,7 @@ grub_efidisk_iterate (int (*hook) (const char *name))
       if (hook (buf))
        return 1;
     }
-  
+
   for (d = hd_devices, count = 0; d; d = d->next, count++)
     {
       grub_sprintf (buf, "hd%d", count);
@@ -453,7 +453,7 @@ grub_efidisk_iterate (int (*hook) (const char *name))
       if (hook (buf))
        return 1;
     }
-  
+
   for (d = cd_devices, count = 0; d; d = d->next, count++)
     {
       grub_sprintf (buf, "cd%d", count);
@@ -506,7 +506,7 @@ grub_efidisk_open (const char *name, struct grub_disk *disk)
   grub_efi_block_io_media_t *m;
 
   grub_dprintf ("efidisk", "opening %s\n", name);
-  
+
   num = get_drive_number (name);
   if (num < 0)
     return grub_errno;
@@ -565,7 +565,7 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector,
   grub_efi_disk_io_t *dio;
   grub_efi_block_io_t *bio;
   grub_efi_status_t status;
-  
+
   d = disk->data;
   dio = d->disk_io;
   bio = d->block_io;
@@ -573,14 +573,14 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector,
   grub_dprintf ("efidisk",
                "reading 0x%lx sectors at the sector 0x%llx from %s\n",
                (unsigned long) size, (unsigned long long) sector, disk->name);
-  
+
   status = efi_call_5 (dio->read, dio, bio->media->media_id,
                      (grub_efi_uint64_t) sector << GRUB_DISK_SECTOR_BITS,
                      (grub_efi_uintn_t) size << GRUB_DISK_SECTOR_BITS,
                      buf);
   if (status != GRUB_EFI_SUCCESS)
     return grub_error (GRUB_ERR_READ_ERROR, "efidisk read error");
-  
+
   return GRUB_ERR_NONE;
 }
 
@@ -593,22 +593,22 @@ grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector,
   grub_efi_disk_io_t *dio;
   grub_efi_block_io_t *bio;
   grub_efi_status_t status;
-  
+
   d = disk->data;
   dio = d->disk_io;
   bio = d->block_io;
-  
+
   grub_dprintf ("efidisk",
                "writing 0x%lx sectors at the sector 0x%llx to %s\n",
                (unsigned long) size, (unsigned long long) sector, disk->name);
-  
+
   status = efi_call_5 (dio->write, dio, bio->media->media_id,
                       (grub_efi_uint64_t) sector << GRUB_DISK_SECTOR_BITS,
                       (grub_efi_uintn_t) size << GRUB_DISK_SECTOR_BITS,
                       (void *) buf);
   if (status != GRUB_EFI_SUCCESS)
     return grub_error (GRUB_ERR_WRITE_ERROR, "efidisk write error");
-  
+
   return GRUB_ERR_NONE;
 }
 
@@ -646,13 +646,13 @@ grub_efidisk_get_device_handle (grub_disk_t disk)
 {
   struct grub_efidisk_data *d;
   char type;
-  
+
   if (disk->dev->id != GRUB_DISK_DEVICE_EFIDISK_ID)
     return 0;
-  
+
   d = disk->data;
   type = disk->name[0];
-  
+
   switch (type)
     {
     case 'f':
@@ -679,7 +679,7 @@ grub_efidisk_get_device_handle (grub_disk_t disk)
            grub_efi_hard_drive_device_path_t hd;
 
            grub_memcpy (&hd, c->last_device_path, sizeof (hd));
-           
+
            if ((GRUB_EFI_DEVICE_PATH_TYPE (c->last_device_path)
                 == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE)
                && (GRUB_EFI_DEVICE_PATH_SUBTYPE (c->last_device_path)
@@ -692,14 +692,14 @@ grub_efidisk_get_device_handle (grub_disk_t disk)
                handle = c->handle;
                return 1;
              }
-             
+
            return 0;
          }
-       
+
        devices = make_devices ();
        iterate_child_devices (devices, d, find_partition);
        free_devices (devices);
-       
+
        if (handle != 0)
          return handle;
       }
@@ -708,7 +708,7 @@ grub_efidisk_get_device_handle (grub_disk_t disk)
     default:
       break;
     }
-  
+
   return 0;
 }
 
@@ -750,7 +750,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle)
          if (disk->dev->id == GRUB_DISK_DEVICE_EFIDISK_ID)
            {
              struct grub_efidisk_data *d;
-             
+
              d = disk->data;
              if (compare_device_paths (d->device_path, dup_dp) == 0)
                {
@@ -798,7 +798,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle)
       /* Find a partition which matches the hard drive device path.  */
       grub_memcpy (&hd, ldp, sizeof (hd));
       grub_partition_iterate (parent, find_partition);
-      
+
       if (! partition_name)
        {
          grub_disk_close (parent);
@@ -824,11 +824,11 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle)
       /* This should be an entire disk.  */
       auto int find_disk (const char *name);
       char *device_name = 0;
-      
+
       int find_disk (const char *name)
        {
          grub_disk_t disk;
-         
+
          disk = grub_disk_open (name);
          if (! disk)
            return 1;
@@ -836,7 +836,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle)
          if (disk->id == GRUB_DISK_DEVICE_EFIDISK_ID)
            {
              struct grub_efidisk_data *d;
-             
+
              d = disk->data;
              if (compare_device_paths (d->device_path, dp) == 0)
                {
@@ -848,9 +848,9 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle)
 
          grub_disk_close (disk);
          return 0;
-         
+
        }
-      
+
       grub_efidisk_iterate (find_disk);
       return device_name;
     }
index e9888a7e360e93e127fe40716fdb039196748459..6901dbacf645decd30de69231728328f0ceb5df6 100644 (file)
@@ -42,12 +42,12 @@ search_fs_uuid (const char *key, unsigned long *count)
       if (dev)
        {
          grub_fs_t fs;
-         
+
          fs = grub_fs_probe (dev);
          if (fs && fs->uuid)
            {
              char *uuid;
-             
+
              (fs->uuid) (dev, &uuid);
              if (grub_errno == GRUB_ERR_NONE && uuid)
                {
@@ -62,16 +62,16 @@ search_fs_uuid (const char *key, unsigned long *count)
                  grub_free (uuid);
                }
            }
-         
+
          grub_device_close (dev);
        }
 
       grub_errno = GRUB_ERR_NONE;
       return 0;
     }
-  
+
   grub_device_iterate (iterate_device);
-  
+
   return ret;
 }
 
index 0229278f4e5d5990e3f5d9ccfd952be625389618..c4f3e715063974807eeb0b1449558ef6ba533f0a 100644 (file)
@@ -42,7 +42,7 @@ grub_host_open (const char *name, grub_disk_t disk)
 
   disk->total_sectors = 0;
   disk->id = (unsigned long) "host";
-  
+
   disk->has_partitions = 0;
   disk->data = 0;
 
index f9663305aaca65f40712448f7e8b0efef02c91b7..09f0ce7396a39771b8ebe611f5f0e2cf370fcff8 100644 (file)
@@ -36,14 +36,14 @@ grub_biosdisk_get_drive (const char *name)
 
   if ((name[0] != 'f' && name[0] != 'h') || name[1] != 'd')
     goto fail;
-    
+
   drive = grub_strtoul (name + 2, 0, 10);
   if (grub_errno != GRUB_ERR_NONE)
     goto fail;
 
   if (name[0] == 'h')
     drive += 0x80;
-  
+
   return (int) drive ;
 
  fail:
@@ -75,7 +75,7 @@ grub_biosdisk_iterate (int (*hook) (const char *name))
          grub_dprintf ("disk", "Read error when probing drive 0x%2x\n", drive);
          break;
        }
-      
+
       if (grub_biosdisk_call_hook (hook, drive))
        return 1;
     }
@@ -108,11 +108,11 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
 
   disk->has_partitions = ((drive & 0x80) && (drive != cd_drive));
   disk->id = drive;
-  
+
   data = (struct grub_biosdisk_data *) grub_malloc (sizeof (*data));
   if (! data)
     return grub_errno;
-  
+
   data->drive = drive;
   data->flags = 0;
 
@@ -126,7 +126,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
     {
       /* HDD */
       int version;
-      
+
       version = grub_biosdisk_check_int13_extensions (drive);
       if (version)
        {
@@ -162,9 +162,9 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
            {
              data->sectors = 63;
              data->heads = 255;
-             data->cylinders 
-               = grub_divmod64 (total_sectors 
-                                + data->heads * data->sectors - 1, 
+             data->cylinders
+               = grub_divmod64 (total_sectors
+                                + data->heads * data->sectors - 1,
                                 data->heads * data->sectors, 0);
            }
          else
@@ -180,7 +180,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
 
   disk->total_sectors = total_sectors;
   disk->data = data;
-  
+
   return GRUB_ERR_NONE;
 }
 
@@ -202,11 +202,11 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk,
                  unsigned segment)
 {
   struct grub_biosdisk_data *data = disk->data;
-  
+
   if (data->flags & GRUB_BIOSDISK_FLAG_LBA)
     {
       struct grub_biosdisk_dap *dap;
-      
+
       dap = (struct grub_biosdisk_dap *) (GRUB_MEMORY_MACHINE_SCRATCH_ADDR
                                          + (data->sectors
                                             << GRUB_DISK_SECTOR_BITS));
@@ -246,7 +246,7 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk,
     {
       unsigned coff, hoff, soff;
       unsigned head;
-      
+
       /* It is impossible to reach over 8064 MiB (a bit less than LBA24) with
         the traditional CHS access.  */
       if (sector >
index 7904cc0c0271ea1c20978470b434296ac6b9ccac..ca257d6d125fae2c04c29553530331eff48a10e5 100644 (file)
@@ -251,7 +251,7 @@ grub_ofdisk_read (grub_disk_t disk, grub_disk_addr_t sector,
   if (actual != actual)
     return grub_error (GRUB_ERR_READ_ERROR, "Read error on block: %llu",
                       (long long) sector);
-    
+
   return 0;
 }
 
index 3cb2bf0ab0fb9d551ef0f48e820313550a1c6cd6..29805182e328b45331f0fd1ac2da5adef3b5494a 100644 (file)
@@ -32,7 +32,7 @@ struct grub_loopback
   struct grub_loopback *next;
 };
 
-static struct grub_loopback *loopback_list; 
+static struct grub_loopback *loopback_list;
 
 static const struct grub_arg_option options[] =
   {
@@ -54,17 +54,17 @@ delete_loopback (const char *name)
        prev = &dev->next, dev = dev->next)
     if (grub_strcmp (dev->devname, name) == 0)
       break;
-  
+
   if (! dev)
     return grub_error (GRUB_ERR_BAD_DEVICE, "Device not found");
-  
+
   /* Remove the device from the list.  */
   *prev = dev->next;
 
   grub_free (dev->devname);
   grub_free (dev->filename);
   grub_free (dev);
-  
+
   return 0;
 }
 
@@ -75,56 +75,56 @@ grub_cmd_loopback (grub_extcmd_t cmd, int argc, char **args)
   struct grub_arg_list *state = state = cmd->state;
   grub_file_t file;
   struct grub_loopback *newdev;
-  
+
   if (argc < 1)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required");
-  
+
   /* Check if `-d' was used.  */
   if (state[0].set)
       return delete_loopback (args[0]);
-  
+
   if (argc < 2)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
 
   file = grub_file_open (args[1]);
   if (! file)
     return grub_errno;
-  
+
   /* Close the file, the only reason for opening it is validation.  */
   grub_file_close (file);
-  
+
   /* First try to replace the old device.  */
   for (newdev = loopback_list; newdev; newdev = newdev->next)
     if (grub_strcmp (newdev->devname, args[0]) == 0)
       break;
-  
+
   if (newdev)
     {
       char *newname = grub_strdup (args[1]);
       if (! newname)
        return grub_errno;
-      
+
       grub_free (newdev->filename);
       newdev->filename = newname;
-      
+
       /* Set has_partitions when `--partitions' was used.  */
       newdev->has_partitions = state[1].set;
-      
+
       return 0;
     }
-  
+
   /* Unable to replace it, make a new entry.  */
   newdev = grub_malloc (sizeof (struct grub_loopback));
   if (! newdev)
     return grub_errno;
-  
+
   newdev->devname = grub_strdup (args[0]);
   if (! newdev->devname)
     {
       grub_free (newdev);
       return grub_errno;
     }
-  
+
   newdev->filename = grub_strdup (args[1]);
   if (! newdev->filename)
     {
@@ -132,14 +132,14 @@ grub_cmd_loopback (grub_extcmd_t cmd, int argc, char **args)
       grub_free (newdev);
       return grub_errno;
     }
-  
+
   /* Set has_partitions when `--partitions' was used.  */
   newdev->has_partitions = state[1].set;
-  
+
   /* Add the new entry to the list.  */
   newdev->next = loopback_list;
   loopback_list = newdev;
-  
+
   return 0;
 }
 
@@ -161,26 +161,26 @@ grub_loopback_open (const char *name, grub_disk_t disk)
 {
   grub_file_t file;
   struct grub_loopback *dev;
-    
+
   for (dev = loopback_list; dev; dev = dev->next)
     if (grub_strcmp (dev->devname, name) == 0)
       break;
-  
+
   if (! dev)
     return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't open device");
 
   file = grub_file_open (dev->filename);
   if (! file)
     return grub_errno;
-  
+
   /* Use the filesize for the disk size, round up to a complete sector.  */
   disk->total_sectors = ((file->size + GRUB_DISK_SECTOR_SIZE - 1)
                         / GRUB_DISK_SECTOR_SIZE);
   disk->id = (unsigned long) dev;
-  
+
   disk->has_partitions = dev->has_partitions;
   disk->data = file;
-  
+
   return 0;
 }
 
@@ -188,7 +188,7 @@ static void
 grub_loopback_close (grub_disk_t disk)
 {
   grub_file_t file = (grub_file_t) disk->data;
-  
+
   grub_file_close (file);
 }
 
@@ -198,13 +198,13 @@ grub_loopback_read (grub_disk_t disk, grub_disk_addr_t sector,
 {
   grub_file_t file = (grub_file_t) disk->data;
   grub_off_t pos;
-  
+
   grub_file_seek (file, sector << GRUB_DISK_SECTOR_BITS);
-  
+
   grub_file_read (file, buf, size << GRUB_DISK_SECTOR_BITS);
   if (grub_errno)
     return grub_errno;
-  
+
   /* In case there is more data read than there is available, in case
      of files that are not a multiple of GRUB_DISK_SECTOR_SIZE, fill
      the rest with zeros.  */
@@ -214,7 +214,7 @@ grub_loopback_read (grub_disk_t disk, grub_disk_addr_t sector,
       grub_size_t amount = pos - file->size;
       grub_memset (buf + (size << GRUB_DISK_SECTOR_BITS) - amount, 0, amount);
     }
-  
+
   return 0;
 }
 
index 9f6c197fead70b51191c93ecd516a7ae1aadf891..6707a406803490a60529781d1c51feabdeca4f86 100644 (file)
@@ -101,7 +101,7 @@ grub_lvm_open (const char *name, grub_disk_t disk)
   disk->id = lv->number;
   disk->data = lv;
   disk->total_sectors = lv->size;
-  
+
   return 0;
 }
 
@@ -174,7 +174,7 @@ grub_lvm_read (grub_disk_t disk, grub_disk_addr_t sector,
 
       stripe += stripenr;
       pv = stripe->pv;
-      
+
       seg_offset = ((grub_uint64_t) stripe->start
                    * (grub_uint64_t) vg->extent_size) + pv->start;
 
@@ -189,7 +189,7 @@ grub_lvm_read (grub_disk_t disk, grub_disk_addr_t sector,
   else
     err = grub_error (GRUB_ERR_UNKNOWN_DEVICE,
                      "Physical volume %s not found", pv->name);
-  
+
   return err;
 }
 
@@ -220,7 +220,7 @@ grub_lvm_scan_device (const char *name)
   unsigned int i, j, vgname_len;
   struct grub_lvm_vg *vg;
   struct grub_lvm_pv *pv;
-  
+
   disk = grub_disk_open (name);
   if (!disk)
     return 0;
@@ -231,7 +231,7 @@ grub_lvm_scan_device (const char *name)
       err = grub_disk_read (disk, i, 0, sizeof(buf), buf);
       if (err)
        goto fail;
-      
+
       if ((! grub_strncmp ((char *)lh->id, GRUB_LVM_LABEL_ID,
                           sizeof (lh->id)))
          && (! grub_strncmp ((char *)lh->type, GRUB_LVM_LVM2_LABEL,
@@ -242,7 +242,7 @@ grub_lvm_scan_device (const char *name)
   /* Return if we didn't find a label. */
   if (i == GRUB_LVM_LABEL_SCAN_SECTORS)
     goto fail;
-  
+
   pvh = (struct grub_lvm_pv_header *) (buf + grub_le_to_cpu32(lh->offset_xl));
 
   for (i = 0, j = 0; i < GRUB_LVM_ID_LEN; i++)
@@ -264,7 +264,7 @@ grub_lvm_scan_device (const char *name)
     {
       grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
                  "We don't support multiple LVM data areas");
-                 
+
       goto fail;
     }
 
@@ -272,12 +272,12 @@ grub_lvm_scan_device (const char *name)
   mda_offset = grub_le_to_cpu64 (dlocn->offset);
   mda_size = grub_le_to_cpu64 (dlocn->size);
   dlocn++;
-  
+
   if (dlocn->offset)
     {
       grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
                  "We don't support multiple LVM metadata areas");
-                 
+
       goto fail;
     }
 
@@ -361,39 +361,39 @@ grub_lvm_scan_device (const char *name)
       if (p)
        {
          p += sizeof ("physical_volumes {") - 1;
-         
+
          /* Add all the pvs to the volume group. */
          while (1)
            {
              int s;
              while (grub_isspace (*p))
                p++;
-             
+
              if (*p == '}')
                break;
-             
+
              pv = grub_malloc (sizeof (*pv));
              q = p;
              while (*q != ' ')
                q++;
-             
+
              s = q - p;
              pv->name = grub_malloc (s + 1);
              grub_memcpy (pv->name, p, s);
              pv->name[s] = '\0';
-             
+
              p = grub_strstr (p, "id = \"");
              if (p == NULL)
                goto pvs_fail;
              p += sizeof("id = \"") - 1;
-             
+
              grub_memcpy (pv->id, p, GRUB_LVM_ID_STRLEN);
              pv->id[GRUB_LVM_ID_STRLEN] = '\0';
-             
+
              pv->start = grub_lvm_getvalue (&p, "pe_start = ");
              if (p == NULL)
                goto pvs_fail;
-             
+
              p = grub_strchr (p, '}');
              if (p == NULL)
                goto pvs_fail;
@@ -402,7 +402,7 @@ grub_lvm_scan_device (const char *name)
              pv->disk = NULL;
              pv->next = vg->pvs;
              vg->pvs = pv;
-             
+
              continue;
            pvs_fail:
              grub_free (pv->name);
@@ -415,49 +415,49 @@ grub_lvm_scan_device (const char *name)
       if (p)
        {
          p += 18;
-         
+
          /* And add all the lvs to the volume group. */
          while (1)
            {
              int s;
              struct grub_lvm_lv *lv;
              struct grub_lvm_segment *seg;
-             
+
              while (grub_isspace (*p))
                p++;
-             
+
              if (*p == '}')
                break;
-             
+
              lv = grub_malloc (sizeof (*lv));
-             
+
              q = p;
              while (*q != ' ')
                q++;
-             
+
              s = q - p;
              lv->name = grub_malloc (vgname_len + 1 + s + 1);
              grub_memcpy (lv->name, vgname, vgname_len);
              lv->name[vgname_len] = '-';
              grub_memcpy (lv->name + vgname_len + 1, p, s);
              lv->name[vgname_len + 1 + s] = '\0';
-             
+
              lv->size = 0;
-             
+
              lv->segment_count = grub_lvm_getvalue (&p, "segment_count = ");
              if (p == NULL)
                goto lvs_fail;
              lv->segments = grub_malloc (sizeof (*seg) * lv->segment_count);
              seg = lv->segments;
-             
+
              for (i = 0; i < lv->segment_count; i++)
                {
                  struct grub_lvm_stripe *stripe;
-                 
+
                  p = grub_strstr (p, "segment");
                  if (p == NULL)
                    goto lvs_segment_fail;
-                 
+
                  seg->start_extent = grub_lvm_getvalue (&p, "start_extent = ");
                  if (p == NULL)
                    goto lvs_segment_fail;
@@ -467,25 +467,25 @@ grub_lvm_scan_device (const char *name)
                  seg->stripe_count = grub_lvm_getvalue (&p, "stripe_count = ");
                  if (p == NULL)
                    goto lvs_segment_fail;
-                 
+
                  lv->size += seg->extent_count * vg->extent_size;
-                 
+
                  if (seg->stripe_count != 1)
                    seg->stripe_size = grub_lvm_getvalue (&p, "stripe_size = ");
-                 
+
                  seg->stripes = grub_malloc (sizeof (*stripe)
                                              * seg->stripe_count);
                  stripe = seg->stripes;
-                 
+
                  p = grub_strstr (p, "stripes = [");
                  if (p == NULL)
                    goto lvs_segment_fail2;
                  p += sizeof("stripes = [") - 1;
-                 
+
                  for (j = 0; j < seg->stripe_count; j++)
                    {
                      char *pvname;
-                     
+
                      p = grub_strchr (p, '"');
                      if (p == NULL)
                        continue;
@@ -494,14 +494,14 @@ grub_lvm_scan_device (const char *name)
                        q++;
 
                      s = q - p;
-                     
+
                      pvname = grub_malloc (s + 1);
                       if (pvname == NULL)
                         goto lvs_segment_fail2;
-                      
+
                      grub_memcpy (pvname, p, s);
                      pvname[s] = '\0';
-                     
+
                      if (vg->pvs)
                        for (pv = vg->pvs; pv; pv = pv->next)
                          {
@@ -511,16 +511,16 @@ grub_lvm_scan_device (const char *name)
                                break;
                              }
                          }
-                     
+
                      grub_free(pvname);
-                     
+
                      stripe->start = grub_lvm_getvalue (&p, ",");
                      if (p == NULL)
                        continue;
-                     
+
                      stripe++;
                    }
-                 
+
                  seg++;
 
                  continue;
@@ -535,7 +535,7 @@ grub_lvm_scan_device (const char *name)
              if (p == NULL)
                goto lvs_fail;
              p += 3;
-             
+
              lv->number = lv_count++;
              lv->vg = vg;
              lv->next = vg->lvs;
index 978eae553a04bfd1068283591e6024ba81c0e131..4a0470837b4a1731fe5b70403436b2dfc0fbe16b 100644 (file)
@@ -104,7 +104,7 @@ GRUB_MOD_INIT(memdisk)
 
       return 0;
     }
-  
+
   grub_module_iterate (hook);
 }
 
index aac0f331a9de23cf1b9aaf63e4fb9b5bd61a04d5..c4d0857fd3be8ed90e45a5b64c4c8156a083efff 100644 (file)
@@ -77,7 +77,7 @@ static int
 grub_raid_iterate (int (*hook) (const char *name))
 {
   struct grub_raid_array *array;
-  
+
   for (array = array_list; array != NULL; array = array->next)
     {
       if (grub_is_array_readable (array))
@@ -95,7 +95,7 @@ grub_raid_memberlist (grub_disk_t disk)
   struct grub_raid_array *array = disk->data;
   grub_disk_memberlist_t list = NULL, tmp;
   unsigned int i;
-  
+
   for (i = 0; i < array->total_devs; i++)
     if (array->device[i])
       {
@@ -104,7 +104,7 @@ grub_raid_memberlist (grub_disk_t disk)
         tmp->next = list;
         list = tmp;
       }
-  
+
   return list;
 }
 #endif
@@ -114,7 +114,7 @@ grub_raid_open (const char *name, grub_disk_t disk)
 {
   struct grub_raid_array *array;
   unsigned n;
-  
+
   for (array = array_list; array != NULL; array = array->next)
     {
       if (!grub_strcmp (array->name, name))
@@ -161,7 +161,7 @@ grub_raid_open (const char *name, grub_disk_t disk)
 
   grub_dprintf ("raid", "%s: level=%d, total_sectors=%lld\n", name,
                array->level, (unsigned long long) disk->total_sectors);
-  
+
   return 0;
 }
 
@@ -348,7 +348,7 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector,
           p = array->total_devs - n;
 
        read_sector *= array->chunk_size;
-       
+
        while (1)
          {
             grub_size_t read_size;
@@ -405,7 +405,7 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector,
                 if (err)
                   break;
               }
-           
+
            buf += read_size << GRUB_DISK_SECTOR_BITS;
            size -= read_size;
            if (! size)
@@ -460,7 +460,7 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector,
       }
       break;
     }
-  
+
   return err;
 }
 
@@ -478,7 +478,7 @@ insert_array (grub_disk_t disk, struct grub_raid_array *new_array,
               const char *scanner_name)
 {
   struct grub_raid_array *array = 0, *p;
-  
+
   /* See whether the device is part of an array we have already seen a
      device from. */
   for (p = array_list; p != NULL; p = p->next)
@@ -524,7 +524,7 @@ insert_array (grub_disk_t disk, struct grub_raid_array *new_array,
       *array = *new_array;
       array->nr_devs = 0;
       grub_memset (&array->device, 0, sizeof (array->device));
-      
+
       /* Check whether we don't have multiple arrays with the same number. */
       for (p = array_list; p != NULL; p = p->next)
         {
@@ -635,7 +635,7 @@ grub_raid_scan_device (int head_only)
 
       return 0;
     }
-  
+
   grub_device_iterate (&hook);
 }
 
@@ -649,7 +649,7 @@ free_array (void)
     {
       struct grub_raid_array *p;
       int i;
-         
+
       p = array;
       array = array->next;
 
@@ -664,7 +664,7 @@ free_array (void)
 
   array_list = 0;
 }
-  
+
 void
 grub_raid_register (grub_raid_t raid)
 {
index 081d9c671e5b158b3ed94eaa0d5ff0603c7392c0..046dcb8eba336eee823d5150040f04700d8c9cdc 100644 (file)
@@ -301,7 +301,7 @@ grub_scsi_open (const char *name, grub_disk_t disk)
                                 << GRUB_DISK_SECTOR_BITS);
 
          grub_dprintf ("scsi", "capacity=%llu, blksize=%d\n",
-                       (unsigned long long) disk->total_sectors, 
+                       (unsigned long long) disk->total_sectors,
                        scsi->blocksize);
 
          return GRUB_ERR_NONE;
index 67e6ba25f3bfb76b7e478d8799336c59b7665089..147891956544a84091d19a68c476f275ff8766c8 100644 (file)
@@ -267,7 +267,7 @@ grub_usbms_transfer (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd,
                             "can't read from USB Mass Storage device");
        }
     }
-  else 
+  else
     {
       err = grub_usb_bulk_write (dev->dev, dev->in->endp_addr & 15, size, buf);
       grub_dprintf ("usb", "write: %d %d\n", err, GRUB_USB_ERR_STALL);
@@ -379,7 +379,7 @@ static struct grub_scsi_dev grub_usbms_dev =
     .close = grub_usbms_close,
     .read = grub_usbms_read,
     .write = grub_usbms_write
-  }; 
+  };
 
 GRUB_MOD_INIT(usbms)
 {
index b8f74a039b1c09e8d97f3e5ba2f468c4afdc2be6..11603930ea0013ada8966133945bfe7d71fa2f5e 100644 (file)
@@ -664,7 +664,7 @@ from GRUB and you don't have to make a floppy or hard disk image file,
 which can cause compatibility problems.
 
 For booting from a CD-ROM, GRUB uses a special Stage 2 called
-@file{stage2_eltorito}. The only GRUB files you need to have in your 
+@file{stage2_eltorito}. The only GRUB files you need to have in your
 bootable CD-ROM are this @file{stage2_eltorito} and optionally a config file
 @file{menu.lst}. You don't need to use @file{stage1} or @file{stage2},
 because El Torito is quite different from the standard boot process.
@@ -702,13 +702,13 @@ $ @kbd{mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \
 
 This produces a file named @file{grub.iso}, which then can be burned
 into a CD (or a DVD).  @kbd{mkisofs} has already set up the disc to boot
-from the @kbd{boot/grub/stage2_eltorito} file, so there is no need to 
+from the @kbd{boot/grub/stage2_eltorito} file, so there is no need to
 setup GRUB on the disc.  (Note that the @kbd{-boot-load-size 4} bit is
 required for compatibility with the BIOS on many older machines.)
 
 You can use the device @samp{(cd)} to access a CD-ROM in your
-config file. This is not required; GRUB automatically sets the root device 
-to @samp{(cd)} when booted from a CD-ROM. It is only necessary to refer to 
+config file. This is not required; GRUB automatically sets the root device
+to @samp{(cd)} when booted from a CD-ROM. It is only necessary to refer to
 @samp{(cd)} if you want to access other drives as well.
 
 
@@ -2414,7 +2414,7 @@ is to be found; if specified it takes precedence over @var{unit}.
 be in the range 5-8 and stop bits must be 1 or 2. Default is 8 data
 bits and one stop bit. @var{parity} is one of @samp{no}, @samp{odd},
 @samp{even} and defaults to @samp{no}. The option @option{--device}
-can only be used in the grub shell and is used to specify the 
+can only be used in the grub shell and is used to specify the
 tty device to be used in the host operating system (@pxref{Invoking the
 grub shell}).
 
@@ -2431,8 +2431,8 @@ support. See also @ref{Serial terminal}.
 
 @deffn Command setkey [to_key from_key]
 Change the keyboard map. The key @var{from_key} is mapped to the key
-@var{to_key}. If no argument is specified, reset key mappings. Note that 
-this command @emph{does not} exchange the keys. If you want to exchange 
+@var{to_key}. If no argument is specified, reset key mappings. Note that
+this command @emph{does not} exchange the keys. If you want to exchange
 the keys, run this command again with the arguments exchanged, like this:
 
 @example
index c49e670b02db360f171da3efcfb64ee430086c0a..0135d0c7c6bdfc57f54a70f30f84034f138057bc 100644 (file)
                % We don't want .vr (or whatever) entries like this:
                % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
                % "\acronym" won't work when it's read back in;
-               % it needs to be 
+               % it needs to be
                % {\code {{\tt \backslashcurfont }acronym}
     \shipout\vbox{%
       % Do this early so pdf references go to the beginning of the page.
 \def\?{?\spacefactor=\endofsentencespacefactor\space}
 
 % @frenchspacing on|off  says whether to put extra space after punctuation.
-% 
+%
 \def\onword{on}
 \def\offword{off}
 %
@@ -1260,7 +1260,7 @@ where each line of input produces a line of output.}
 % that's what we do).
 
 % double active backslashes.
-% 
+%
 {\catcode`\@=0 \catcode`\\=\active
  @gdef@activebackslashdouble{%
    @catcode`@\=@active
@@ -1272,11 +1272,11 @@ where each line of input produces a line of output.}
 % us) handles it with this amazing macro to replace tokens, with minor
 % changes for Texinfo.  It is included here under the GPL by permission
 % from the author, Heiko Oberdiek.
-% 
+%
 % #1 is the tokens to replace.
 % #2 is the replacement.
 % #3 is the control sequence with the string.
-% 
+%
 \def\HyPsdSubst#1#2#3{%
   \def\HyPsdReplace##1#1##2\END{%
     ##1%
@@ -1542,7 +1542,7 @@ output) for that.)}
       % tried to figure out what each command should do in the context
       % of @url.  for now, just make @/ a no-op, that's the only one
       % people have actually reported a problem with.
-      % 
+      %
       \normalturnoffactive
       \def\@{@}%
       \let\/=\empty
@@ -1939,7 +1939,7 @@ end
 
 % Definitions for a main text size of 11pt.  This is the default in
 % Texinfo.
-% 
+%
 \def\definetextfontsizexi{%
 % Text fonts (11.2pt, magstep1).
 \def\textnominalsize{11pt}
@@ -2072,7 +2072,7 @@ end
 % section, chapter, etc., sizes following suit.  This is for the GNU
 % Press printing of the Emacs 22 manual.  Maybe other manuals in the
 % future.  Used with @smallbook, which sets the leading to 12pt.
-% 
+%
 \def\definetextfontsizex{%
 % Text fonts (10pt).
 \def\textnominalsize{10pt}
@@ -2163,7 +2163,7 @@ end
 \setfont\secsf\sfbshape{12}{1000}{OT1}
 \let\secbf\secrm
 \setfont\secsc\scbshape{10}{\magstep1}{OT1}
-\font\seci=cmmi12 
+\font\seci=cmmi12
 \font\secsy=cmsy10 scaled \magstep1
 \def\sececsize{1200}
 
@@ -2207,7 +2207,7 @@ end
 % We provide the user-level command
 %   @fonttextsize 10
 % (or 11) to redefine the text font size.  pt is assumed.
-% 
+%
 \def\xword{10}
 \def\xiword{11}
 %
@@ -2217,7 +2217,7 @@ end
   %
   % Set \globaldefs so that documents can use this inside @tex, since
   % makeinfo 4.8 does not support it, but we need it nonetheless.
-  % 
+  %
  \begingroup \globaldefs=1
   \ifx\textsizearg\xword \definetextfontsizex
   \else \ifx\textsizearg\xiword \definetextfontsizexi
@@ -2503,7 +2503,7 @@ end
 % each of the four underscores in __typeof__.  This is undesirable in
 % some manuals, especially if they don't have long identifiers in
 % general.  @allowcodebreaks provides a way to control this.
-% 
+%
 \newif\ifallowcodebreaks  \allowcodebreakstrue
 
 \def\keywordtrue{true}
@@ -2634,7 +2634,7 @@ end
 % @acronym for "FBI", "NATO", and the like.
 % We print this one point size smaller, since it's intended for
 % all-uppercase.
-% 
+%
 \def\acronym#1{\doacronym #1,,\finish}
 \def\doacronym#1,#2,#3\finish{%
   {\selectfonts\lsize #1}%
@@ -2646,7 +2646,7 @@ end
 
 % @abbr for "Comput. J." and the like.
 % No font change, but don't do end-of-sentence spacing.
-% 
+%
 \def\abbr#1{\doabbr #1,,\finish}
 \def\doabbr#1,#2,#3\finish{%
   {\plainfrenchspacing #1}%
@@ -2665,43 +2665,43 @@ end
 % Theiling, which support regular, slanted, bold and bold slanted (and
 % "outlined" (blackboard board, sort of) versions, which we don't need).
 % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
-% 
+%
 % Although only regular is the truly official Euro symbol, we ignore
 % that.  The Euro is designed to be slightly taller than the regular
 % font height.
-% 
+%
 % feymr - regular
 % feymo - slanted
 % feybr - bold
 % feybo - bold slanted
-% 
+%
 % There is no good (free) typewriter version, to my knowledge.
 % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
 % Hmm.
-% 
+%
 % Also doesn't work in math.  Do we need to do math with euro symbols?
 % Hope not.
-% 
-% 
+%
+%
 \def\euro{{\eurofont e}}
 \def\eurofont{%
   % We set the font at each command, rather than predefining it in
   % \textfonts and the other font-switching commands, so that
   % installations which never need the symbol don't have to have the
   % font installed.
-  % 
+  %
   % There is only one designed size (nominal 10pt), so we always scale
   % that to the current nominal size.
-  % 
+  %
   % By the way, simply using "at 1em" works for cmr10 and the like, but
   % does not work for cmbx10 and other extended/shrunken fonts.
-  % 
+  %
   \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
   %
-  \ifx\curfontstyle\bfstylename 
+  \ifx\curfontstyle\bfstylename
     % bold:
     \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
-  \else 
+  \else
     % regular:
     \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
   \fi
@@ -2754,7 +2754,7 @@ end
 % Laurent Siebenmann reports \Orb undefined with:
 %  Textures 1.7.7 (preloaded format=plain 93.10.14)  (68K)  16 APR 2004 02:38
 % so we'll define it if necessary.
-% 
+%
 \ifx\Orb\undefined
 \def\Orb{\mathhexbox20D}
 \fi
@@ -3102,7 +3102,7 @@ end
     % cause the example and the item to crash together.  So we use this
     % bizarre value of 10001 as a signal to \aboveenvbreak to insert
     % \parskip glue after all.  Section titles are handled this way also.
-    % 
+    %
     \penalty 10001
     \endgroup
     \itemxneedsnegativevskipfalse
@@ -3898,7 +3898,7 @@ end
   % processing continues to some further point.  On the other hand, it
   % seems \endinput does not hurt in the printed index arg, since that
   % is still getting written without apparent harm.
-  % 
+  %
   % Sample source (mac-idx3.tex, reported by Graham Percival to
   % help-texinfo, 22may06):
   % @macro funindex {WORD}
@@ -3906,12 +3906,12 @@ end
   % @end macro
   % ...
   % @funindex commtest
-  % 
+  %
   % The above is not enough to reproduce the bug, but it gives the flavor.
-  % 
+  %
   % Sample whatsit resulting:
   % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
-  % 
+  %
   % So:
   \let\endinput = \empty
   %
@@ -4167,11 +4167,11 @@ end
   % makeinfo does not expand macros in the argument to @deffn, which ends up
   % writing an index entry, and texindex isn't prepared for an index sort entry
   % that starts with \.
-  % 
+  %
   % Since macro invocations are followed by braces, we can just redefine them
   % to take a single TeX argument.  The case of a macro invocation that
   % goes to end-of-line is not handled.
-  % 
+  %
   \macrolist
 }
 
@@ -4299,7 +4299,7 @@ end
     % to re-insert the same penalty (values >10000 are used for various
     % signals); since we just inserted a non-discardable item, any
     % following glue (such as a \parskip) would be a breakpoint.  For example:
-    % 
+    %
     %   @deffn deffn-whatever
     %   @vindex index-whatever
     %   Description.
@@ -5365,11 +5365,11 @@ end
   % glue accumulate.  (Not a breakpoint because it's preceded by a
   % discardable item.)
   \vskip-\parskip
-  % 
+  %
   % This is purely so the last item on the list is a known \penalty >
   % 10000.  This is so \startdefun can avoid allowing breakpoints after
   % section headings.  Otherwise, it would insert a valid breakpoint between:
-  % 
+  %
   %   @section sec-whatever
   %   @deffn def-whatever
   \penalty 10001
@@ -5427,7 +5427,7 @@ end
 % These characters do not print properly in the Computer Modern roman
 % fonts, so we must take special care.  This is more or less redundant
 % with the Texinfo input format setup at the end of this file.
-% 
+%
 \def\activecatcodes{%
   \catcode`\"=\active
   \catcode`\$=\active
@@ -5477,7 +5477,7 @@ end
 
 % redefined for the two-volume lispref.  We always output on
 % \jobname.toc even if this is redefined.
-% 
+%
 \def\tocreadfilename{\jobname.toc}
 
 % Normal (long) toc.
@@ -6032,8 +6032,8 @@ end
 % from cmtt (char 0x0d).  The undirected quote is ugly, so don't make it
 % the default, but it works for pasting with more pdf viewers (at least
 % evince), the lilypond developers report.  xpdf does work with the
-% regular 0x27.  
-% 
+% regular 0x27.
+%
 \def\codequoteright{%
   \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
     \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
@@ -6045,7 +6045,7 @@ end
 % and a similar option for the left quote char vs. a grave accent.
 % Modern fonts display ASCII 0x60 as a grave accent, so some people like
 % the code environments to do likewise.
-% 
+%
 \def\codequoteleft{%
   \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
     \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
@@ -6576,7 +6576,7 @@ end
 % This does \let #1 = #2, with \csnames; that is,
 %   \let \csname#1\endcsname = \csname#2\endcsname
 % (except of course we have to play expansion games).
-% 
+%
 \def\cslet#1#2{%
   \expandafter\let
   \csname#1\expandafter\endcsname
@@ -7734,7 +7734,7 @@ end
 %
 % If they passed de_DE, and txi-de_DE.tex doesn't exist,
 % try txi-de.tex.
-% 
+%
 \def\documentlanguagetrywithoutunderscore#1_#2\finish{%
   \openin 1 txi-#1.tex
   \ifeof 1
@@ -7790,7 +7790,7 @@ should work if nowhere else does.}
      \setnonasciicharscatcode\active
      \lattwochardefs
   %
-  \else \ifx \declaredencoding \latone 
+  \else \ifx \declaredencoding \latone
      \setnonasciicharscatcode\active
      \latonechardefs
   %
@@ -7802,7 +7802,7 @@ should work if nowhere else does.}
      \setnonasciicharscatcode\active
      \utfeightchardefs
   %
-  \else 
+  \else
     \message{Unknown document encoding #1, ignoring.}%
   %
   \fi % utfeight
@@ -7814,7 +7814,7 @@ should work if nowhere else does.}
 
 % A message to be logged when using a character that isn't available
 % the default font encoding (OT1).
-% 
+%
 \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
 
 % Take account of \c (plain) vs. \, (Texinfo) difference.
@@ -7827,21 +7827,21 @@ should work if nowhere else does.}
 %
 % Latin1 (ISO-8859-1) character definitions.
 \def\latonechardefs{%
-  \gdef^^a0{~} 
+  \gdef^^a0{~}
   \gdef^^a1{\exclamdown}
-  \gdef^^a2{\missingcharmsg{CENT SIGN}} 
+  \gdef^^a2{\missingcharmsg{CENT SIGN}}
   \gdef^^a3{{\pounds}}
   \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
   \gdef^^a5{\missingcharmsg{YEN SIGN}}
-  \gdef^^a6{\missingcharmsg{BROKEN BAR}} 
+  \gdef^^a6{\missingcharmsg{BROKEN BAR}}
   \gdef^^a7{\S}
-  \gdef^^a8{\"{}} 
-  \gdef^^a9{\copyright} 
+  \gdef^^a8{\"{}}
+  \gdef^^a9{\copyright}
   \gdef^^aa{\ordf}
-  \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}} 
+  \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}}
   \gdef^^ac{$\lnot$}
-  \gdef^^ad{\-} 
-  \gdef^^ae{\registeredsymbol} 
+  \gdef^^ad{\-}
+  \gdef^^ae{\registeredsymbol}
   \gdef^^af{\={}}
   %
   \gdef^^b0{\textdegree}
@@ -7868,7 +7868,7 @@ should work if nowhere else does.}
   \gdef^^c2{\^A}
   \gdef^^c3{\~A}
   \gdef^^c4{\"A}
-  \gdef^^c5{\ringaccent A} 
+  \gdef^^c5{\ringaccent A}
   \gdef^^c6{\AE}
   \gdef^^c7{\cedilla C}
   \gdef^^c8{\`E}
@@ -8009,7 +8009,7 @@ should work if nowhere else does.}
   \gdef^^d6{\"O}
   \gdef^^d7{$\times$}
   \gdef^^d8{\v R}
-  \gdef^^d9{\ringaccent U} 
+  \gdef^^d9{\ringaccent U}
   \gdef^^da{\'U}
   \gdef^^db{\H U}
   \gdef^^dc{\"U}
@@ -8053,11 +8053,11 @@ should work if nowhere else does.}
 }
 
 % UTF-8 character definitions.
-% 
+%
 % This code to support UTF-8 is based on LaTeX's utf8.def, with some
 % changes for Texinfo conventions.  It is included here under the GPL by
 % permission from Frank Mittelbach and the LaTeX team.
-% 
+%
 \newcount\countUTFx
 \newcount\countUTFy
 \newcount\countUTFz
@@ -8897,7 +8897,7 @@ should work if nowhere else does.}
 
 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
 % the literal character `\'.
-% 
+%
 @def@normalturnoffactive{%
   @let\=@normalbackslash
   @let"=@normaldoublequote
index d46cd4c9ad48f81218501a3066f02924f8e45502..24b63ec9837925fd3618d108624779fdd3307907 100644 (file)
@@ -38,7 +38,7 @@ grub_arch_efiemu_check_header32 (void *ehdr)
 
 /* Relocate symbols.  */
 grub_err_t
-grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, 
+grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs,
                                     struct grub_efiemu_elf_sym *elfsyms,
                                     void *ehdr)
 {
@@ -66,7 +66,7 @@ grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs,
        if (seg)
          {
            Elf32_Rel *rel, *max;
-           
+
            for (rel = (Elf32_Rel *) ((char *) e + s->sh_offset),
                   max = rel + s->sh_size / s->sh_entsize;
                 rel < max;
@@ -77,31 +77,31 @@ grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs,
                if (seg->size < rel->r_offset)
                  return grub_error (GRUB_ERR_BAD_MODULE,
                                     "reloc offset is out of the segment");
-               
-               addr = (Elf32_Word *) 
-                 ((char *) grub_efiemu_mm_obtain_request (seg->handle) 
+
+               addr = (Elf32_Word *)
+                 ((char *) grub_efiemu_mm_obtain_request (seg->handle)
                   + seg->off + rel->r_offset);
                sym = elfsyms[ELF32_R_SYM (rel->r_info)];
-               
+
                switch (ELF32_R_TYPE (rel->r_info))
                  {
                  case R_386_32:
-                   if ((err = grub_efiemu_write_value 
-                        (addr, sym.off + *addr, sym.handle, 0, 
+                   if ((err = grub_efiemu_write_value
+                        (addr, sym.off + *addr, sym.handle, 0,
                          seg->ptv_rel_needed, sizeof (grub_uint32_t))))
                      return err;
-                   
+
                    break;
 
                  case R_386_PC32:
                    if ((err = grub_efiemu_write_value
-                        (addr, sym.off + *addr - rel->r_offset 
-                         - seg->off, sym.handle, seg->handle, 
+                        (addr, sym.off + *addr - rel->r_offset
+                         - seg->off, sym.handle, seg->handle,
                          seg->ptv_rel_needed, sizeof (grub_uint32_t))))
                      return err;
                    break;
                  default:
-                   return grub_error (GRUB_ERR_BAD_OS, 
+                   return grub_error (GRUB_ERR_BAD_OS,
                                       "unrecognised relocation");
                  }
              }
index 6c0e0ca14fe398865920c3a6563a4d32d11d8f6d..a69279077c39fd50f78d540af4dfe43587d3144c 100644 (file)
@@ -37,7 +37,7 @@ grub_arch_efiemu_check_header64 (void *ehdr)
 
 /* Relocate symbols.  */
 grub_err_t
-grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, 
+grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs,
                                     struct grub_efiemu_elf_sym *elfsyms,
                                     void *ehdr)
 {
@@ -62,9 +62,9 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs,
        if (seg)
          {
            Elf64_Rela *rel, *max;
-           
+
            for (rel = (Elf64_Rela *) ((char *) e + s->sh_offset),
-                  max = rel + (unsigned long) s->sh_size 
+                  max = rel + (unsigned long) s->sh_size
                   / (unsigned long)s->sh_entsize;
                 rel < max;
                 rel++)
@@ -76,40 +76,40 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs,
                if (seg->size < rel->r_offset)
                  return grub_error (GRUB_ERR_BAD_MODULE,
                                     "reloc offset is out of the segment");
-               
+
                addr =
-                 ((char *) grub_efiemu_mm_obtain_request (seg->handle) 
+                 ((char *) grub_efiemu_mm_obtain_request (seg->handle)
                   + seg->off + rel->r_offset);
                addr32 = (grub_uint32_t *) addr;
                addr64 = (grub_uint64_t *) addr;
                sym = elfsyms[ELF64_R_SYM (rel->r_info)];
-               
+
                switch (ELF64_R_TYPE (rel->r_info))
                  {
                  case R_X86_64_64:
-                   if ((err = grub_efiemu_write_value 
-                        (addr, *addr64 + rel->r_addend + sym.off, sym.handle, 
+                   if ((err = grub_efiemu_write_value
+                        (addr, *addr64 + rel->r_addend + sym.off, sym.handle,
                          0, seg->ptv_rel_needed, sizeof (grub_uint64_t))))
                      return err;
                    break;
 
                  case R_X86_64_PC32:
                    if ((err = grub_efiemu_write_value
-                        (addr, *addr32 + rel->r_addend + sym.off 
-                         - rel->r_offset - seg->off, sym.handle, seg->handle, 
+                        (addr, *addr32 + rel->r_addend + sym.off
+                         - rel->r_offset - seg->off, sym.handle, seg->handle,
                          seg->ptv_rel_needed, sizeof (grub_uint32_t))))
                      return err;
                    break;
 
                   case R_X86_64_32:
                   case R_X86_64_32S:
-                   if ((err = grub_efiemu_write_value 
-                        (addr, *addr32 + rel->r_addend + sym.off, sym.handle, 
+                   if ((err = grub_efiemu_write_value
+                        (addr, *addr32 + rel->r_addend + sym.off, sym.handle,
                          0, seg->ptv_rel_needed, sizeof (grub_uint32_t))))
                      return err;
                     break;
                  default:
-                   return grub_error (GRUB_ERR_BAD_OS, 
+                   return grub_error (GRUB_ERR_BAD_OS,
                                       "unrecognised relocation");
                  }
              }
index 25f8a0cfa0a293a4343005ee06b62a0fb115cd3e..9c6b4e55efdb60dc3d78974175fa651bf492d8f3 100644 (file)
@@ -59,7 +59,7 @@ grub_machine_efiemu_init_tables ()
        return err;
     }
 
-  for (ptr = (grub_uint8_t *) 0xf0000; ptr < (grub_uint8_t *) 0x100000; 
+  for (ptr = (grub_uint8_t *) 0xf0000; ptr < (grub_uint8_t *) 0x100000;
        ptr += 16)
     if (grub_memcmp (ptr, "_SM_", 4) == 0
        && grub_byte_checksum (ptr, *(ptr + 5)) == 0)
index 36f27a2ef6de5268a7f7408b776f8c1aa0a4b7cf..ee4c80649ebca409a29fe682650cf98839dab74e 100644 (file)
@@ -40,7 +40,7 @@ grub_efiemu_get_section_addr (grub_efiemu_segment_t segs, unsigned n,
     if (seg->section == n)
       {
        *handle = seg->handle;
-       *off = seg->off;        
+       *off = seg->off;
        return GRUB_ERR_NONE;
       }
 
@@ -86,7 +86,7 @@ grub_efiemu_load_segments (grub_efiemu_segment_t segs, const Elf_Ehdr *e)
   grub_efiemu_segment_t cur;
 
   grub_dprintf ("efiemu", "loading segments\n");
-  
+
   for (cur=segs; cur; cur = cur->next)
     {
       s = (Elf_Shdr *)cur->srcptr;
@@ -94,10 +94,10 @@ grub_efiemu_load_segments (grub_efiemu_segment_t segs, const Elf_Ehdr *e)
       if ((s->sh_flags & SHF_ALLOC) && s->sh_size)
        {
          void *addr;
-         
-         addr = (grub_uint8_t *) grub_efiemu_mm_obtain_request (cur->handle) 
+
+         addr = (grub_uint8_t *) grub_efiemu_mm_obtain_request (cur->handle)
            + cur->off;
-         
+
          switch (s->sh_type)
            {
            case SHT_PROGBITS:
@@ -145,11 +145,11 @@ grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e)
          seg = (grub_efiemu_segment_t) grub_malloc (sizeof (*seg));
          if (! seg)
            return grub_errno;
-         
+
          if (s->sh_size)
            {
-             seg->handle 
-               = grub_efiemu_request_memalign 
+             seg->handle
+               = grub_efiemu_request_memalign
                (s->sh_addralign, s->sh_size,
                 s->sh_flags & SHF_EXECINSTR ? GRUB_EFI_RUNTIME_SERVICES_CODE
                 : GRUB_EFI_RUNTIME_SERVICES_DATA);
@@ -157,12 +157,12 @@ grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e)
                return grub_errno;
              seg->off = 0;
            }
-         
-         /* 
+
+         /*
             .text-physical doesn't need to be relocated when switching to
             virtual mode
           */
-         if (!grub_strcmp (grub_efiemu_get_string (s->sh_name, e), 
+         if (!grub_strcmp (grub_efiemu_get_string (s->sh_name, e),
                            ".text-physical"))
            seg->ptv_rel_needed = 0;
          else
@@ -174,7 +174,7 @@ grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e)
          *segs = seg;
        }
     }
-  
+
   return GRUB_ERR_NONE;
 }
 
@@ -185,7 +185,7 @@ grub_efiemu_count_symbols (const Elf_Ehdr *e)
   unsigned i;
   Elf_Shdr *s;
   int num = 0;
-  
+
   /* Symbols */
   for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff);
        i < e->e_shnum;
@@ -197,7 +197,7 @@ grub_efiemu_count_symbols (const Elf_Ehdr *e)
     return grub_error (GRUB_ERR_BAD_OS, "no symbol table");
 
   grub_efiemu_nelfsyms = (unsigned) s->sh_size / (unsigned) s->sh_entsize;
-  grub_efiemu_elfsyms = (struct grub_efiemu_elf_sym *) 
+  grub_efiemu_elfsyms = (struct grub_efiemu_elf_sym *)
     grub_malloc (sizeof (struct grub_efiemu_elf_sym) * grub_efiemu_nelfsyms);
 
   /* Relocators */
@@ -221,7 +221,7 @@ grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e)
   Elf_Sym *sym;
   const char *str;
   Elf_Word size, entsize;
-  
+
   grub_dprintf ("efiemu", "resolving symbols\n");
 
   for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff);
@@ -267,7 +267,7 @@ grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e)
          break;
 
        case STT_OBJECT:
-         if ((err = grub_efiemu_get_section_addr 
+         if ((err = grub_efiemu_get_section_addr
               (segs, sym->st_shndx, &handle, &off)))
            return err;
 
@@ -280,7 +280,7 @@ grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e)
          break;
 
        case STT_FUNC:
-         if ((err = grub_efiemu_get_section_addr 
+         if ((err = grub_efiemu_get_section_addr
               (segs, sym->st_shndx, &handle, &off)))
            return err;
 
@@ -293,12 +293,12 @@ grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e)
          break;
 
        case STT_SECTION:
-         if ((err = grub_efiemu_get_section_addr 
+         if ((err = grub_efiemu_get_section_addr
               (segs, sym->st_shndx, &handle, &off)))
            {
              grub_efiemu_elfsyms[i].handle = 0;
              grub_efiemu_elfsyms[i].off = 0;
-             grub_errno = GRUB_ERR_NONE; 
+             grub_errno = GRUB_ERR_NONE;
              break;
            }
 
@@ -346,8 +346,8 @@ SUFFIX (grub_efiemu_loadcore_init) (void *core, grub_size_t core_size,
 
 /* Load runtime definitively */
 grub_err_t
-SUFFIX (grub_efiemu_loadcore_load) (void *core, 
-                                   grub_size_t core_size 
+SUFFIX (grub_efiemu_loadcore_load) (void *core,
+                                   grub_size_t core_size
                                    __attribute__ ((unused)),
                                    grub_efiemu_segment_t segments)
 {
@@ -356,10 +356,10 @@ SUFFIX (grub_efiemu_loadcore_load) (void *core,
     return err;
   if ((err = grub_efiemu_resolve_symbols (segments, core)))
     return err;
-  if ((err = SUFFIX (grub_arch_efiemu_relocate_symbols) (segments, 
+  if ((err = SUFFIX (grub_arch_efiemu_relocate_symbols) (segments,
                                                         grub_efiemu_elfsyms,
                                                         core)))
     return err;
-    
+
   return GRUB_ERR_NONE;
 }
index 9de1b39ad919e8dacd7062bd61975df10f3f100c..a4db0ee9b947e613f95f47a4485fb118c3a6c021 100644 (file)
@@ -45,7 +45,7 @@ grub_efiemu_sizeof_uintn_t (void)
 
 /* Check the header and set mode */
 static grub_err_t
-grub_efiemu_check_header (void *ehdr, grub_size_t size, 
+grub_efiemu_check_header (void *ehdr, grub_size_t size,
                          grub_efiemu_mode_t *mode)
 {
   /* Check the magic numbers.  */
@@ -91,7 +91,7 @@ grub_efiemu_loadcore_unload(void)
     case GRUB_EFIEMU64:
       grub_efiemu_loadcore_unload64 ();
       break;
-      
+
     default:
       break;
     }
@@ -109,7 +109,7 @@ grub_efiemu_loadcore_unload(void)
   return GRUB_ERR_NONE;
 }
 
-/* Load runtime file and do some initial preparations */ 
+/* Load runtime file and do some initial preparations */
 grub_err_t
 grub_efiemu_loadcore_init (grub_file_t file)
 {
@@ -121,7 +121,7 @@ grub_efiemu_loadcore_init (grub_file_t file)
   if (! efiemu_core)
     return grub_errno;
 
-  if (grub_file_read (file, efiemu_core, efiemu_core_size) 
+  if (grub_file_read (file, efiemu_core, efiemu_core_size)
       != (int) efiemu_core_size)
     {
       grub_free (efiemu_core);
@@ -129,7 +129,7 @@ grub_efiemu_loadcore_init (grub_file_t file)
       return grub_errno;
     }
 
-  if (grub_efiemu_check_header (efiemu_core, efiemu_core_size, 
+  if (grub_efiemu_check_header (efiemu_core, efiemu_core_size,
                                &grub_efiemu_mode))
     {
       grub_free (efiemu_core);
@@ -160,7 +160,7 @@ grub_efiemu_loadcore_init (grub_file_t file)
          return err;
        }
       break;
-      
+
     default:
       return grub_error (GRUB_ERR_BAD_OS, "unknown EFI runtime");
     }
index da5733647b9ebba0082bc54a31bbba1ebf83fc5c..b5608e666bccfab8b4e8ccc2716eec78a785d65e 100644 (file)
@@ -17,8 +17,8 @@
  */
 
 /* This is an emulation of EFI runtime services.
-   This allows a more uniform boot on i386 machines. 
-   As it emulates only runtime service it isn't able 
+   This allows a more uniform boot on i386 machines.
+   As it emulates only runtime service it isn't able
    to chainload EFI bootloader on non-EFI system. */
 
 
@@ -112,7 +112,7 @@ grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid)
 
 grub_err_t
 grub_efiemu_register_prepare_hook (grub_err_t (*hook) (void *data),
-                                  void (*unload) (void *data), 
+                                  void (*unload) (void *data),
                                   void *data)
 {
   struct grub_efiemu_prepare_hook *nhook;
@@ -129,20 +129,20 @@ grub_efiemu_register_prepare_hook (grub_err_t (*hook) (void *data),
   return GRUB_ERR_NONE;
 }
 
-/* Register a configuration table either supplying the address directly 
+/* Register a configuration table either supplying the address directly
    or with a hook
 */
 grub_err_t
-grub_efiemu_register_configuration_table (grub_efi_guid_t guid, 
+grub_efiemu_register_configuration_table (grub_efi_guid_t guid,
                                          void * (*get_table) (void *data),
-                                         void (*unload) (void *data), 
+                                         void (*unload) (void *data),
                                          void *data)
 {
   struct grub_efiemu_configuration_table *tbl;
   grub_err_t err;
+
  if (! get_table && ! data)
-    return grub_error (GRUB_ERR_BAD_ARGUMENT, 
+    return grub_error (GRUB_ERR_BAD_ARGUMENT,
                       "you must set at least get_table or data");
   if ((err = grub_efiemu_unregister_configuration_table (guid)))
     return err;
@@ -163,7 +163,7 @@ grub_efiemu_register_configuration_table (grub_efi_guid_t guid,
 
 static grub_err_t
 grub_cmd_efiemu_unload (grub_command_t cmd __attribute__ ((unused)),
-                       int argc __attribute__ ((unused)), 
+                       int argc __attribute__ ((unused)),
                        char *args[] __attribute__ ((unused)))
 {
   return grub_efiemu_unload ();
@@ -171,7 +171,7 @@ grub_cmd_efiemu_unload (grub_command_t cmd __attribute__ ((unused)),
 
 static grub_err_t
 grub_cmd_efiemu_prepare (grub_command_t cmd __attribute__ ((unused)),
-                        int argc __attribute__ ((unused)), 
+                        int argc __attribute__ ((unused)),
                         char *args[] __attribute__ ((unused)))
 {
   return grub_efiemu_prepare ();
@@ -180,15 +180,15 @@ grub_cmd_efiemu_prepare (grub_command_t cmd __attribute__ ((unused)),
 \f
 
 
-int 
-grub_efiemu_exit_boot_services (grub_efi_uintn_t map_key 
+int
+grub_efiemu_exit_boot_services (grub_efi_uintn_t map_key
                                __attribute__ ((unused)))
 {
   /* Nothing to do here yet */
   return 1;
 }
 
-int 
+int
 grub_efiemu_finish_boot_services (void)
 {
   /* Nothing to do here yet */
@@ -201,11 +201,11 @@ grub_efiemu_load_file (const char *filename)
 {
   grub_file_t file;
   grub_err_t err;
-  
+
   file = grub_file_open (filename);
   if (! file)
     return 0;
-  
+
   err = grub_efiemu_mm_init ();
   if (err)
     {
@@ -244,19 +244,19 @@ grub_efiemu_autocore (void)
     return GRUB_ERR_NONE;
 
   prefix = grub_env_get ("prefix");
-  
+
   if (! prefix)
-    return grub_error (GRUB_ERR_FILE_NOT_FOUND, 
+    return grub_error (GRUB_ERR_FILE_NOT_FOUND,
                       "couldn't find efiemu core because prefix "
                       "isn't set");
-  
+
   suffix = grub_efiemu_get_default_core_name ();
-  
+
   filename = grub_malloc (grub_strlen (prefix) + grub_strlen (suffix) + 2);
   if (! filename)
-    return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+    return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                       "couldn't allocate temporary space");
-  
+
   grub_sprintf (filename, "%s/%s", prefix, suffix);
 
   err = grub_efiemu_load_file (filename);
@@ -277,7 +277,7 @@ grub_efiemu_prepare (void)
 {
   grub_err_t err;
 
-  grub_dprintf ("efiemu", "Preparing %d-bit efiemu\n", 
+  grub_dprintf ("efiemu", "Preparing %d-bit efiemu\n",
                8 * grub_efiemu_sizeof_uintn_t ());
 
   err = grub_efiemu_autocore ();
@@ -321,16 +321,16 @@ grub_efiemu_pnvram_cmd_register (void);
 
 GRUB_MOD_INIT(efiemu)
 {
-  cmd_loadcore = grub_register_command ("efiemu_loadcore", 
-                                       grub_cmd_efiemu_load, 
-                                      "efiemu_loadcore FILE", 
+  cmd_loadcore = grub_register_command ("efiemu_loadcore",
+                                       grub_cmd_efiemu_load,
+                                      "efiemu_loadcore FILE",
                                       "Load and initialize EFI emulator");
-  cmd_prepare = grub_register_command ("efiemu_prepare", 
-                                      grub_cmd_efiemu_prepare, 
-                                      "efiemu_prepare", 
+  cmd_prepare = grub_register_command ("efiemu_prepare",
+                                      grub_cmd_efiemu_prepare,
+                                      "efiemu_prepare",
                                       "Finalize loading of EFI emulator");
-  cmd_unload = grub_register_command ("efiemu_unload", grub_cmd_efiemu_unload, 
-                                     "efiemu_unload", 
+  cmd_unload = grub_register_command ("efiemu_unload", grub_cmd_efiemu_unload,
+                                     "efiemu_unload",
                                      "Unload  EFI emulator");
   grub_efiemu_pnvram_cmd_register ();
 }
index e7dcf399e547b4946f33fded44bb483efc1c03bb..7d6a5d466a9ef78ace2de5f76bd63a025199473e 100644 (file)
  *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
  */
 /*
-  To keep efiemu runtime contiguous this mm is special. 
+  To keep efiemu runtime contiguous this mm is special.
   It uses deferred allocation.
   In the first stage you may request memory with grub_efiemu_request_memalign
-  It will give you a handle with which in the second phase you can access your 
+  It will give you a handle with which in the second phase you can access your
   memory with grub_efiemu_mm_obtain_request (handle). It's guaranteed that
   subsequent calls with the same handle return the same result. You can't request any additional memory once you're in the second phase
 */
@@ -32,7 +32,7 @@
 #include <grub/machine/memory.h>
 #include <grub/efiemu/efiemu.h>
 
-struct grub_efiemu_memrequest 
+struct grub_efiemu_memrequest
 {
   struct grub_efiemu_memrequest *next;
   grub_efi_memory_type_t type;
@@ -54,7 +54,7 @@ static int mmap_reserved_size = 0, mmap_num = 0;
 
 /* Add a memory region to map*/
 static grub_err_t
-grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size, 
+grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size,
                         grub_efi_memory_type_t type)
 {
   grub_uint64_t page_start, npages;
@@ -63,10 +63,10 @@ grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size,
   if (mmap_num >= mmap_reserved_size)
     {
       efiemu_mmap = (grub_efi_memory_descriptor_t *)
-       grub_realloc (efiemu_mmap, (++mmap_reserved_size) 
+       grub_realloc (efiemu_mmap, (++mmap_reserved_size)
                      * sizeof (grub_efi_memory_descriptor_t));
       if (!efiemu_mmap)
-       return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+       return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                           "Not enough space for memory map");
     }
 
@@ -74,9 +74,9 @@ grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size,
   page_start = start - (start % GRUB_EFIEMU_PAGESIZE);
   npages = (size + (start % GRUB_EFIEMU_PAGESIZE) + GRUB_EFIEMU_PAGESIZE - 1)
     / GRUB_EFIEMU_PAGESIZE;
-  efiemu_mmap[mmap_num].physical_start = page_start; 
-  efiemu_mmap[mmap_num].virtual_start = page_start; 
-  efiemu_mmap[mmap_num].num_pages = npages; 
+  efiemu_mmap[mmap_num].physical_start = page_start;
+  efiemu_mmap[mmap_num].virtual_start = page_start;
+  efiemu_mmap[mmap_num].num_pages = npages;
   efiemu_mmap[mmap_num].type = type;
   mmap_num++;
 
@@ -84,11 +84,11 @@ grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size,
 }
 
 /* Request a resident memory of type TYPE of size SIZE aligned at ALIGN
-   ALIGN must be a divisor of page size (if it's a divisor of 4096 
+   ALIGN must be a divisor of page size (if it's a divisor of 4096
    it should be ok on all platforms)
  */
 int
-grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, 
+grub_efiemu_request_memalign (grub_size_t align, grub_size_t size,
                              grub_efi_memory_type_t type)
 {
   grub_size_t align_overhead;
@@ -113,8 +113,8 @@ grub_efiemu_request_memalign (grub_size_t align, grub_size_t size,
   ret->val = 0;
   ret->next = 0;
   prev = 0;
-  
-  /* Add request to the end of the chain. 
+
+  /* Add request to the end of the chain.
      It should be at the end because otherwise alignment isn't guaranteed */
   for (cur = memrequests; cur; prev = cur, cur = cur->next);
   if (prev)
@@ -155,20 +155,20 @@ efiemu_alloc_requests (void)
       GRUB_EFI_RUNTIME_SERVICES_CODE,
       GRUB_EFI_RUNTIME_SERVICES_DATA,
       GRUB_EFI_ACPI_MEMORY_NVS,
-      
-      /* And then unavailable memory types. This is more for a completeness. 
+
+      /* And then unavailable memory types. This is more for a completeness.
         You should double think before allocating memory of any of these types
        */
       GRUB_EFI_UNUSABLE_MEMORY,
       GRUB_EFI_MEMORY_MAPPED_IO,
       GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE,
-      GRUB_EFI_PAL_CODE 
+      GRUB_EFI_PAL_CODE
     };
 
   /* Compute total memory needed */
   for (i = 0; i < sizeof (reqorder) / sizeof (reqorder[0]); i++)
     {
-      align_overhead = GRUB_EFIEMU_PAGESIZE 
+      align_overhead = GRUB_EFIEMU_PAGESIZE
        - (requested_memory[reqorder[i]] % GRUB_EFIEMU_PAGESIZE);
       if (align_overhead == GRUB_EFIEMU_PAGESIZE)
        align_overhead = 0;
@@ -178,7 +178,7 @@ efiemu_alloc_requests (void)
   /* Allocate the whole memory in one block */
   resident_memory = grub_memalign (GRUB_EFIEMU_PAGESIZE, total_alloc);
   if (!resident_memory)
-    return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+    return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                       "couldn't allocate resident memory");
 
   /* Split the memory into blocks by type */
@@ -199,14 +199,14 @@ efiemu_alloc_requests (void)
          }
 
       /* Ensure that the regions are page-aligned */
-      align_overhead = GRUB_EFIEMU_PAGESIZE 
+      align_overhead = GRUB_EFIEMU_PAGESIZE
        - (requested_memory[reqorder[i]] % GRUB_EFIEMU_PAGESIZE);
       if (align_overhead == GRUB_EFIEMU_PAGESIZE)
        align_overhead = 0;
       curptr = ((grub_uint8_t *)curptr) + align_overhead;
-      
+
       /* Add the region to memory map */
-      grub_efiemu_add_to_mmap (PTR_TO_UINT64 (typestart), 
+      grub_efiemu_add_to_mmap (PTR_TO_UINT64 (typestart),
                               curptr - typestart, reqorder[i]);
     }
 
@@ -270,7 +270,7 @@ grub_efiemu_mm_return_request (int handle)
 static grub_err_t
 grub_efiemu_mmap_init (void)
 {
-  auto int NESTED_FUNC_ATTR bounds_hook (grub_uint64_t, grub_uint64_t, 
+  auto int NESTED_FUNC_ATTR bounds_hook (grub_uint64_t, grub_uint64_t,
                                         grub_uint32_t);
   int NESTED_FUNC_ATTR bounds_hook (grub_uint64_t addr __attribute__ ((unused)),
                                    grub_uint64_t size __attribute__ ((unused)),
@@ -302,7 +302,7 @@ grub_efiemu_get_memory_map (grub_efi_uintn_t *memory_map_size,
 {
   if (!efiemu_mmap)
     {
-      grub_error (GRUB_ERR_INVALID_COMMAND, 
+      grub_error (GRUB_ERR_INVALID_COMMAND,
                  "you need to first launch efiemu_prepare");
       return -1;
     }
@@ -373,26 +373,26 @@ grub_efiemu_mmap_fill (void)
       switch (type)
        {
        case GRUB_MACHINE_MEMORY_AVAILABLE:
-         return grub_efiemu_add_to_mmap (addr, size, 
+         return grub_efiemu_add_to_mmap (addr, size,
                                          GRUB_EFI_CONVENTIONAL_MEMORY);
 
 #ifdef GRUB_MACHINE_MEMORY_ACPI
        case GRUB_MACHINE_MEMORY_ACPI:
-         return grub_efiemu_add_to_mmap (addr, size, 
+         return grub_efiemu_add_to_mmap (addr, size,
                                          GRUB_EFI_ACPI_RECLAIM_MEMORY);
 #endif
 
 #ifdef GRUB_MACHINE_MEMORY_NVS
        case GRUB_MACHINE_MEMORY_NVS:
-         return grub_efiemu_add_to_mmap (addr, size, 
+         return grub_efiemu_add_to_mmap (addr, size,
                                          GRUB_EFI_ACPI_MEMORY_NVS);
 #endif
 
        default:
          grub_printf ("Unknown memory type %d. Marking as unusable\n", type);
        case GRUB_MACHINE_MEMORY_RESERVED:
-         return grub_efiemu_add_to_mmap (addr, size, 
-                                         GRUB_EFI_UNUSABLE_MEMORY);      
+         return grub_efiemu_add_to_mmap (addr, size,
+                                         GRUB_EFI_UNUSABLE_MEMORY);
        }
     }
 
@@ -404,8 +404,8 @@ grub_efiemu_mmap_fill (void)
 }
 
 grub_err_t
-grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, 
-                                                       grub_uint64_t, 
+grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
+                                                       grub_uint64_t,
                                                        grub_uint32_t))
 {
   unsigned i;
@@ -414,10 +414,10 @@ grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
     switch (efiemu_mmap[i].type)
       {
       case GRUB_EFI_RUNTIME_SERVICES_CODE:
-       hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, 
+       hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096,
              GRUB_EFIEMU_MEMORY_CODE);
        break;
-       
+
       case GRUB_EFI_RESERVED_MEMORY_TYPE:
       case GRUB_EFI_RUNTIME_SERVICES_DATA:
       case GRUB_EFI_UNUSABLE_MEMORY:
@@ -425,30 +425,30 @@ grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
       case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE:
       case GRUB_EFI_PAL_CODE:
       case GRUB_EFI_MAX_MEMORY_TYPE:
-       hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, 
+       hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096,
              GRUB_EFIEMU_MEMORY_RESERVED);
        break;
-       
+
       case GRUB_EFI_LOADER_CODE:
       case GRUB_EFI_LOADER_DATA:
       case GRUB_EFI_BOOT_SERVICES_CODE:
       case GRUB_EFI_BOOT_SERVICES_DATA:
       case GRUB_EFI_CONVENTIONAL_MEMORY:
-       hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, 
+       hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096,
              GRUB_EFIEMU_MEMORY_AVAILABLE);
        break;
-       
+
       case GRUB_EFI_ACPI_RECLAIM_MEMORY:
-       hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, 
+       hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096,
              GRUB_EFIEMU_MEMORY_ACPI);
        break;
-       
+
       case GRUB_EFI_ACPI_MEMORY_NVS:
-       hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, 
+       hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096,
              GRUB_EFIEMU_MEMORY_NVS);
        break;
       }
-  
+
   return 0;
 }
 
@@ -459,8 +459,8 @@ grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
 static grub_err_t
 grub_efiemu_mmap_sort_and_uniq (void)
 {
-  /* If same page is used by multiple types it's resolved 
-     according to priority 
+  /* If same page is used by multiple types it's resolved
+     according to priority
      0 - free memory
      1 - memory immediately usable after ExitBootServices
      2 - memory usable after loading ACPI tables
@@ -512,20 +512,20 @@ grub_efiemu_mmap_sort_and_uniq (void)
 
   /* Initialize variables*/
   grub_memset (present, 0, sizeof (int) * GRUB_EFI_MAX_MEMORY_TYPE);
-  scanline_events = (struct grub_efiemu_mmap_scan *) 
+  scanline_events = (struct grub_efiemu_mmap_scan *)
     grub_malloc (sizeof (struct grub_efiemu_mmap_scan) * 2 * mmap_num);
 
   /* Number of chunks can't increase more than by factor of 2 */
-  result = (grub_efi_memory_descriptor_t *) 
+  result = (grub_efi_memory_descriptor_t *)
     grub_malloc (sizeof (grub_efi_memory_descriptor_t) * 2 * mmap_num);
   if (!result || !scanline_events)
     {
       grub_free (result);
       grub_free (scanline_events);
-      return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+      return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                         "couldn't allocate space for new memory map");
     }
-   
+
   /* Register scanline events */
   for (i = 0; i < mmap_num; i++)
     {
@@ -538,8 +538,8 @@ grub_efiemu_mmap_sort_and_uniq (void)
       scanline_events[2 * i + 1].memtype = efiemu_mmap[i].type;
     }
 
-  /* Primitive bubble sort. It has complexity O(n^2) but since we're 
-     unlikely to have more than 100 chunks it's probably one of the 
+  /* Primitive bubble sort. It has complexity O(n^2) but since we're
+     unlikely to have more than 100 chunks it's probably one of the
      fastest for one purpose */
   done = 1;
   while (done)
@@ -574,29 +574,29 @@ grub_efiemu_mmap_sort_and_uniq (void)
          curtype = k;
 
       /* Add memory region to resulting map if necessary */
-      if ((curtype == -1 || curtype != lasttype) 
+      if ((curtype == -1 || curtype != lasttype)
          && lastaddr != scanline_events[i].pos
          && lasttype != -1)
        {
          result[j].virtual_start = result[j].physical_start = lastaddr;
-         result[j].num_pages = (scanline_events[i].pos - lastaddr) 
+         result[j].num_pages = (scanline_events[i].pos - lastaddr)
            / GRUB_EFIEMU_PAGESIZE;
          result[j].type = lasttype;
 
          /* We set runtime attribute on pages we need to be mapped */
-         result[j].attribute 
+         result[j].attribute
            = (lasttype == GRUB_EFI_RUNTIME_SERVICES_CODE
                   || lasttype == GRUB_EFI_RUNTIME_SERVICES_DATA)
            ? GRUB_EFI_MEMORY_RUNTIME : 0;
-         grub_dprintf ("efiemu", 
-                       "mmap entry: type %d start 0x%llx 0x%llx pages\n", 
+         grub_dprintf ("efiemu",
+                       "mmap entry: type %d start 0x%llx 0x%llx pages\n",
                        result[j].type,
                        result[j].physical_start, result[j].num_pages);
          j++;
        }
 
       /* Update last values if necessary */
-      if (curtype == -1 || curtype != lasttype) 
+      if (curtype == -1 || curtype != lasttype)
        {
          lasttype = curtype;
          lastaddr = scanline_events[i].pos;
@@ -605,7 +605,7 @@ grub_efiemu_mmap_sort_and_uniq (void)
 
   grub_free (scanline_events);
 
-  /* Shrink resulting memory map to really used size and replace efiemu_mmap 
+  /* Shrink resulting memory map to really used size and replace efiemu_mmap
      by new value */
   grub_free (efiemu_mmap);
   efiemu_mmap = grub_realloc (result, j * sizeof (*result));
@@ -619,7 +619,7 @@ grub_efiemu_mm_do_alloc (void)
   grub_err_t err;
 
   /* Preallocate mmap */
-  efiemu_mmap = (grub_efi_memory_descriptor_t *) 
+  efiemu_mmap = (grub_efi_memory_descriptor_t *)
     grub_malloc (mmap_reserved_size * sizeof (grub_efi_memory_descriptor_t));
   if (!efiemu_mmap)
     {
@@ -632,4 +632,4 @@ grub_efiemu_mm_do_alloc (void)
   if ((err = grub_efiemu_mmap_fill ()))
     return err;
   return grub_efiemu_mmap_sort_and_uniq ();
-} 
+}
index 0cc0eb85eb622fe9f339e91a4d757af6eaf0fa12..d5daaabb8ac875d00fa0423829151555e898e882 100644 (file)
@@ -45,13 +45,13 @@ static grub_uint32_t accuracy;
 static const struct grub_arg_option options[] = {
   {"size", 's', 0, "number of bytes to reserve for pseudo NVRAM", 0,
    ARG_TYPE_INT},
-  {"high-monotonic-count", 'm', 0, 
+  {"high-monotonic-count", 'm', 0,
    "Initial value of high monotonic count", 0, ARG_TYPE_INT},
-  {"timezone", 't', 0, 
+  {"timezone", 't', 0,
    "Timezone, offset in minutes from GMT", 0, ARG_TYPE_INT},
-  {"accuracy", 'a', 0, 
+  {"accuracy", 'a', 0,
    "Accuracy of clock, in 1e-12 units", 0, ARG_TYPE_INT},
-  {"daylight", 'd', 0, 
+  {"daylight", 'd', 0,
    "Daylight value, as per EFI specifications", 0, ARG_TYPE_INT},
   {0, 0, 0, 0, 0, 0}
 };
@@ -68,14 +68,14 @@ grub_strtosl (char *arg, char **end, int base)
 /* Export stuff for efiemu */
 static grub_err_t
 nvram_set (void * data __attribute__ ((unused)))
-{      
+{
   /* Take definitive pointers */
   grub_uint8_t *nvram_def = grub_efiemu_mm_obtain_request (nvram_handle);
-  grub_uint32_t *nvramsize_def 
+  grub_uint32_t *nvramsize_def
     = grub_efiemu_mm_obtain_request (nvramsize_handle);
   grub_uint32_t *high_monotonic_count_def
     = grub_efiemu_mm_obtain_request (high_monotonic_count_handle);
-  grub_int16_t *timezone_def 
+  grub_int16_t *timezone_def
     = grub_efiemu_mm_obtain_request (timezone_handle);
   grub_uint8_t *daylight_def
     = grub_efiemu_mm_obtain_request (daylight_handle);
@@ -94,11 +94,11 @@ nvram_set (void * data __attribute__ ((unused)))
   /* Register symbols */
   grub_efiemu_register_symbol ("efiemu_variables", nvram_handle, 0);
   grub_efiemu_register_symbol ("efiemu_varsize", nvramsize_handle, 0);
-  grub_efiemu_register_symbol ("efiemu_high_monotonic_count", 
+  grub_efiemu_register_symbol ("efiemu_high_monotonic_count",
                               high_monotonic_count_handle, 0);
   grub_efiemu_register_symbol ("efiemu_time_zone", timezone_handle, 0);
   grub_efiemu_register_symbol ("efiemu_time_daylight", daylight_handle, 0);
-  grub_efiemu_register_symbol ("efiemu_time_accuracy", 
+  grub_efiemu_register_symbol ("efiemu_time_accuracy",
                               accuracy_handle, 0);
 
   return GRUB_ERR_NONE;
@@ -134,7 +134,7 @@ read_pnvram (char *filename)
   struct efi_variable *efivar;
   grub_size_t guidlen, datalen;
   unsigned i, j;
-  
+
   file = grub_file_open (filename);
   if (!file)
     return grub_error (GRUB_ERR_BAD_OS, "couldn't read pnvram");
@@ -157,17 +157,17 @@ read_pnvram (char *filename)
 
       efivar = (struct efi_variable *) nvramptr;
       if (nvramptr - nvram + sizeof (struct efi_variable) > nvramsize)
-       return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+       return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                           "file is too large for reserved variable space");
 
       nvramptr += sizeof (struct efi_variable);
 
       /* look ahow long guid field is*/
-      guidlen = 0;      
-      for (ptr2 = ptr; (grub_isspace (*ptr2) 
+      guidlen = 0;
+      for (ptr2 = ptr; (grub_isspace (*ptr2)
                        || (*ptr2 >= '0' && *ptr2 <= '9')
                        || (*ptr2 >= 'a' && *ptr2 <= 'f')
-                       || (*ptr2 >= 'A' && *ptr2 <= 'F')); 
+                       || (*ptr2 >= 'A' && *ptr2 <= 'F'));
           ptr2++)
        if (!grub_isspace (*ptr2))
          guidlen++;
@@ -175,7 +175,7 @@ read_pnvram (char *filename)
 
       /* Read guid */
       if (guidlen != sizeof (efivar->guid))
-       {   
+       {
          grub_free (buf);
          return grub_error (GRUB_ERR_BAD_OS, "can't parse %s", filename);
        }
@@ -190,14 +190,14 @@ read_pnvram (char *filename)
            hex = *ptr - 'a' + 10;
          if (*ptr >= 'A' && *ptr <= 'F')
            hex = *ptr - 'A' + 10;
-         
+
          if (i%2 == 0)
            ((grub_uint8_t *)&(efivar->guid))[i/2] = hex << 4;
          else
            ((grub_uint8_t *)&(efivar->guid))[i/2] |= hex;
          ptr++;
        }
-      
+
       while (grub_isspace (*ptr))
        ptr++;
       if (*ptr != ':')
@@ -230,23 +230,23 @@ read_pnvram (char *filename)
        {
          /* Look the length */
          datalen = 0;
-         for (ptr2 = ptr; *ptr2 && (grub_isspace (*ptr2) 
+         for (ptr2 = ptr; *ptr2 && (grub_isspace (*ptr2)
                                     || (*ptr2 >= '0' && *ptr2 <= '9')
                                     || (*ptr2 >= 'a' && *ptr2 <= 'f')
-                                    || (*ptr2 >= 'A' && *ptr2 <= 'F')); 
+                                    || (*ptr2 >= 'A' && *ptr2 <= 'F'));
               ptr2++)
            if (!grub_isspace (*ptr2))
              datalen++;
          datalen /= 2;
-        
+
          if (nvramptr - nvram + datalen > nvramsize)
            {
              grub_free (buf);
-             return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+             return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                                 "file is too large for reserved "
                                 " variable space");
            }
-         
+
          for (i = 0; i < 2 * datalen; i++)
            {
              int hex = 0;
@@ -258,7 +258,7 @@ read_pnvram (char *filename)
                hex = *ptr - 'a' + 10;
              if (*ptr >= 'A' && *ptr <= 'F')
                hex = *ptr - 'A' + 10;
-             
+
              if (i%2 == 0)
                nvramptr[i/2] = hex << 4;
              else
@@ -278,7 +278,7 @@ read_pnvram (char *filename)
            efivar->size = datalen;
          else
            efivar->namelen = datalen;
-         
+
          ptr++;
        }
     }
@@ -304,23 +304,23 @@ grub_efiemu_make_nvram (void)
       grub_free (nvram);
       return err;
     }
-  nvram_handle 
-    = grub_efiemu_request_memalign (1, nvramsize, 
+  nvram_handle
+    = grub_efiemu_request_memalign (1, nvramsize,
                                    GRUB_EFI_RUNTIME_SERVICES_DATA);
-  nvramsize_handle 
-    = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), 
+  nvramsize_handle
+    = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t),
                                    GRUB_EFI_RUNTIME_SERVICES_DATA);
   high_monotonic_count_handle
-    = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), 
+    = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t),
                                    GRUB_EFI_RUNTIME_SERVICES_DATA);
   timezone_handle
-    = grub_efiemu_request_memalign (1, sizeof (grub_uint16_t), 
+    = grub_efiemu_request_memalign (1, sizeof (grub_uint16_t),
                                    GRUB_EFI_RUNTIME_SERVICES_DATA);
   daylight_handle
-    = grub_efiemu_request_memalign (1, sizeof (grub_uint8_t), 
+    = grub_efiemu_request_memalign (1, sizeof (grub_uint8_t),
                                    GRUB_EFI_RUNTIME_SERVICES_DATA);
   accuracy_handle
-    = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), 
+    = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t),
                                    GRUB_EFI_RUNTIME_SERVICES_DATA);
 
   grub_efiemu_request_symbols (6);
@@ -341,7 +341,7 @@ grub_efiemu_pnvram (void)
 
   nvram = grub_malloc (nvramsize);
   if (!nvram)
-    return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+    return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                       "Couldn't allocate space for temporary pnvram storage");
   grub_memset (nvram, 0, nvramsize);
 
@@ -360,16 +360,16 @@ grub_cmd_efiemu_pnvram (struct grub_extcmd *cmd,
 
   nvramsize = state[0].set ? grub_strtoul (state[0].arg, 0, 0) : 2048;
   high_monotonic_count = state[1].set ? grub_strtoul (state[1].arg, 0, 0) : 1;
-  timezone = state[2].set ? grub_strtosl (state[2].arg, 0, 0) 
+  timezone = state[2].set ? grub_strtosl (state[2].arg, 0, 0)
     : GRUB_EFI_UNSPECIFIED_TIMEZONE;
   accuracy = state[3].set ? grub_strtoul (state[3].arg, 0, 0) : 50000000;
   daylight = state[4].set ? grub_strtoul (state[4].arg, 0, 0) : 0;
-  
+
   nvram = grub_malloc (nvramsize);
   if (!nvram)
-    return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+    return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                       "Couldn't allocate space for temporary pnvram storage");
-  grub_memset (nvram, 0, nvramsize);  
+  grub_memset (nvram, 0, nvramsize);
 
   if (argc == 1 && (err = read_pnvram (args[0])))
     {
@@ -387,11 +387,11 @@ void grub_efiemu_pnvram_cmd_unregister (void);
 void
 grub_efiemu_pnvram_cmd_register (void)
 {
-  cmd = grub_register_extcmd ("efiemu_pnvram", grub_cmd_efiemu_pnvram, 
+  cmd = grub_register_extcmd ("efiemu_pnvram", grub_cmd_efiemu_pnvram,
                              GRUB_COMMAND_FLAG_BOTH,
                              "efiemu_pnvram [FILENAME]",
                              "Initialise pseudo-NVRAM and load variables "
-                             "from FILE", 
+                             "from FILE",
                              options);
 }
 
index d0787293f6fa56bed625773b2bea7945f0a50288..048893317470c3ec03bd9ef05d4488dd24078efc 100644 (file)
@@ -1,4 +1,4 @@
-/* Prepare efiemu. E.g. allocate memory, load the runtime 
+/* Prepare efiemu. E.g. allocate memory, load the runtime
    to appropriate place, etc */
 /*
  *  GRUB  --  GRand Unified Bootloader
@@ -26,7 +26,7 @@
 
 grub_err_t
 SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks,
-                             struct grub_efiemu_configuration_table 
+                             struct grub_efiemu_configuration_table
                              *config_tables)
 {
   grub_err_t err;
@@ -46,8 +46,8 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks,
   /* Request space for the list of configuration tables */
   for (cur = config_tables; cur; cur = cur->next)
     cntconftables++;
-  conftable_handle 
-    = grub_efiemu_request_memalign (GRUB_EFIEMU_PAGESIZE, 
+  conftable_handle
+    = grub_efiemu_request_memalign (GRUB_EFIEMU_PAGESIZE,
                                    cntconftables * sizeof (*conftables),
                                    GRUB_EFI_RUNTIME_SERVICES_DATA);
 
@@ -69,31 +69,31 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks,
       return err;
     }
 
-  if ((err = grub_efiemu_resolve_symbol ("efiemu_system_table", 
+  if ((err = grub_efiemu_resolve_symbol ("efiemu_system_table",
                                         &handle, &off)))
     {
       grub_efiemu_unload ();
       return err;
     }
 
-  SUFFIX (grub_efiemu_system_table)  
-    = (TYPE (grub_efi_system_table) *) 
+  SUFFIX (grub_efiemu_system_table)
+    = (TYPE (grub_efi_system_table) *)
     ((grub_uint8_t *)grub_efiemu_mm_obtain_request (handle) + off);
 
   /* compute CRC32 of runtime_services */
-  if ((err = grub_efiemu_resolve_symbol ("efiemu_runtime_services", 
+  if ((err = grub_efiemu_resolve_symbol ("efiemu_runtime_services",
                                         &handle, &off)))
     return err;
   runtime_services = (TYPE (grub_efiemu_runtime_services) *)
        ((grub_uint8_t *)grub_efiemu_mm_obtain_request (handle) + off);
   runtime_services->hdr.crc32 = 0;
-  runtime_services->hdr.crc32 = grub_getcrc32 
+  runtime_services->hdr.crc32 = grub_getcrc32
     (0, runtime_services, runtime_services->hdr.header_size);
 
   /* Put pointer to the list of configuration tables in system table */
   grub_efiemu_write_value
-    (&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0, 
-     conftable_handle, 0, 1, 
+    (&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0,
+     conftable_handle, 0, 1,
      sizeof (SUFFIX (grub_efiemu_system_table)->configuration_table));
   SUFFIX(grub_efiemu_system_table)->num_table_entries = cntconftables;
 
@@ -103,7 +103,7 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks,
   i = 0;
   for (cur = config_tables; cur; cur = cur->next, i++)
     {
-      grub_memcpy (&(conftables[i].vendor_guid), &(cur->guid), 
+      grub_memcpy (&(conftables[i].vendor_guid), &(cur->guid),
                       sizeof (cur->guid));
       if (cur->get_table)
        conftables[i].vendor_table
@@ -114,13 +114,13 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks,
 
   /* compute CRC32 of system table */
   SUFFIX (grub_efiemu_system_table)->hdr.crc32 = 0;
-  SUFFIX (grub_efiemu_system_table)->hdr.crc32 
-    = grub_getcrc32 (0, SUFFIX (grub_efiemu_system_table), 
+  SUFFIX (grub_efiemu_system_table)->hdr.crc32
+    = grub_getcrc32 (0, SUFFIX (grub_efiemu_system_table),
                     SUFFIX (grub_efiemu_system_table)->hdr.header_size);
 
   grub_dprintf ("efiemu","system_table = %p, runtime_services = %p,"
                " conftables = %p (%d entries)\n",
-               SUFFIX (grub_efiemu_system_table), runtime_services, 
+               SUFFIX (grub_efiemu_system_table), runtime_services,
                conftables, cntconftables);
 
   return GRUB_ERR_NONE;
index e0923cce15b3b65197cd846f36fcbc84072b4ef2..b502314ee346bb670f838b676c262b06c799f7b2 100644 (file)
  *   %rcx,  %rdx,  %r8,  %r9,  32(%rsp), 40(%rsp), 48(%rsp), ...
  *
  */
-       
+
         .file   "efiemu.S"
        .text
-       
+
 FUNCTION (efiemu_get_time)
        push %rdi
        push %rsi
@@ -104,7 +104,7 @@ FUNCTION (efiemu_set_variable)
        mov %rcx, %rdi
        mov %rdx, %rsi
        mov %r8, %rdx
-       mov %r9, %rcx   
+       mov %r9, %rcx
        mov 56(%rsp), %r8
        call efiemu_set_variable_real
        pop %rsi
@@ -133,8 +133,8 @@ FUNCTION (efiemu_reset_system)
        ret
 
        /* The following functions are always called in physical mode */
-       .section ".text-physical", "ax"         
-       
+       .section ".text-physical", "ax"
+
 FUNCTION (efiemu_set_virtual_address_map)
        push %rdi
        push %rsi
index 0316e495728bedaea24633b7c1f71b2721649e74..085e75d0cd04d49c624bdba51655cf0302828e5b 100644 (file)
@@ -17,8 +17,8 @@
  */
 
 /* This is an emulation of EFI runtime services.
-   This allows a more uniform boot on i386 machines. 
-   As it emulates only runtime serviceit isn't able 
+   This allows a more uniform boot on i386 machines.
+   As it emulates only runtime serviceit isn't able
    to chainload EFI bootloader on non-EFI system (TODO) */
 
 #include <grub/symbol.h>
@@ -26,7 +26,7 @@
 #include <grub/efi/api.h>
 #include <grub/efiemu/runtime.h>
 
-grub_efi_status_t 
+grub_efi_status_t
 efiemu_get_time (grub_efi_time_t *time,
                 grub_efi_time_capabilities_t *capabilities);
 grub_efi_status_t
@@ -54,7 +54,7 @@ efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size,
   PHYSICAL_ATTRIBUTE;
 
 grub_efi_status_t
-efiemu_convert_pointer (grub_efi_uintn_t debug_disposition, 
+efiemu_convert_pointer (grub_efi_uintn_t debug_disposition,
                        void **address)
   PHYSICAL_ATTRIBUTE;
 
@@ -84,14 +84,14 @@ efiemu_reset_system (grub_efi_reset_type_t reset_type,
                     grub_efi_uintn_t data_size,
                     grub_efi_char16_t *reset_data);
 
-grub_efi_status_t 
+grub_efi_status_t
 EFI_FUNC (efiemu_set_virtual_address_map) (grub_efi_uintn_t,
                                              grub_efi_uintn_t,
                                              grub_efi_uint32_t,
                                              grub_efi_memory_descriptor_t *)
      PHYSICAL_ATTRIBUTE;
 grub_efi_status_t
-EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, 
+EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition,
                                      void **address)
      PHYSICAL_ATTRIBUTE;
 static grub_uint32_t
@@ -100,15 +100,15 @@ efiemu_getcrc32 (grub_uint32_t crc, void *buf, int size)
 static void
 init_crc32_table (void)
      PHYSICAL_ATTRIBUTE;
-static grub_uint32_t 
+static grub_uint32_t
 reflect (grub_uint32_t ref, int len)
      PHYSICAL_ATTRIBUTE;
-                            
+
 /*
   The log. It's used when examining memory dump
-*/                                  
+*/
 static grub_uint8_t loge[1000] = "EFIEMULOG";
-static int logn = 9; 
+static int logn = 9;
 #define LOG(x)   { if (logn<900) loge[logn++]=x; }
 
 static int ptv_relocated = 0;
@@ -189,7 +189,7 @@ int __stack_chk_fail ()
   return 0;
 }
 
-/* The function that implement runtime services as specified in 
+/* The function that implement runtime services as specified in
    EFI specification */
 static inline grub_uint8_t
 bcd_to_hex (grub_uint8_t in)
@@ -197,7 +197,7 @@ bcd_to_hex (grub_uint8_t in)
   return 10 * ((in & 0xf0) >> 4) + (in & 0x0f);
 }
 
-grub_efi_status_t 
+grub_efi_status_t
 EFI_FUNC (efiemu_get_time) (grub_efi_time_t *time,
                               grub_efi_time_capabilities_t *capabilities)
 {
@@ -279,19 +279,19 @@ EFI_FUNC (efiemu_set_wakeup_time) (grub_efi_boolean_t enabled,
 
 static grub_uint32_t crc32_table [256];
 
-static grub_uint32_t 
+static grub_uint32_t
 reflect (grub_uint32_t ref, int len)
 {
   grub_uint32_t result = 0;
   int i;
-  
+
   for (i = 1; i <= len; i++)
     {
       if (ref & 1)
        result |= 1 << (len - i);
       ref >>= 1;
     }
-  
+
   return result;
 }
 
@@ -332,7 +332,7 @@ efiemu_getcrc32 (grub_uint32_t crc, void *buf, int size)
 }
 
 
-grub_efi_status_t EFI_FUNC 
+grub_efi_status_t EFI_FUNC
 (efiemu_set_virtual_address_map) (grub_efi_uintn_t memory_map_size,
                                  grub_efi_uintn_t descriptor_size,
                                  grub_efi_uint32_t descriptor_version,
@@ -341,12 +341,12 @@ grub_efi_status_t EFI_FUNC
   struct grub_efiemu_ptv_rel *cur_relloc;
 
   LOG ('e');
-  
+
   /* Ensure that we are called only once */
   if (ptv_relocated)
     return GRUB_EFI_UNSUPPORTED;
   ptv_relocated = 1;
-  
+
   /* Correct addresses using information supplied by grub */
   for (cur_relloc = efiemu_ptv_relloc; cur_relloc->size;cur_relloc++)
     {
@@ -354,8 +354,8 @@ grub_efi_status_t EFI_FUNC
       grub_efi_memory_descriptor_t *descptr;
 
       /* Compute correction */
-      for (descptr = virtual_map;  
-          ((grub_uint8_t *) descptr - (grub_uint8_t *) virtual_map) 
+      for (descptr = virtual_map;
+          ((grub_uint8_t *) descptr - (grub_uint8_t *) virtual_map)
             < memory_map_size;
           descptr = (grub_efi_memory_descriptor_t *)
             ((grub_uint8_t *) descptr + descriptor_size))
@@ -386,27 +386,27 @@ grub_efi_status_t EFI_FUNC
 
   /* Recompute crc32 of system table and runtime services */
   efiemu_system_table.hdr.crc32 = 0;
-  efiemu_system_table.hdr.crc32 = efiemu_getcrc32 
+  efiemu_system_table.hdr.crc32 = efiemu_getcrc32
     (0, &efiemu_system_table, sizeof (efiemu_system_table));
 
   efiemu_runtime_services.hdr.crc32 = 0;
-  efiemu_runtime_services.hdr.crc32 = efiemu_getcrc32 
+  efiemu_runtime_services.hdr.crc32 = efiemu_getcrc32
     (0, &efiemu_runtime_services, sizeof (efiemu_runtime_services));
 
   return GRUB_EFI_SUCCESS;
 }
 
-/* since efiemu_set_virtual_address_map corrects all the pointers 
+/* since efiemu_set_virtual_address_map corrects all the pointers
    we don't need efiemu_convert_pointer */
 grub_efi_status_t
-EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, 
+EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition,
                                      void **address)
 {
   LOG ('f');
   return GRUB_EFI_UNSUPPORTED;
 }
 
-/* Next comes variable services. Because we have no vendor-independent 
+/* Next comes variable services. Because we have no vendor-independent
    way to store these variables we have no non-volatility */
 
 /* Find variable by name and GUID. */
@@ -423,7 +423,7 @@ find_variable (grub_efi_guid_t *vendor_guid,
       if (!efivar->namelen)
        return 0;
       if (efiemu_str16equal((grub_efi_char16_t *)(efivar + 1), variable_name)
-         && efiemu_memequal (&(efivar->guid), vendor_guid, 
+         && efiemu_memequal (&(efivar->guid), vendor_guid,
                              sizeof (efivar->guid)))
        return efivar;
       ptr += efivar->namelen + efivar->size + sizeof (*efivar);
@@ -452,11 +452,11 @@ EFI_FUNC (efiemu_get_variable) (grub_efi_char16_t *variable_name,
   efiemu_memcpy (data, (grub_uint8_t *)(efivar + 1) + efivar->namelen,
                 efivar->size);
   *attributes = efivar->attributes;
-  
+
   return GRUB_EFI_SUCCESS;
 }
 
-grub_efi_status_t EFI_FUNC 
+grub_efi_status_t EFI_FUNC
 (efiemu_get_next_variable_name) (grub_efi_uintn_t *variable_name_size,
                                 grub_efi_char16_t *variable_name,
                                 grub_efi_guid_t *vendor_guid)
@@ -471,15 +471,15 @@ grub_efi_status_t EFI_FUNC
       efivar = find_variable (vendor_guid, variable_name);
       if (!efivar)
        return GRUB_EFI_NOT_FOUND;
-      efivar = (struct efi_variable *)((grub_uint8_t *)efivar 
-                                      + efivar->namelen 
+      efivar = (struct efi_variable *)((grub_uint8_t *)efivar
+                                      + efivar->namelen
                                       + efivar->size + sizeof (*efivar));
     }
   else
     efivar = (struct efi_variable *) (efiemu_variables);
 
   LOG ('m');
-  if ((grub_uint8_t *)efivar >= efiemu_variables + efiemu_varsize 
+  if ((grub_uint8_t *)efivar >= efiemu_variables + efiemu_varsize
       || !efivar->namelen)
     return GRUB_EFI_NOT_FOUND;
   if (*variable_name_size < efivar->namelen)
@@ -489,7 +489,7 @@ grub_efi_status_t EFI_FUNC
     }
 
   efiemu_memcpy (variable_name, efivar + 1, efivar->namelen);
-  efiemu_memcpy (vendor_guid, &(efivar->guid), 
+  efiemu_memcpy (vendor_guid, &(efivar->guid),
                 sizeof (efivar->guid));
 
   LOG('h');
@@ -513,12 +513,12 @@ EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name,
   /* Delete variable if any */
   if (efivar)
     {
-      efiemu_memcpy (efivar, (grub_uint8_t *)(efivar + 1) 
-                    + efivar->namelen + efivar->size, 
+      efiemu_memcpy (efivar, (grub_uint8_t *)(efivar + 1)
+                    + efivar->namelen + efivar->size,
                     (efiemu_variables + efiemu_varsize)
-                    - ((grub_uint8_t *)(efivar + 1) 
+                    - ((grub_uint8_t *)(efivar + 1)
                        + efivar->namelen + efivar->size));
-      efiemu_memset (efiemu_variables + efiemu_varsize 
+      efiemu_memset (efiemu_variables + efiemu_varsize
                     - (sizeof (*efivar) + efivar->namelen + efivar->size),
                     0, (sizeof (*efivar) + efivar->namelen + efivar->size));
     }
@@ -533,8 +533,8 @@ EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name,
       if (!efivar->namelen)
        break;
     }
-  if ((grub_uint8_t *)(efivar + 1) + data_size 
-      + 2 * (efiemu_str16len (variable_name) + 1) 
+  if ((grub_uint8_t *)(efivar + 1) + data_size
+      + 2 * (efiemu_str16len (variable_name) + 1)
       >= efiemu_variables + efiemu_varsize)
     return GRUB_EFI_OUT_OF_RESOURCES;
 
@@ -542,16 +542,16 @@ EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name,
   efivar->namelen = 2 * (efiemu_str16len (variable_name) + 1);
   efivar->size = data_size;
   efivar->attributes = attributes;
-  efiemu_memcpy (efivar + 1, variable_name, 
+  efiemu_memcpy (efivar + 1, variable_name,
                 2 * (efiemu_str16len (variable_name) + 1));
-  efiemu_memcpy ((grub_uint8_t *)(efivar + 1) 
-                + 2 * (efiemu_str16len (variable_name) + 1), 
+  efiemu_memcpy ((grub_uint8_t *)(efivar + 1)
+                + 2 * (efiemu_str16len (variable_name) + 1),
                 data, data_size);
 
   return GRUB_EFI_SUCCESS;
 }
 
-grub_efi_status_t EFI_FUNC 
+grub_efi_status_t EFI_FUNC
 (efiemu_get_next_high_monotonic_count) (grub_efi_uint32_t *high_count)
 {
   LOG ('j');
@@ -574,9 +574,9 @@ EFI_FUNC (efiemu_reset_system) (grub_efi_reset_type_t reset_type,
   LOG ('k');
 }
 
-struct grub_efi_runtime_services efiemu_runtime_services = 
+struct grub_efi_runtime_services efiemu_runtime_services =
 {
-  .hdr = 
+  .hdr =
   {
     .signature = GRUB_EFIEMU_RUNTIME_SERVICES_SIGNATURE,
     .revision = 0x0001000a,
@@ -596,18 +596,18 @@ struct grub_efi_runtime_services efiemu_runtime_services =
   .get_next_variable_name = efiemu_get_next_variable_name,
   .set_variable = efiemu_set_variable,
   .get_next_high_monotonic_count = efiemu_get_next_high_monotonic_count,
-  
+
   .reset_system = efiemu_reset_system
 };
 
 
-static grub_uint16_t efiemu_vendor[] = 
+static grub_uint16_t efiemu_vendor[] =
   {'G', 'R', 'U', 'B', ' ', 'E', 'F', 'I', ' ',
    'R', 'U', 'N', 'T', 'I', 'M', 'E', 0};
 
 struct grub_efi_system_table efiemu_system_table =
 {
-  .hdr = 
+  .hdr =
   {
     .signature = GRUB_EFIEMU_SYSTEM_TABLE_SIGNATURE,
     .revision = 0x0001000a,
index 1ae059ad439a1ac050a686341a530f54f51a3099..5a492dc2f995c7f3dae6a1d7094abf6842fbe81f 100644 (file)
@@ -1,4 +1,4 @@
 gcc -c -m32 -DELF32 -o efiemu32.o ./efiemu.c -Wall -Werror -nostdlib -O2 -I. -I../../include
 gcc -c -m64 -DELF64 -o efiemu64_c.o ./efiemu.c -Wall -Werror -mcmodel=large -O2 -I. -I../../include
 gcc -c -m64 -DELF64 -o efiemu64_s.o ./efiemu.S -Wall -Werror -mcmodel=large -O2 -I. -I../../include
-ld -o efiemu64.o -r efiemu64_s.o efiemu64_c.o -nostdlib 
+ld -o efiemu64.o -r efiemu64_s.o efiemu64_c.o -nostdlib
index b3111b6167d5ef5ad7d1399395a7241727d62089..ec508d97535b6f0cba95bd1ed766fb85a7166b3b 100644 (file)
@@ -57,16 +57,16 @@ grub_efiemu_free_syms (void)
 }
 
 /* Announce that the module will need NUM allocators */
-/* Because of deferred memory allocation all the relocators have to be 
+/* Because of deferred memory allocation all the relocators have to be
    announced during phase 1*/
 grub_err_t
 grub_efiemu_request_symbols (int num)
 {
   if (ptv_alloc)
-    return grub_error (GRUB_ERR_BAD_ARGUMENT, 
+    return grub_error (GRUB_ERR_BAD_ARGUMENT,
                       "symbols have already been allocated");
   if (num < 0)
-    return grub_error (GRUB_ERR_BAD_ARGUMENT, 
+    return grub_error (GRUB_ERR_BAD_ARGUMENT,
                       "can't request negative symbols");
   ptv_requested += num;
   return GRUB_ERR_NONE;
@@ -111,15 +111,15 @@ grub_err_t
 grub_efiemu_alloc_syms (void)
 {
   ptv_alloc = ptv_requested;
-  ptv_handle = grub_efiemu_request_memalign 
-    (1, (ptv_requested + 1) * sizeof (struct grub_efiemu_ptv_rel), 
+  ptv_handle = grub_efiemu_request_memalign
+    (1, (ptv_requested + 1) * sizeof (struct grub_efiemu_ptv_rel),
      GRUB_EFI_RUNTIME_SERVICES_DATA);
   grub_efiemu_register_symbol ("efiemu_ptv_relloc", ptv_handle, 0);
   return grub_errno;
 }
 
-/* Write value (pointer to memory PLUS_HANDLE) 
-   - (pointer to memory MINUS_HANDLE) + VALUE to ADDR assuming that the 
+/* Write value (pointer to memory PLUS_HANDLE)
+   - (pointer to memory MINUS_HANDLE) + VALUE to ADDR assuming that the
    size SIZE bytes. If PTV_NEEDED is 1 then announce it to runtime that this
    value needs to be recomputed before going to virtual mode
 */
@@ -130,22 +130,22 @@ grub_efiemu_write_value (void *addr, grub_uint32_t value, int plus_handle,
   /* Announce relocator to runtime */
   if (ptv_needed)
     {
-      struct grub_efiemu_ptv_rel *ptv_rels 
+      struct grub_efiemu_ptv_rel *ptv_rels
        = grub_efiemu_mm_obtain_request (ptv_handle);
 
       if (ptv_needed && ptv_written >= ptv_alloc)
-       return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+       return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                           "your module didn't declare efiemu "
                           " relocators correctly");
 
       if (minus_handle)
-       ptv_rels[ptv_written].minustype 
+       ptv_rels[ptv_written].minustype
          = grub_efiemu_mm_get_type (minus_handle);
       else
        ptv_rels[ptv_written].minustype = 0;
 
       if (plus_handle)
-       ptv_rels[ptv_written].plustype 
+       ptv_rels[ptv_written].plustype
          = grub_efiemu_mm_get_type (plus_handle);
       else
        ptv_rels[ptv_written].plustype = 0;
@@ -153,7 +153,7 @@ grub_efiemu_write_value (void *addr, grub_uint32_t value, int plus_handle,
       ptv_rels[ptv_written].addr = PTR_TO_UINT64 (addr);
       ptv_rels[ptv_written].size = size;
       ptv_written++;
-      
+
       /* memset next value to zero to mark the end */
       grub_memset (&ptv_rels[ptv_written], 0, sizeof (ptv_rels[ptv_written]));
     }
index 9d788a9f867ecc83dbb0737dd8a78d5d0c34f40c..f0a01af2d77c044296d8148f07e025d03120fa8f 100644 (file)
@@ -36,7 +36,7 @@ struct char_index_entry
   grub_uint32_t code;
   grub_uint8_t storage_flags;
   grub_uint32_t offset;
-  
+
   /* Glyph if loaded, or NULL otherwise.  */
   struct grub_font_glyph *glyph;
 };
@@ -72,13 +72,13 @@ struct font_file_section
 {
   /* The file this section is in.  */
   grub_file_t file;
-  
+
   /* FOURCC name of the section.  */
   char name[4];
-  
+
   /* Length of the section contents.  */
   grub_uint32_t length;
-  
+
   /* Set by open_section() on EOF.  */
   int eof;
 };
@@ -170,10 +170,10 @@ font_init (grub_font_t font)
   font->family = 0;
   font->point_size = 0;
   font->weight = 0;
-  
+
   /* Default leading value, not in font file yet.  */
   font->leading = 1;
-  
+
   font->max_char_width = 0;
   font->max_char_height = 0;
   font->ascent = 0;
@@ -646,7 +646,7 @@ grub_font_get_glyph_internal (grub_font_t font, grub_uint32_t code)
 
       if (! font->file)
         /* No open file, can't load any glyphs.  */
-        return 0;     
+        return 0;
 
       /* Make sure we can find glyphs for error messages.  Push active
          error message to error stack and reset error message.  */
@@ -900,7 +900,7 @@ get_font_diversity(grub_font_t a, grub_font_t b)
   else
     /* Penalty for missing attributes.  */
     d += 50;
-  
+
   /* Weight is a minor factor. */
   d += (a->weight != b->weight) ? 5 : 0;
 
@@ -991,13 +991,13 @@ grub_font_draw_glyph (struct grub_font_glyph *glyph,
     | GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP;
   glyph_bitmap.mode_info.blit_format = GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED;
   glyph_bitmap.mode_info.bpp = 1;
-  
+
   /* Really 1 bit per pixel.  */
   glyph_bitmap.mode_info.bytes_per_pixel = 0;
-  
+
   /* Packed densely as bits.  */
   glyph_bitmap.mode_info.pitch = glyph->width;
-  
+
   glyph_bitmap.mode_info.number_of_colors = 2;
   glyph_bitmap.mode_info.bg_red = 0;
   glyph_bitmap.mode_info.bg_green = 0;
index c3f428316558c32bcbaa0681ef71a92e1dfc5c58..0402b8d77d9719c563e2b236e4b5f5a11e4c7131 100644 (file)
@@ -71,7 +71,7 @@ GRUB_MOD_INIT(font_manager)
 
 GRUB_MOD_FINI(font_manager)
 {
-  /* TODO: Determine way to free allocated resources.  
+  /* TODO: Determine way to free allocated resources.
      Warning: possible pointer references could be in use.  */
 
   grub_unregister_command (cmd_loadfont);
index 4b729c20796a702df4cc656399d4a1a983d398bd..286b99f9a0a7bdfbc3e6458c13f6d05e09e77e71 100644 (file)
--- a/fs/affs.c
+++ b/fs/affs.c
@@ -127,7 +127,7 @@ grub_affs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
                      sizeof (file), &file);
       if (grub_errno)
        return 0;
-         
+
       block = grub_be_to_cpu32 (file.extension);
     }
 
@@ -139,7 +139,7 @@ grub_affs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
                  sizeof (pos), &pos);
   if (grub_errno)
     return 0;
-  
+
   return grub_be_to_cpu32 (pos);
 }
 
@@ -353,7 +353,7 @@ grub_affs_iterate_dir (grub_fshelp_node_t dir,
                          sizeof (file), (char *) &file);
          if (grub_errno)
            goto fail;
-         
+
          file.name[file.namelen] = '\0';
 
          if ((int) grub_be_to_cpu32 (file.type) == GRUB_AFFS_FILETYPE_DIR)
@@ -370,7 +370,7 @@ grub_affs_iterate_dir (grub_fshelp_node_t dir,
            return 1;
 
          next = grub_be_to_cpu32 (file.next);
-       }      
+       }
     }
 
   grub_free (hashtable);
@@ -389,18 +389,18 @@ grub_affs_open (struct grub_file *file, const char *name)
 {
   struct grub_affs_data *data;
   struct grub_fshelp_node *fdiro = 0;
-  
+
   grub_dl_ref (my_mod);
-  
+
   data = grub_affs_mount (file->device->disk);
   if (!data)
     goto fail;
-  
+
   grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_affs_iterate_dir,
                         grub_affs_read_symlink, GRUB_FSHELP_REG);
   if (grub_errno)
     goto fail;
-  
+
   file->size = fdiro->size;
   data->diropen = *fdiro;
   grub_free (fdiro);
@@ -414,7 +414,7 @@ grub_affs_open (struct grub_file *file, const char *name)
   if (data && fdiro != &data->diropen)
     grub_free (fdiro);
   grub_free (data);
-  
+
   grub_dl_unref (my_mod);
 
   return grub_errno;
@@ -436,7 +436,7 @@ grub_affs_close (grub_file_t file)
 static grub_ssize_t
 grub_affs_read (grub_file_t file, char *buf, grub_size_t len)
 {
-  struct grub_affs_data *data = 
+  struct grub_affs_data *data =
     (struct grub_affs_data *) file->data;
 
   int size = grub_affs_read_file (&data->diropen, file->read_hook,
@@ -447,13 +447,13 @@ grub_affs_read (grub_file_t file, char *buf, grub_size_t len)
 
 
 static grub_err_t
-grub_affs_dir (grub_device_t device, const char *path, 
-              int (*hook) (const char *filename, 
+grub_affs_dir (grub_device_t device, const char *path,
+              int (*hook) (const char *filename,
                            const struct grub_dirhook_info *info))
 {
   struct grub_affs_data *data = 0;
   struct grub_fshelp_node *fdiro = 0;
-  
+
   auto int NESTED_FUNC_ATTR iterate (const char *filename,
                                     enum grub_fshelp_filetype filetype,
                                     grub_fshelp_node_t node);
@@ -470,18 +470,18 @@ grub_affs_dir (grub_device_t device, const char *path,
     }
 
   grub_dl_ref (my_mod);
-  
+
   data = grub_affs_mount (device->disk);
   if (!data)
     goto fail;
-  
+
   grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_affs_iterate_dir,
                         grub_affs_read_symlink, GRUB_FSHELP_DIR);
   if (grub_errno)
     goto fail;
 
   grub_affs_iterate_dir (fdiro, iterate);
-  
+
  fail:
   if (data && fdiro != &data->diropen)
     grub_free (fdiro);
index ea1de4f217f6d786b98be885d9b89370e53e7d28..1f6e1633c6a8dea0331652f06757bb77d3daabd1 100644 (file)
--- a/fs/afs.c
+++ b/fs/afs.c
@@ -554,7 +554,7 @@ grub_afs_close (grub_file_t file)
 
 static grub_err_t
 grub_afs_dir (grub_device_t device, const char *path,
-              int (*hook) (const char *filename, 
+              int (*hook) (const char *filename,
                           const struct grub_dirhook_info *info))
 {
   struct grub_afs_data *data = 0;;
index 0ef263ce5ab0f9a6c028e9793de8ad02b55197df..1ec4ebeaf4cf482c3c8d7d05f9bae067a4dee4f6 100644 (file)
--- a/fs/cpio.c
+++ b/fs/cpio.c
@@ -181,7 +181,7 @@ fail:
 
 static grub_err_t
 grub_cpio_dir (grub_device_t device, const char *path,
-              int (*hook) (const char *filename, 
+              int (*hook) (const char *filename,
                            const struct grub_dirhook_info *info))
 {
   struct grub_cpio_data *data;
@@ -286,13 +286,13 @@ grub_cpio_open (grub_file_t file, const char *name)
        {
          if (name[i] != fn[j])
            goto no_match;
-         
+
          if (name[i] == '\0')
            break;
-         
+
          if (name[i] == '/' && name[i+1] == '/')
            i++;
-         
+
          i++;
          j++;
        }
@@ -304,7 +304,7 @@ grub_cpio_open (grub_file_t file, const char *name)
       return GRUB_ERR_NONE;
 
     no_match:
-      
+
       grub_free (fn);
       data->hofs = ofs;
     }
index 93b6db218350cba31587f738fc02d15ca5144b53..0fff2fef8e97b70c46f75890a19d381cd6118ba1 100644 (file)
--- a/fs/ext2.c
+++ b/fs/ext2.c
@@ -54,7 +54,7 @@
 /* Log2 size of ext2 block in 512 blocks.  */
 #define LOG2_EXT2_BLOCK_SIZE(data)                     \
        (grub_le_to_cpu32 (data->sblock.log2_block_size) + 1)
-     
+
 /* Log2 size of ext2 block in bytes.  */
 #define LOG2_BLOCK_SIZE(data)                                  \
        (grub_le_to_cpu32 (data->sblock.log2_block_size) + 10)
@@ -324,7 +324,7 @@ static grub_dl_t my_mod;
 /* Read into BLKGRP the blockgroup descriptor of blockgroup GROUP of
    the mounted filesystem DATA.  */
 inline static grub_err_t
-grub_ext2_blockgroup (struct grub_ext2_data *data, int group, 
+grub_ext2_blockgroup (struct grub_ext2_data *data, int group,
                      struct grub_ext2_block_group *blkgrp)
 {
   return grub_disk_read (data->disk,
@@ -382,7 +382,7 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
   int blknr = -1;
   unsigned int blksz = EXT2_BLOCK_SIZE (data);
   int log2_blksz = LOG2_EXT2_BLOCK_SIZE (data);
-  
+
   if (grub_le_to_cpu32(inode->flags) & EXT4_EXTENTS_FLAG)
     {
       char buf[EXT2_BLOCK_SIZE(data)];
@@ -440,14 +440,14 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
                          << log2_blksz,
                          0, blksz, indir))
        return grub_errno;
-         
+
       blknr = grub_le_to_cpu32 (indir[fileblock - INDIRECT_BLOCKS]);
     }
   /* Double indirect.  */
   else if (fileblock < INDIRECT_BLOCKS + blksz / 4 * (blksz / 4 + 1))
     {
       unsigned int perblock = blksz / 4;
-      unsigned int rblock = fileblock - (INDIRECT_BLOCKS 
+      unsigned int rblock = fileblock - (INDIRECT_BLOCKS
                                         + blksz / 4);
       grub_uint32_t indir[blksz / 4];
 
@@ -463,7 +463,7 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
                          0, blksz, indir))
        return grub_errno;
 
-      
+
       blknr = grub_le_to_cpu32 (indir[rblock % perblock]);
     }
   /* triple indirect.  */
@@ -488,7 +488,7 @@ grub_ext2_read_file (grub_fshelp_node_t node,
                                pos, len, buf, grub_ext2_read_block,
                                node->inode.size,
                                LOG2_EXT2_BLOCK_SIZE (node->data));
-    
+
 }
 
 
@@ -505,7 +505,7 @@ grub_ext2_read_inode (struct grub_ext2_data *data,
 
   /* It is easier to calculate if the first inode is 0.  */
   ino--;
-  
+
   grub_ext2_blockgroup (data,
                         ino / grub_le_to_cpu32 (sblock->inodes_per_group),
                        &blkgrp);
@@ -525,7 +525,7 @@ grub_ext2_read_inode (struct grub_ext2_data *data,
                      EXT2_INODE_SIZE (data) * blkoff,
                      sizeof (struct grub_ext2_inode), inode))
     return grub_errno;
-  
+
   return 0;
 }
 
@@ -550,7 +550,7 @@ grub_ext2_mount (grub_disk_t disk)
       grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem");
       goto fail;
     }
-  
+
   /* Check the FS doesn't have feature bits enabled that we don't support. */
   if (grub_le_to_cpu32 (data->sblock.feature_incompat)
         & ~(EXT2_DRIVER_SUPPORTED_INCOMPAT | EXT2_DRIVER_IGNORED_INCOMPAT))
@@ -558,8 +558,8 @@ grub_ext2_mount (grub_disk_t disk)
       grub_error (GRUB_ERR_BAD_FS, "filesystem has unsupported incompatible features");
       goto fail;
     }
-    
-  
+
+
   data->disk = disk;
 
   data->diropen.data = data;
@@ -571,7 +571,7 @@ grub_ext2_mount (grub_disk_t disk)
   grub_ext2_read_inode (data, 2, data->inode);
   if (grub_errno)
     goto fail;
-  
+
   return data;
 
  fail:
@@ -587,23 +587,23 @@ grub_ext2_read_symlink (grub_fshelp_node_t node)
 {
   char *symlink;
   struct grub_fshelp_node *diro = node;
-  
+
   if (! diro->inode_read)
     {
       grub_ext2_read_inode (diro->data, diro->ino, &diro->inode);
       if (grub_errno)
        return 0;
     }
-  
+
   symlink = grub_malloc (grub_le_to_cpu32 (diro->inode.size) + 1);
   if (! symlink)
     return 0;
-  
+
   /* If the filesize of the symlink is bigger than
      60 the symlink is stored in a separate block,
      otherwise it is stored in the inode.  */
   if (grub_le_to_cpu32 (diro->inode.size) <= 60)
-    grub_strncpy (symlink, 
+    grub_strncpy (symlink,
                  diro->inode.symlink,
                  grub_le_to_cpu32 (diro->inode.size));
   else
@@ -617,7 +617,7 @@ grub_ext2_read_symlink (grub_fshelp_node_t node)
          return 0;
        }
     }
-  
+
   symlink[grub_le_to_cpu32 (diro->inode.size)] = '\0';
   return symlink;
 }
@@ -631,14 +631,14 @@ grub_ext2_iterate_dir (grub_fshelp_node_t dir,
 {
   unsigned int fpos = 0;
   struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;
-  
+
   if (! diro->inode_read)
     {
       grub_ext2_read_inode (diro->data, diro->ino, &diro->inode);
       if (grub_errno)
        return 0;
     }
-  
+
   /* Search the file.  */
   while (fpos < grub_le_to_cpu32 (diro->inode.size))
     {
@@ -648,25 +648,25 @@ grub_ext2_iterate_dir (grub_fshelp_node_t dir,
                           (char *) &dirent);
       if (grub_errno)
        return 0;
-      
+
       if (dirent.namelen != 0)
        {
          char filename[dirent.namelen + 1];
          struct grub_fshelp_node *fdiro;
          enum grub_fshelp_filetype type = GRUB_FSHELP_UNKNOWN;
-         
+
          grub_ext2_read_file (diro, 0, fpos + sizeof (struct ext2_dirent),
                               dirent.namelen, filename);
          if (grub_errno)
            return 0;
-         
+
          fdiro = grub_malloc (sizeof (struct grub_fshelp_node));
          if (! fdiro)
            return 0;
-         
+
          fdiro->data = diro->data;
          fdiro->ino = grub_le_to_cpu32 (dirent.inode);
-         
+
          filename[dirent.namelen] = '\0';
 
          if (dirent.filetype != FILETYPE_UNKNOWN)
@@ -692,9 +692,9 @@ grub_ext2_iterate_dir (grub_fshelp_node_t dir,
                  grub_free (fdiro);
                  return 0;
                }
-             
+
              fdiro->inode_read = 1;
-             
+
              if ((grub_le_to_cpu16 (fdiro->inode.mode)
                   & FILETYPE_INO_MASK) == FILETYPE_INO_DIRECTORY)
                type = GRUB_FSHELP_DIR;
@@ -705,14 +705,14 @@ grub_ext2_iterate_dir (grub_fshelp_node_t dir,
                        & FILETYPE_INO_MASK) == FILETYPE_INO_REG)
                type = GRUB_FSHELP_REG;
            }
-         
+
          if (hook (filename, type, fdiro))
            return 1;
        }
-      
+
       fpos += grub_le_to_cpu16 (dirent.direntlen);
     }
-  
+
   return 0;
 }
 
@@ -722,25 +722,25 @@ grub_ext2_open (struct grub_file *file, const char *name)
 {
   struct grub_ext2_data *data;
   struct grub_fshelp_node *fdiro = 0;
-  
+
   grub_dl_ref (my_mod);
-  
+
   data = grub_ext2_mount (file->device->disk);
   if (! data)
     goto fail;
-  
+
   grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_ext2_iterate_dir,
                         grub_ext2_read_symlink, GRUB_FSHELP_REG);
   if (grub_errno)
     goto fail;
-  
+
   if (! fdiro->inode_read)
     {
       grub_ext2_read_inode (data, fdiro->ino, &fdiro->inode);
       if (grub_errno)
        goto fail;
     }
-  
+
   grub_memcpy (data->inode, &fdiro->inode, sizeof (struct grub_ext2_inode));
   grub_free (fdiro);
 
@@ -754,7 +754,7 @@ grub_ext2_open (struct grub_file *file, const char *name)
   if (fdiro != &data->diropen)
     grub_free (fdiro);
   grub_free (data);
-  
+
   grub_dl_unref (my_mod);
 
   return grub_errno;
@@ -775,20 +775,20 @@ static grub_ssize_t
 grub_ext2_read (grub_file_t file, char *buf, grub_size_t len)
 {
   struct grub_ext2_data *data = (struct grub_ext2_data *) file->data;
-  
+
   return grub_ext2_read_file (&data->diropen, file->read_hook,
                              file->offset, len, buf);
 }
 
 
 static grub_err_t
-grub_ext2_dir (grub_device_t device, const char *path, 
-              int (*hook) (const char *filename, 
+grub_ext2_dir (grub_device_t device, const char *path,
+              int (*hook) (const char *filename,
                            const struct grub_dirhook_info *info))
 {
   struct grub_ext2_data *data = 0;;
   struct grub_fshelp_node *fdiro = 0;
-  
+
   auto int NESTED_FUNC_ATTR iterate (const char *filename,
                                     enum grub_fshelp_filetype filetype,
                                     grub_fshelp_node_t node);
@@ -818,18 +818,18 @@ grub_ext2_dir (grub_device_t device, const char *path,
     }
 
   grub_dl_ref (my_mod);
-  
+
   data = grub_ext2_mount (device->disk);
   if (! data)
     goto fail;
-  
+
   grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_ext2_iterate_dir,
                         grub_ext2_read_symlink, GRUB_FSHELP_DIR);
   if (grub_errno)
     goto fail;
-  
+
   grub_ext2_iterate_dir (fdiro, iterate);
-  
+
  fail:
   if (fdiro != &data->diropen)
     grub_free (fdiro);
@@ -890,7 +890,7 @@ grub_ext2_uuid (grub_device_t device, char **uuid)
 }
 
 /* Get mtime.  */
-static grub_err_t 
+static grub_err_t
 grub_ext2_mtime (grub_device_t device, grub_int32_t *tm)
 {
   struct grub_ext2_data *data;
@@ -901,7 +901,7 @@ grub_ext2_mtime (grub_device_t device, grub_int32_t *tm)
   data = grub_ext2_mount (disk);
   if (!data)
     *tm = 0;
-  else 
+  else
     *tm = grub_le_to_cpu32 (data->sblock.utime);
 
   grub_dl_unref (my_mod);
index a7d40dc861cc16f1b9efffb6859236cc52687bd1..cc733362fc7cd79b331a6a30775c26f78ab095dd 100644 (file)
--- a/fs/fat.c
+++ b/fs/fat.c
@@ -126,15 +126,15 @@ struct grub_fat_data
 {
   int logical_sector_bits;
   grub_uint32_t num_sectors;
-  
+
   grub_uint16_t fat_sector;
   grub_uint32_t sectors_per_fat;
   int fat_size;
-  
+
   grub_uint32_t root_cluster;
   grub_uint32_t root_sector;
   grub_uint32_t num_root_sectors;
-  
+
   int cluster_bits;
   grub_uint32_t cluster_eof_mark;
   grub_uint32_t cluster_sector;
@@ -155,7 +155,7 @@ static int
 fat_log2 (unsigned x)
 {
   int i;
-  
+
   if (x == 0)
     return -1;
 
@@ -190,14 +190,14 @@ grub_fat_mount (grub_disk_t disk)
       && grub_strncmp((const char *) bpb.version_specific.fat12_or_fat16.fstype, "FAT16", 5)
       && grub_strncmp((const char *) bpb.version_specific.fat32.fstype, "FAT32", 5))
     goto fail;
-  
+
   /* Get the sizes of logical sectors and clusters.  */
   data->logical_sector_bits =
     fat_log2 (grub_le_to_cpu16 (bpb.bytes_per_sector));
   if (data->logical_sector_bits < GRUB_DISK_SECTOR_BITS)
     goto fail;
   data->logical_sector_bits -= GRUB_DISK_SECTOR_BITS;
-  
+
   data->cluster_bits = fat_log2 (bpb.sectors_per_cluster);
   if (data->cluster_bits < 0)
     goto fail;
@@ -248,16 +248,16 @@ grub_fat_mount (grub_disk_t disk)
     {
       /* FAT32.  */
       grub_uint16_t flags = grub_le_to_cpu16 (bpb.version_specific.fat32.extended_flags);
-      
+
       data->root_cluster = grub_le_to_cpu32 (bpb.version_specific.fat32.root_cluster);
       data->fat_size = 32;
       data->cluster_eof_mark = 0x0ffffff8;
-      
+
       if (flags & 0x80)
        {
          /* Get an active FAT.  */
          unsigned active_fat = flags & 0xf;
-         
+
          if (active_fat > bpb.num_fats)
            goto fail;
 
@@ -320,7 +320,7 @@ grub_fat_mount (grub_disk_t disk)
     data->uuid = grub_le_to_cpu32 (bpb.version_specific.fat12_or_fat16.num_serial);
   else
     data->uuid = grub_le_to_cpu32 (bpb.version_specific.fat32.num_serial);
-  
+
   /* Ignore the 3rd bit, because some BIOSes assigns 0xF0 to the media
      descriptor, even if it is a so-called superfloppy (e.g. an USB key).
      The check may be too strict for this kind of stupid BIOSes, as
@@ -352,7 +352,7 @@ grub_fat_read_data (grub_disk_t disk, struct grub_fat_data *data,
   unsigned logical_cluster_bits;
   grub_ssize_t ret = 0;
   unsigned long sector;
-  
+
   /* This is a special case. FAT12 and FAT16 doesn't have the root directory
      in clusters.  */
   if (data->file_cluster == ~0U)
@@ -417,7 +417,7 @@ grub_fat_read_data (grub_disk_t disk, struct grub_fat_data *data,
            case 12:
              if (data->cur_cluster & 1)
                next_cluster >>= 4;
-             
+
              next_cluster &= 0x0FFF;
              break;
            }
@@ -426,7 +426,7 @@ grub_fat_read_data (grub_disk_t disk, struct grub_fat_data *data,
          grub_printf ("%s:%d: fat_size=%d, next_cluster=%u\n",
                       __FILE__, __LINE__, data->fat_size, next_cluster);
 #endif
-         
+
          /* Check the end.  */
          if (next_cluster >= data->cluster_eof_mark)
            return ret;
@@ -468,7 +468,7 @@ grub_fat_read_data (grub_disk_t disk, struct grub_fat_data *data,
 
 static grub_err_t
 grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data,
-                     int (*hook) (const char *filename, 
+                     int (*hook) (const char *filename,
                                   struct grub_fat_dir_entry *dir))
 {
   struct grub_fat_dir_entry dir;
@@ -477,10 +477,10 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data,
   int slot = -1, slots = -1;
   int checksum = -1;
   grub_ssize_t offset = -sizeof(dir);
-  
+
   if (! (data->attr & GRUB_FAT_ATTR_DIRECTORY))
     return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
-  
+
   /* Allocate space enough to hold a long name.  */
   filename = grub_malloc (0x40 * 13 * 4 + 1);
   unibuf = (grub_uint16_t *) grub_malloc (0x40 * 13 * 2);
@@ -490,7 +490,7 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data,
       grub_free (unibuf);
       return 0;
     }
-      
+
   while (1)
     {
       unsigned i;
@@ -509,7 +509,7 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data,
          struct grub_fat_long_name_entry *long_name
            = (struct grub_fat_long_name_entry *) &dir;
          grub_uint8_t id = long_name->id;
-         
+
          if (id & 0x40)
            {
              id &= 0x3f;
@@ -537,11 +537,11 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data,
       /* This is a workaround for Japanese.  */
       if (dir.name[0] == 0x05)
        dir.name[0] = 0xe5;
-      
+
       if (checksum != -1 && slot == 0)
        {
          grub_uint8_t sum;
-         
+
          for (sum = 0, i = 0; i < sizeof (dir.name); i++)
            sum = ((sum >> 1) | (sum << 7)) + dir.name[i];
 
@@ -551,13 +551,13 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data,
 
              for (u = 0; u < slots * 13; u++)
                unibuf[u] = grub_le_to_cpu16 (unibuf[u]);
-             
+
              *grub_utf16_to_utf8 ((grub_uint8_t *) filename, unibuf,
                                   slots * 13) = '\0';
-             
+
              if (hook (filename, &dir))
                break;
-             
+
              checksum = -1;
              continue;
            }
@@ -569,7 +569,7 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data,
       filep = filename;
       if (dir.attr & GRUB_FAT_ATTR_VOLUME_ID)
        {
-         for (i = 0; i < sizeof (dir.name) && dir.name[i] 
+         for (i = 0; i < sizeof (dir.name) && dir.name[i]
                 && ! grub_isspace (dir.name[i]); i++)
            *filep++ = dir.name[i];
        }
@@ -577,9 +577,9 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data,
        {
          for (i = 0; i < 8 && dir.name[i] && ! grub_isspace (dir.name[i]); i++)
            *filep++ = grub_tolower (dir.name[i]);
-      
+
          *filep = '.';
-         
+
          for (i = 8; i < 11 && dir.name[i] && ! grub_isspace (dir.name[i]); i++)
            *++filep = grub_tolower (dir.name[i]);
 
@@ -604,7 +604,7 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data,
 static char *
 grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
                   const char *path,
-                  int (*hook) (const char *filename, 
+                  int (*hook) (const char *filename,
                                const struct grub_dirhook_info *info))
 {
   char *dirname, *dirp;
@@ -636,18 +636,18 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
 
        if (call_hook)
          hook (filename, &info);
-           
+
        return 1;
       }
     return 0;
   }
-  
+
   if (! (data->attr & GRUB_FAT_ATTR_DIRECTORY))
     {
       grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
       return 0;
     }
-  
+
   /* Extract a directory name.  */
   while (*path == '/')
     path++;
@@ -656,7 +656,7 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
   if (dirp)
     {
       unsigned len = dirp - path;
-      
+
       dirname = grub_malloc (len + 1);
       if (! dirname)
        return 0;
@@ -669,7 +669,7 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
     dirname = grub_strdup (path);
 
   call_hook = (! dirp && hook);
-  
+
   grub_fat_iterate_dir (disk, data, iter_hook);
   if (grub_errno == GRUB_ERR_NONE && ! found && !call_hook)
     grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
@@ -681,7 +681,7 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
 
 static grub_err_t
 grub_fat_dir (grub_device_t device, const char *path,
-             int (*hook) (const char *filename, 
+             int (*hook) (const char *filename,
                           const struct grub_dirhook_info *info))
 {
   struct grub_fat_data *data = 0;
@@ -691,7 +691,7 @@ grub_fat_dir (grub_device_t device, const char *path,
   char *p;
 
   grub_dl_ref (my_mod);
-  
+
   data = grub_fat_mount (disk);
   if (! data)
     goto fail;
@@ -707,7 +707,7 @@ grub_fat_dir (grub_device_t device, const char *path,
     *p++ = '/';
   *p = '\0';
   p = dirname;
-  
+
   do
     {
       p = grub_fat_find_dir (disk, data, p, hook);
@@ -718,9 +718,9 @@ grub_fat_dir (grub_device_t device, const char *path,
 
   grub_free (dirname);
   grub_free (data);
-  
+
   grub_dl_unref (my_mod);
-  
+
   return grub_errno;
 }
 
@@ -731,7 +731,7 @@ grub_fat_open (grub_file_t file, const char *name)
   char *p = (char *) name;
 
   grub_dl_ref (my_mod);
-  
+
   data = grub_fat_mount (file->device->disk);
   if (! data)
     goto fail;
@@ -752,15 +752,15 @@ grub_fat_open (grub_file_t file, const char *name)
 
   file->data = data;
   file->size = data->file_size;
-  
+
   return GRUB_ERR_NONE;
 
  fail:
-  
+
   grub_free (data);
-  
+
   grub_dl_unref (my_mod);
-  
+
   return grub_errno;
 }
 
@@ -775,9 +775,9 @@ static grub_err_t
 grub_fat_close (grub_file_t file)
 {
   grub_free (file->data);
-  
+
   grub_dl_unref (my_mod);
-  
+
   return grub_errno;
 }
 
@@ -799,7 +799,7 @@ grub_fat_label (grub_device_t device, char **label)
   }
 
   grub_dl_ref (my_mod);
-  
+
   data = grub_fat_mount (disk);
   if (! data)
     goto fail;
@@ -811,7 +811,7 @@ grub_fat_label (grub_device_t device, char **label)
     }
 
   *label = 0;
-  
+
   grub_fat_iterate_dir (disk, data, iter_hook);
 
  fail:
index 89b62387fef49502505abba6959243498a1aba38..d0b1e493e711250378cf60208e4fb940c3acbd1c 100644 (file)
@@ -47,7 +47,7 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
   grub_err_t err;
   enum grub_fshelp_filetype foundtype = GRUB_FSHELP_DIR;
   int symlinknest = 0;
-  
+
   auto grub_err_t NESTED_FUNC_ATTR find_file (const char *currpath,
                                              grub_fshelp_node_t currroot,
                                              grub_fshelp_node_t *currfound);
@@ -69,13 +69,13 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
                                         grub_fshelp_node_t node);
 
       auto void free_node (grub_fshelp_node_t node);
-      
+
       void free_node (grub_fshelp_node_t node)
        {
           if (node != rootnode && node != currroot)
            grub_free (node);
        }
-      
+
       int NESTED_FUNC_ATTR iterate (const char *filename,
                                    enum grub_fshelp_filetype filetype,
                                    grub_fshelp_node_t node)
@@ -88,31 +88,31 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
              grub_free (node);
              return 0;
            }
-         
+
          /* The node is found, stop iterating over the nodes.  */
          type = filetype & ~GRUB_FSHELP_CASE_INSENSITIVE;
          oldnode = currnode;
          currnode = node;
-         
+
          return 1;
        }
-  
+
       grub_strncpy (fpath, currpath, grub_strlen (currpath) + 1);
-      
+
       /* Remove all leading slashes.  */
       while (*name == '/')
        name++;
-  
+
       if (! *name)
        {
          *currfound = currnode;
          return 0;
        }
-      
+
       for (;;)
        {
          int found;
-      
+
          /* Extract the actual part from the pathname.  */
          next = grub_strchr (name, '/');
          if (next)
@@ -121,7 +121,7 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
              while (*next == '/')
                *(next++) = '\0';
            }
-         
+
          /* At this point it is expected that the current node is a
             directory, check if this is true.  */
          if (type != GRUB_FSHELP_DIR)
@@ -129,22 +129,22 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
              free_node (currnode);
              return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
            }
-         
+
          /* Iterate over the directory.  */
          found = iterate_dir (currnode, iterate);
          if (! found)
            {
              if (grub_errno)
                return grub_errno;
-             
+
              break;
            }
-         
+
          /* Read in the symlink and follow it.  */
          if (type == GRUB_FSHELP_SYMLINK)
            {
              char *symlink;
-             
+
              /* Test if the symlink does not loop.  */
              if (++symlinknest == 8)
                {
@@ -153,37 +153,37 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
                  return grub_error (GRUB_ERR_SYMLINK_LOOP,
                                      "too deep nesting of symlinks");
                }
-             
+
              symlink = read_symlink (currnode);
              free_node (currnode);
-             
+
              if (!symlink)
                {
                  free_node (oldnode);
                  return grub_errno;
                }
-             
+
              /* The symlink is an absolute path, go back to the root inode.  */
              if (symlink[0] == '/')
                {
                  free_node (oldnode);
                  oldnode = rootnode;
-               }       
-             
+               }
+
              /* Lookup the node the symlink points to.  */
              find_file (symlink, oldnode, &currnode);
              type = foundtype;
              grub_free (symlink);
-             
+
              if (grub_errno)
                {
                  free_node (oldnode);
                  return grub_errno;
                }
            }
-      
+
          free_node (oldnode);
-         
+
          /* Found the node!  */
          if (! next || *next == '\0')
            {
@@ -191,10 +191,10 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
              foundtype = type;
              return 0;
            }
-      
+
          name = next;
        }
-      
+
       return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
     }
 
@@ -203,17 +203,17 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
       grub_error (GRUB_ERR_BAD_FILENAME, "bad filename");
       return grub_errno;
     }
-  
+
   err = find_file (path, rootnode, foundnode);
   if (err)
     return err;
-  
+
   /* Check if the node that was found was of the expected type.  */
   if (expecttype == GRUB_FSHELP_REG && foundtype != expecttype)
     return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a regular file");
   else if (expecttype == GRUB_FSHELP_DIR && foundtype != expecttype)
     return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
-  
+
   return 0;
 }
 
@@ -252,14 +252,14 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
       blknr = get_block (node, i);
       if (grub_errno)
        return -1;
-      
+
       blknr = blknr << log2blocksize;
 
       /* Last block.  */
       if (i == blockcnt - 1)
        {
          blockend = (len + pos) & (blocksize - 1);
-         
+
          /* The last portion is exactly blocksize.  */
          if (! blockend)
            blockend = blocksize;
@@ -271,12 +271,12 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
          skipfirst = blockoff;
          blockend -= skipfirst;
        }
-      
+
       /* If the block number is 0 this block is not stored on disk but
         is zero filled instead.  */
       if (blknr)
        {
-         disk->read_hook = read_hook;    
+         disk->read_hook = read_hook;
 
          grub_disk_read (disk, blknr, skipfirst,
                          blockend, buf);
@@ -297,7 +297,7 @@ unsigned int
 grub_fshelp_log2blksize (unsigned int blksize, unsigned int *pow)
 {
   int mod;
-  
+
   *pow = 0;
   while (blksize > 1)
     {
index e8821e092a1ab6254a4d6c7b9e3eda319011cb98..2f0702cbb8f3a48cd6a791836fd4ab7c14bd5880 100644 (file)
--- a/fs/hfs.c
+++ b/fs/hfs.c
@@ -103,7 +103,7 @@ struct grub_hfs_catalog_key
 {
   grub_uint8_t unused;
   grub_uint32_t parent_dir;
-  
+
   /* Filename length.  */
   grub_uint8_t strlen;
 
@@ -174,28 +174,28 @@ grub_hfs_block (struct grub_hfs_data *data, grub_hfs_datarecord_t dat,
   grub_hfs_datarecord_t dr;
   int pos = 0;
   struct grub_hfs_extent_key key;
-  
+
   int tree = 0;
   static int cache_file = 0;
-  static int cache_pos = 0;  
+  static int cache_pos = 0;
   static grub_hfs_datarecord_t cache_dr;
-  
+
   grub_memcpy (dr, dat, sizeof (dr));
-  
+
   key.forktype = 0;
   key.fileid = grub_cpu_to_be32 (file);
-  
+
   if (cache && cache_file == file  && block > cache_pos)
     {
       pos = cache_pos;
       key.first_block = grub_cpu_to_be16 (pos);
       grub_memcpy (dr, cache_dr, sizeof (cache_dr));
     }
-  
+
   for (;;)
     {
       int i;
-      
+
       /* Try all 3 extents.  */
       for (i = 0; i < 3; i++)
        {
@@ -203,7 +203,7 @@ grub_hfs_block (struct grub_hfs_data *data, grub_hfs_datarecord_t dat,
          if (grub_be_to_cpu16 (dr[i].count) + pos > block)
            {
              int first = grub_be_to_cpu16 (dr[i].first_block);
-             
+
              /* If the cache is enabled, store the current position
                 in the tree.  */
              if (tree && cache)
@@ -212,15 +212,15 @@ grub_hfs_block (struct grub_hfs_data *data, grub_hfs_datarecord_t dat,
                  cache_pos = pos;
                  grub_memcpy (cache_dr, dr, sizeof (cache_dr));
                }
-             
+
              return (grub_be_to_cpu16 (data->sblock.first_block)
                      + (first + block - pos) * GRUB_HFS_BLKS);
            }
-         
+
          /* Try the next extent.  */
          pos += grub_be_to_cpu16 (dr[i].count);
        }
-      
+
       /* Lookup the block in the extent overflow file.  */
       key.first_block = grub_cpu_to_be16 (pos);
       tree = 1;
@@ -247,7 +247,7 @@ grub_hfs_read_file (struct grub_hfs_data *data,
   if (len > grub_le_to_cpu32 (data->size))
     len = grub_le_to_cpu32 (data->size);
 
-  blockcnt = ((len + pos) 
+  blockcnt = ((len + pos)
              + data->blksz - 1) / data->blksz;
 
   for (i = pos / data->blksz; i < blockcnt; i++)
@@ -257,16 +257,16 @@ grub_hfs_read_file (struct grub_hfs_data *data,
       int blockend = data->blksz;
 
       int skipfirst = 0;
-      
+
       blknr = grub_hfs_block (data, data->extents, data->fileid, i, 1);
       if (grub_errno)
        return -1;
-      
+
       /* Last block.  */
       if (i == blockcnt - 1)
        {
          blockend = (len + pos) % data->blksz;
-         
+
          /* The last portion is exactly EXT2_BLOCK_SIZE (data).  */
          if (! blockend)
            blockend = data->blksz;
@@ -283,17 +283,17 @@ grub_hfs_read_file (struct grub_hfs_data *data,
         is zero filled instead.  */
       if (blknr)
        {
-         data->disk->read_hook = read_hook;      
+         data->disk->read_hook = read_hook;
          grub_disk_read (data->disk, blknr, skipfirst,
                          blockend, buf);
          data->disk->read_hook = 0;
          if (grub_errno)
            return -1;
        }
-      
+
       buf += data->blksz - skipfirst;
     }
-  
+
   return len;
 }
 
@@ -306,13 +306,13 @@ grub_hfs_mount (grub_disk_t disk)
   struct grub_hfs_catalog_key key;
   struct grub_hfs_dirrec dir;
   int first_block;
-  
+
   struct
   {
     struct grub_hfs_node node;
     struct grub_hfs_treeheader head;
   } treehead;
-  
+
   data = grub_malloc (sizeof (struct grub_hfs_data));
   if (!data)
     return 0;
@@ -321,7 +321,7 @@ grub_hfs_mount (grub_disk_t disk)
   if (grub_disk_read (disk, GRUB_HFS_SBLOCK, 0,
                      sizeof (struct grub_hfs_sblock), &data->sblock))
     goto fail;
-  
+
   /* Check if this is a HFS filesystem.  */
   if (grub_be_to_cpu16 (data->sblock.magic) != GRUB_HFS_MAGIC)
     {
@@ -335,23 +335,23 @@ grub_hfs_mount (grub_disk_t disk)
       grub_error (GRUB_ERR_BAD_FS, "embedded HFS+ filesystem");
       goto fail;
     }
-  
+
   data->blksz = grub_be_to_cpu32 (data->sblock.blksz);
   data->disk = disk;
-  
+
   /* Lookup the root node of the extent overflow tree.  */
-  first_block = ((grub_be_to_cpu16 (data->sblock.extent_recs[0].first_block) 
+  first_block = ((grub_be_to_cpu16 (data->sblock.extent_recs[0].first_block)
                  * GRUB_HFS_BLKS)
                 + grub_be_to_cpu16 (data->sblock.first_block));
-  
+
   if (grub_disk_read (data->disk, first_block, 0,
                      sizeof (treehead), &treehead))
     goto fail;
   data->ext_root = grub_be_to_cpu32 (treehead.head.root_node);
   data->ext_size = grub_be_to_cpu16 (treehead.head.node_size);
-  
+
   /* Lookup the root node of the catalog tree.  */
-  first_block = ((grub_be_to_cpu16 (data->sblock.catalog_recs[0].first_block) 
+  first_block = ((grub_be_to_cpu16 (data->sblock.catalog_recs[0].first_block)
                  * GRUB_HFS_BLKS)
                 + grub_be_to_cpu16 (data->sblock.first_block));
   if (grub_disk_read (data->disk, first_block, 0,
@@ -359,32 +359,32 @@ grub_hfs_mount (grub_disk_t disk)
     goto fail;
   data->cat_root = grub_be_to_cpu32 (treehead.head.root_node);
   data->cat_size = grub_be_to_cpu16 (treehead.head.node_size);
-  
+
   /* Lookup the root directory node in the catalog tree using the
      volume name.  */
   key.parent_dir = grub_cpu_to_be32 (1);
   key.strlen = data->sblock.volname[0];
   grub_strcpy ((char *) key.str, (char *) (data->sblock.volname + 1));
-  
+
   if (grub_hfs_find_node (data, (char *) &key, data->cat_root,
                          0, (char *) &dir, sizeof (dir)) == 0)
     {
       grub_error (GRUB_ERR_BAD_FS, "can not find the hfs root directory");
       goto fail;
     }
-    
+
   if (grub_errno)
     goto fail;
 
   data->rootdir = grub_be_to_cpu32 (dir.dirid);
-  
+
   return data;
  fail:
   grub_free (data);
-  
+
   if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
     grub_error (GRUB_ERR_BAD_FS, "not a hfs filesystem");
-  
+
   return 0;
 }
 
@@ -641,7 +641,7 @@ grub_hfs_cmp_extkeys (struct grub_hfs_extent_key *k1,
   if (cmp == 0)
     cmp = grub_be_to_cpu32 (k1->fileid) - grub_be_to_cpu32 (k2->fileid);
   if (cmp == 0)
-    cmp = (grub_be_to_cpu16 (k1->first_block) 
+    cmp = (grub_be_to_cpu16 (k1->first_block)
           - grub_be_to_cpu16 (k2->first_block));
   return cmp;
 }
@@ -657,24 +657,24 @@ grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx,
                                                      struct grub_hfs_record *))
 {
   int nodesize = type == 0 ? data->cat_size : data->ext_size;
-  
+
   union
   {
     struct grub_hfs_node node;
     char rawnode[nodesize];
     grub_uint16_t offsets[nodesize / 2];
   } node;
-  
+
   do
     {
       int i;
       struct grub_hfs_extent *dat;
       int blk;
-      
-      dat = (struct grub_hfs_extent *) (type == 0 
+
+      dat = (struct grub_hfs_extent *) (type == 0
                                        ? (&data->sblock.catalog_recs)
                                        : (&data->sblock.extent_recs));
-      
+
       /* Read the node into memory.  */
       blk = grub_hfs_block (data, dat,
                             (type == 0) ? GRUB_HFS_CNID_CAT : GRUB_HFS_CNID_EXT,
@@ -682,11 +682,11 @@ grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx,
       blk += (idx % (data->blksz / nodesize));
       if (grub_errno)
        return grub_errno;
-      
+
       if (grub_disk_read (data->disk, blk, 0,
                          sizeof (node), &node))
        return grub_errno;
-      
+
       /* Iterate over all records in this node.  */
       for (i = 0; i < grub_be_to_cpu16 (node.node.reccnt); i++)
        {
@@ -698,23 +698,23 @@ grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx,
          } __attribute__ ((packed)) *pnt;
          pnt = (struct pointer *) (grub_be_to_cpu16 (node.offsets[pos])
                                    + node.rawnode);
-         
-         struct grub_hfs_record rec = 
+
+         struct grub_hfs_record rec =
            {
              &pnt->key,
              pnt->keylen,
              &pnt->key + pnt->keylen +(pnt->keylen + 1) % 2,
-             nodesize - grub_be_to_cpu16 (node.offsets[pos]) 
+             nodesize - grub_be_to_cpu16 (node.offsets[pos])
              - pnt->keylen - 1
            };
-         
+
          if (node_hook (&node.node, &rec))
            return 0;
        }
-      
+
       idx = grub_be_to_cpu32 (node.node.next);
     } while (idx && this);
-  
+
   return 0;
 }
 
@@ -730,18 +730,18 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key,
   int found = -1;
   int isleaf = 0;
   int done = 0;
-  
+
   auto int node_found (struct grub_hfs_node *, struct grub_hfs_record *);
-    
+
   int node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec)
     {
       int cmp = 1;
-      
+
       if (type == 0)
        cmp = grub_hfs_cmp_catkeys (rec->key, (void *) key);
       else
        cmp = grub_hfs_cmp_extkeys (rec->key, (void *) key);
-      
+
       /* If the key is smaller or equal to the current node, mark the
         entry.  In case of a non-leaf mode it will be used to lookup
         the rest of the tree.  */
@@ -752,12 +752,12 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key,
        }
       else /* The key can not be found in the tree. */
        return 1;
-      
+
       /* Check if this node is a leaf node.  */
       if (hnd->type == GRUB_HFS_NODE_LEAF)
        {
          isleaf = 1;
-         
+
          /* Found it!!!!  */
          if (cmp == 0)
            {
@@ -768,23 +768,23 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key,
              return 1;
            }
        }
-      
+
       return 0;
     }
-  
+
   do
     {
       found = -1;
 
       if (grub_hfs_iterate_records (data, type, idx, 0, node_found))
         return 0;
-  
+
       if (found == -1)
         return 0;
 
       idx = found;
     } while (! isleaf);
-  
+
   return done;
 }
 
@@ -799,7 +799,7 @@ grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx,
   int found = -1;
   int isleaf = 0;
   int next = 0;
-  
+
   /* The lowest key possible with DIR as root directory.  */
   struct grub_hfs_catalog_key key = {0, grub_cpu_to_be32 (dir), 0, ""};
 
@@ -807,51 +807,51 @@ grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx,
   auto int it_dir (struct grub_hfs_node * __attribute ((unused)),
                   struct grub_hfs_record *);
 
-  
+
   int node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec)
     {
       struct grub_hfs_catalog_key *ckey = rec->key;
-      
+
       if (grub_hfs_cmp_catkeys (rec->key, (void *) &key) <= 0)
        found = grub_be_to_cpu32 (*(grub_uint32_t *) rec->data);
-      
+
       if (hnd->type == 0xFF && ckey->strlen > 0)
        {
          isleaf = 1;
          next = grub_be_to_cpu32 (hnd->next);
-         
+
          /* An entry was found.  */
          if (grub_be_to_cpu32 (ckey->parent_dir) == dir)
            return hook (rec);
        }
-      
+
       return 0;
     }
-  
+
   int it_dir (struct grub_hfs_node *hnd __attribute ((unused)),
              struct grub_hfs_record *rec)
     {
       struct grub_hfs_catalog_key *ckey = rec->key;
       struct grub_hfs_catalog_key *origkey = &key;
-      
+
       /* Stop when the entries do not match anymore.  */
-      if (grub_be_to_cpu32 (ckey->parent_dir) 
+      if (grub_be_to_cpu32 (ckey->parent_dir)
          != grub_be_to_cpu32 ((origkey)->parent_dir))
        return 1;
-      
+
       return hook (rec);
     }
-  
+
   do
     {
       found = -1;
 
       if (grub_hfs_iterate_records (data, 0, root_idx, 0, node_found))
         return grub_errno;
-  
+
       if (found == -1)
         return 0;
-  
+
       root_idx = found;
     } while (! isleaf);
 
@@ -878,21 +878,21 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path,
   } fdrec;
 
   fdrec.frec.type = GRUB_HFS_FILETYPE_DIR;
-  
+
   if (path[0] != '/')
     {
       grub_error (GRUB_ERR_BAD_FILENAME, "bad filename");
       return 0;
     }
-  
+
   origpath = grub_strdup (path);
   if (!origpath)
     return grub_errno;
-  
+
   path = origpath;
   while (*path == '/')
     path++;
-  
+
   while (path && grub_strlen (path))
     {
       if (fdrec.frec.type != GRUB_HFS_FILETYPE_DIR)
@@ -900,7 +900,7 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path,
          grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
          goto fail;
        }
-      
+
       /* Isolate a part of the path.  */
       next = grub_strchr (path, '/');
       if (next)
@@ -908,13 +908,13 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path,
          while (*next == '/')
            *(next++) = '\0';
        }
-      
+
       struct grub_hfs_catalog_key key;
-      
+
       key.parent_dir = grub_cpu_to_be32 (inode);
       key.strlen = grub_strlen (path);
       grub_strcpy ((char *) (key.str), path);
-      
+
       /* Lookup this node.  */
       if (! grub_hfs_find_node (data, (char *) &key, data->cat_root,
                                0, (char *) &fdrec.frec, sizeof (fdrec.frec)))
@@ -925,17 +925,17 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path,
 
       if (grub_errno)
        goto fail;
-      
+
       inode = grub_be_to_cpu32 (fdrec.dir.dirid);
       path = next;
     }
 
   if (retdata)
     grub_memcpy (retdata, &fdrec.frec, sizeof (fdrec.frec));
-  
+
   if (retinode)
     *retinode = inode;
-  
+
  fail:
   grub_free (origpath);
   return grub_errno;
@@ -944,7 +944,7 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path,
 
 \f
 static grub_err_t
-grub_hfs_dir (grub_device_t device, const char *path, 
+grub_hfs_dir (grub_device_t device, const char *path,
                  int (*hook) (const char *filename,
                               const struct grub_dirhook_info *info))
 {
@@ -959,10 +959,10 @@ grub_hfs_dir (grub_device_t device, const char *path,
       struct grub_hfs_catalog_key *ckey = rec->key;
       struct grub_dirhook_info info;
       grub_memset (&info, 0, sizeof (info));
-      
+
       grub_strncpy (fname, (char *) (ckey->str), ckey->strlen);
-      
-      if (*filetype == GRUB_HFS_FILETYPE_DIR 
+
+      if (*filetype == GRUB_HFS_FILETYPE_DIR
          || *filetype == GRUB_HFS_FILETYPE_FILE)
        {
          info.dir = (*filetype == GRUB_HFS_FILETYPE_DIR);
@@ -970,16 +970,16 @@ grub_hfs_dir (grub_device_t device, const char *path,
        }
       return 0;
     }
-  
+
   struct grub_hfs_data *data;
   struct grub_hfs_filerec frec;
 
   grub_dl_ref (my_mod);
-  
+
   data = grub_hfs_mount (device->disk);
   if (!data)
     goto fail;
-  
+
   /* First the directory ID for the directory.  */
   if (grub_hfs_find_dir (data, path, &frec, &inode))
     goto fail;
@@ -989,14 +989,14 @@ grub_hfs_dir (grub_device_t device, const char *path,
       grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
       goto fail;
     }
-  
+
   grub_hfs_iterate_dir (data, data->cat_root, inode, dir_hook);
-  
+
  fail:
   grub_free (data);
 
   grub_dl_unref (my_mod);
-  
+
   return grub_errno;
 }
 
@@ -1007,18 +1007,18 @@ grub_hfs_open (struct grub_file *file, const char *name)
 {
   struct grub_hfs_data *data;
   struct grub_hfs_filerec frec;
-  
+
   grub_dl_ref (my_mod);
 
   data = grub_hfs_mount (file->device->disk);
-  
+
   if (grub_hfs_find_dir (data, name, &frec, 0))
     {
       grub_free (data);
       grub_dl_unref (my_mod);
       return grub_errno;
     }
-  
+
   if (frec.type != GRUB_HFS_FILETYPE_FILE)
     {
       grub_free (data);
@@ -1026,7 +1026,7 @@ grub_hfs_open (struct grub_file *file, const char *name)
       grub_dl_unref (my_mod);
       return grub_errno;
     }
-  
+
   grub_memcpy (data->extents, frec.extents, sizeof (grub_hfs_datarecord_t));
   file->size = grub_be_to_cpu32 (frec.size);
   data->size = grub_be_to_cpu32 (frec.size);
@@ -1034,16 +1034,16 @@ grub_hfs_open (struct grub_file *file, const char *name)
   file->offset = 0;
 
   file->data = data;
-  
+
   return 0;
 }
 
 static grub_ssize_t
 grub_hfs_read (grub_file_t file, char *buf, grub_size_t len)
 {
-  struct grub_hfs_data *data = 
+  struct grub_hfs_data *data =
     (struct grub_hfs_data *) file->data;
-  
+
   return grub_hfs_read_file (data, file->read_hook, file->offset, len, buf);
 }
 
@@ -1065,7 +1065,7 @@ grub_hfs_label (grub_device_t device, char **label)
   struct grub_hfs_data *data;
 
   data = grub_hfs_mount (device->disk);
-  
+
   if (data)
     *label = grub_strndup ((char *) (data->sblock.volname + 1),
                           *data->sblock.volname);
index 8bcaa3c7db3ce374ecd6331a4b32687c5e74066f..31bb54014b6afa0f6365b95d36da6c3547130615 100644 (file)
@@ -321,7 +321,7 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
         code above used this memory, it can be freed now.  */
       grub_free (nnode);
       nnode = 0;
-      
+
       if (blk != -1)
        return (blk
                + (node->data->embedded_offset >> (node->data->log2blksize
@@ -455,7 +455,7 @@ grub_hfsplus_mount (grub_disk_t disk)
   grub_memcpy (&data->catalog_tree.file.extents,
               data->volheader.catalog_file.extents,
               sizeof data->volheader.catalog_file.extents);
-  data->catalog_tree.file.size = 
+  data->catalog_tree.file.size =
     grub_be_to_cpu64 (data->volheader.catalog_file.size);
 
   /* Make a new node for the extent overflow file.  */
@@ -465,7 +465,7 @@ grub_hfsplus_mount (grub_disk_t disk)
               data->volheader.extents_file.extents,
               sizeof data->volheader.catalog_file.extents);
 
-  data->extoverflow_tree.file.size = 
+  data->extoverflow_tree.file.size =
     grub_be_to_cpu64 (data->volheader.extents_file.size);
 
   /* Read the essential information about the trees.  */
@@ -518,10 +518,10 @@ grub_hfsplus_cmp_catkey (struct grub_hfsplus_key *keya,
   char *filename;
   int i;
   int diff;
-  
+
   diff = grub_be_to_cpu32 (catkey_a->parent) - catkey_b->parent;
   if (diff)
-    return diff; 
+    return diff;
 
   /* Change the filename in keya so the endianness is correct.  */
   for (i = 0; i < grub_be_to_cpu16 (catkey_a->namelen); i++)
@@ -592,7 +592,7 @@ grub_hfsplus_btree_iterate_node (struct grub_hfsplus_btree *btree,
                                 int first_rec,
                                 int (*hook) (void *record))
 {
-  int rec;  
+  int rec;
 
   for (;;)
     {
@@ -661,8 +661,8 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
       for (rec = 0; rec < grub_be_to_cpu16 (nodedesc->count); rec++)
        {
          struct grub_hfsplus_key *currkey;
-         currkey = grub_hfsplus_btree_recptr (btree, nodedesc, rec);   
-  
+         currkey = grub_hfsplus_btree_recptr (btree, nodedesc, rec);
+
          /* The action that has to be taken depend on the type of
             record.  */
          if (nodedesc->type == GRUB_HFSPLUS_BTNODE_TYPE_LEAF
@@ -716,7 +716,7 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir,
                                   grub_fshelp_node_t node))
 {
   int ret = 0;
-  
+
   auto int list_nodes (void *record);
   int list_nodes (void *record)
     {
@@ -730,7 +730,7 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir,
       catkey = (struct grub_hfsplus_catkey *) record;
 
       fileinfo =
-       (struct grub_hfsplus_catfile *) ((char *) record 
+       (struct grub_hfsplus_catfile *) ((char *) record
                                         + grub_be_to_cpu16 (catkey->keylen)
                                         + 2 + (grub_be_to_cpu16(catkey->keylen)
                                                % 2));
@@ -796,7 +796,7 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir,
             callback function.  */
          node = grub_malloc (sizeof (*node));
          node->data = dir->data;
-         
+
          grub_memcpy (node->extents, fileinfo->data.extents,
                       sizeof (node->extents));
          node->mtime = grub_be_to_cpu32 (fileinfo->mtime) - 2082844800;
@@ -839,9 +839,9 @@ grub_hfsplus_open (struct grub_file *file, const char *name)
 {
   struct grub_hfsplus_data *data;
   struct grub_fshelp_node *fdiro = 0;
-  
+
   grub_dl_ref (my_mod);
-  
+
   data = grub_hfsplus_mount (file->device->disk);
   if (!data)
     goto fail;
@@ -865,7 +865,7 @@ grub_hfsplus_open (struct grub_file *file, const char *name)
   if (data && fdiro != &data->dirroot)
     grub_free (fdiro);
   grub_free (data);
-  
+
   grub_dl_unref (my_mod);
 
   return grub_errno;
@@ -887,7 +887,7 @@ grub_hfsplus_close (grub_file_t file)
 static grub_ssize_t
 grub_hfsplus_read (grub_file_t file, char *buf, grub_size_t len)
 {
-  struct grub_hfsplus_data *data = 
+  struct grub_hfsplus_data *data =
     (struct grub_hfsplus_data *) file->data;
 
   int size = grub_hfsplus_read_file (&data->opened_file, file->read_hook,
@@ -898,13 +898,13 @@ grub_hfsplus_read (grub_file_t file, char *buf, grub_size_t len)
 
 
 static grub_err_t
-grub_hfsplus_dir (grub_device_t device, const char *path, 
-                 int (*hook) (const char *filename, 
+grub_hfsplus_dir (grub_device_t device, const char *path,
+                 int (*hook) (const char *filename,
                               const struct grub_dirhook_info *info))
 {
   struct grub_hfsplus_data *data = 0;
   struct grub_fshelp_node *fdiro = 0;
-  
+
   auto int NESTED_FUNC_ATTR iterate (const char *filename,
                                     enum grub_fshelp_filetype filetype,
                                     grub_fshelp_node_t node);
@@ -924,7 +924,7 @@ grub_hfsplus_dir (grub_device_t device, const char *path,
     }
 
   grub_dl_ref (my_mod);
-  
+
   data = grub_hfsplus_mount (device->disk);
   if (!data)
     goto fail;
@@ -938,7 +938,7 @@ grub_hfsplus_dir (grub_device_t device, const char *path,
 
   /* Iterate over all entries in this directory.  */
   grub_hfsplus_iterate_dir (fdiro, iterate);
-  
+
  fail:
   if (data && fdiro != &data->dirroot)
     grub_free (fdiro);
@@ -961,7 +961,7 @@ grub_hfsplus_label (grub_device_t device __attribute__((unused))
 }
 
 /* Get mtime.  */
-static grub_err_t 
+static grub_err_t
 grub_hfsplus_mtime (grub_device_t device, grub_int32_t *tm)
 {
   struct grub_hfsplus_data *data;
@@ -972,7 +972,7 @@ grub_hfsplus_mtime (grub_device_t device, grub_int32_t *tm)
   data = grub_hfsplus_mount (disk);
   if (!data)
     *tm = 0;
-  else 
+  else
     *tm = grub_be_to_cpu32 (data->volheader.utime) - 2082844800;
 
   grub_dl_unref (my_mod);
@@ -995,8 +995,8 @@ grub_hfsplus_uuid (grub_device_t device, char **uuid)
   if (data)
     {
       *uuid = grub_malloc (16 + sizeof ('\0'));
-      grub_sprintf (*uuid, "%016llx", 
-                   (unsigned long long) 
+      grub_sprintf (*uuid, "%016llx",
+                   (unsigned long long)
                    grub_be_to_cpu64 (data->volheader.num_serial));
     }
   else
index 32dfddbb33db9031a63cc2f7d9ce08d8ff0bcb95..c79ad4f3362c66a0f5a54e9b97a27e30a8baa030 100644 (file)
@@ -164,27 +164,27 @@ grub_iso9660_susp_iterate (struct grub_iso9660_data *data,
 {
   char *sua;
   struct grub_iso9660_susp_entry *entry;
-  
+
   auto grub_err_t load_sua (void);
-  
+
   /* Load a part of the System Usage Area.  */
   grub_err_t load_sua (void)
     {
       sua = grub_malloc (sua_size);
       if (!sua)
        return grub_errno;
-      
+
       if (grub_disk_read (data->disk, sua_block, sua_pos,
                          sua_size, sua))
        return grub_errno;
-      
+
       entry = (struct grub_iso9660_susp_entry *) sua;
       return 0;
     }
-  
+
   if (load_sua ())
     return grub_errno;
-  
+
   for (; (char *) entry < (char *) sua + sua_size - 1;
        entry = (struct grub_iso9660_susp_entry *)
         ((char *) entry + entry->len))
@@ -192,29 +192,29 @@ grub_iso9660_susp_iterate (struct grub_iso9660_data *data,
       /* The last entry.  */
       if (grub_strncmp ((char *) entry->sig, "ST", 2) == 0)
        break;
-      
+
       /* Additional entries are stored elsewhere.  */
       if (grub_strncmp ((char *) entry->sig, "CE", 2) == 0)
        {
          struct grub_iso9660_susp_ce *ce;
-         
+
          ce = (struct grub_iso9660_susp_ce *) entry;
          sua_size = grub_le_to_cpu32 (ce->len);
          sua_pos = grub_le_to_cpu32 (ce->off);
          sua_block = grub_le_to_cpu32 (ce->blk) << GRUB_ISO9660_LOG2_BLKSZ;
-         
+
          grub_free (sua);
          if (load_sua ())
            return grub_errno;
        }
-      
+
       if (hook (entry))
        {
          grub_free (sua);
          return 0;
        }
     }
-  
+
   grub_free (sua);
   return 0;
 }
@@ -248,9 +248,9 @@ grub_iso9660_mount (grub_disk_t disk)
   struct grub_iso9660_susp_entry *entry;
   struct grub_iso9660_primary_voldesc voldesc;
   int block;
-  
+
   auto grub_err_t susp_iterate (struct grub_iso9660_susp_entry *);
-  
+
   grub_err_t susp_iterate (struct grub_iso9660_susp_entry *susp_entry)
     {
       /* The "ER" entry is used to detect extensions.  The
@@ -262,11 +262,11 @@ grub_iso9660_mount (grub_disk_t disk)
        }
       return 0;
     }
-  
+
   data = grub_malloc (sizeof (struct grub_iso9660_data));
   if (! data)
     return 0;
-  
+
   data->disk = disk;
   data->rockridge = 0;
   data->joliet = 0;
@@ -319,7 +319,7 @@ grub_iso9660_mount (grub_disk_t disk)
       grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem");
       goto fail;
     }
-  
+
   sua_pos = (sizeof (rootdir) + rootdir.namelen
             + (rootdir.namelen % 2) - 1);
   sua_size = rootdir.len - sua_pos;
@@ -327,7 +327,7 @@ grub_iso9660_mount (grub_disk_t disk)
   sua = grub_malloc (sua_size);
   if (! sua)
     goto fail;
-  
+
   if (grub_disk_read (disk, (grub_le_to_cpu32 (data->voldesc.rootdir.first_sector)
                             << GRUB_ISO9660_LOG2_BLKSZ), sua_pos,
                      sua_size, sua))
@@ -335,9 +335,9 @@ grub_iso9660_mount (grub_disk_t disk)
       grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem");
       goto fail;
     }
-  
+
   entry = (struct grub_iso9660_susp_entry *) sua;
-  
+
   /* Test if the SUSP protocol is used on this filesystem.  */
   if (grub_strncmp ((char *) entry->sig, "SP", 2) == 0)
     {
@@ -345,7 +345,7 @@ grub_iso9660_mount (grub_disk_t disk)
         to get to the SUA (System Usage Area).  */
       data->susp_skip = entry->data[2];
       entry = (struct grub_iso9660_susp_entry *) ((char *) entry + entry->len);
-      
+
       /* Iterate over the entries in the SUA area to detect
         extensions.  */
       if (grub_iso9660_susp_iterate (data,
@@ -354,9 +354,9 @@ grub_iso9660_mount (grub_disk_t disk)
                                     sua_pos, sua_size, susp_iterate))
        goto fail;
     }
-  
+
   return data;
-    
+
  fail:
   grub_free (data);
   return 0;
@@ -371,7 +371,7 @@ grub_iso9660_read_symlink (grub_fshelp_node_t node)
   int sua_size;
   char *symlink = 0;
   int addslash = 0;
-  
+
   auto void add_part (const char *part, int len);
   auto grub_err_t susp_iterate_sl (struct grub_iso9660_susp_entry *);
 
@@ -379,14 +379,14 @@ grub_iso9660_read_symlink (grub_fshelp_node_t node)
   void add_part (const char *part, int len)
     {
       int size = grub_strlen (symlink);
-      
+
       symlink = grub_realloc (symlink, size + len + 1);
       if (! symlink)
        return;
-      
+
       grub_strncat (symlink, part, len);
     }
-    
+
   /* Read in a symlink.  */
   grub_err_t susp_iterate_sl (struct grub_iso9660_susp_entry *entry)
     {
@@ -402,7 +402,7 @@ grub_iso9660_read_symlink (grub_fshelp_node_t node)
                  add_part ("/", 1);
                  addslash = 0;
                }
-             
+
              /* The current position is the `Component Flag'.  */
              switch (entry->data[pos] & 30)
                {
@@ -418,15 +418,15 @@ grub_iso9660_read_symlink (grub_fshelp_node_t node)
 
                    break;
                  }
-               
+
                case 2:
                  add_part ("./", 2);
                  break;
-               
+
                case 4:
                  add_part ("../", 3);
                  break;
-                 
+
                case 8:
                  add_part ("/", 1);
                  break;
@@ -435,29 +435,29 @@ grub_iso9660_read_symlink (grub_fshelp_node_t node)
                 stored.  */
              pos += entry->data[pos + 1] + 2;
            }
-         
+
          /* Check if `grub_realloc' failed.  */
          if (grub_errno)
            return grub_errno;
        }
-      
+
       return 0;
     }
-  
+
   if (grub_disk_read (node->data->disk, node->dir_blk, node->dir_off,
                      sizeof (dirent), (char *) &dirent))
     return 0;
-  
+
   sua_off = (sizeof (dirent) + dirent.namelen + 1 - (dirent.namelen % 2)
             + node->data->susp_skip);
   sua_size = dirent.len - sua_off;
-  
+
   symlink = grub_malloc (1);
   if (!symlink)
     return 0;
-  
+
   *symlink = '\0';
-  
+
   if (grub_iso9660_susp_iterate (node->data, node->dir_blk,
                                 node->dir_off + sua_off,
                                 sua_size, susp_iterate_sl))
@@ -465,7 +465,7 @@ grub_iso9660_read_symlink (grub_fshelp_node_t node)
       grub_free (symlink);
       return 0;
     }
-  
+
   return symlink;
 }
 
@@ -482,7 +482,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
   char *filename;
   int filename_alloc = 0;
   enum grub_fshelp_filetype type;
-  
+
   auto grub_err_t susp_iterate_dir (struct grub_iso9660_susp_entry *);
 
   grub_err_t susp_iterate_dir (struct grub_iso9660_susp_entry *entry)
@@ -540,7 +540,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
              type = GRUB_FSHELP_UNKNOWN;
            }
        }
-      
+
       return 0;
     }
 
@@ -552,14 +552,14 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
                          offset % GRUB_DISK_SECTOR_SIZE,
                          sizeof (dirent), (char *) &dirent))
        return 0;
-      
+
       /* The end of the block, skip to the next one.  */
       if (!dirent.len)
        {
          offset = (offset / GRUB_ISO9660_BLKSZ + 1) * GRUB_ISO9660_BLKSZ;
          continue;
        }
-      
+
       {
        char name[dirent.namelen + 1];
        int nameoffset = offset + sizeof (dirent);
@@ -567,9 +567,9 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
        int sua_off = (sizeof (dirent) + dirent.namelen + 1
                       - (dirent.namelen % 2));;
        int sua_size = dirent.len - sua_off;
-       
+
        sua_off += offset + dir->data->susp_skip;
-       
+
        filename = 0;
        filename_alloc = 0;
        type = GRUB_FSHELP_UNKNOWN;
@@ -582,7 +582,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
                                          sua_off % GRUB_DISK_SECTOR_SIZE,
                                          sua_size, susp_iterate_dir))
          return 0;
-       
+
        /* Read the name.  */
        if (grub_disk_read (dir->data->disk,
                            (dir->blk << GRUB_ISO9660_LOG2_BLKSZ)
@@ -590,11 +590,11 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
                            nameoffset % GRUB_DISK_SECTOR_SIZE,
                            dirent.namelen, (char *) name))
          return 0;
-       
+
        node = grub_malloc (sizeof (struct grub_fshelp_node));
        if (!node)
          return 0;
-       
+
        /* Setup a new node.  */
        node->data = dir->data;
        node->size = grub_le_to_cpu32 (dirent.size);
@@ -602,7 +602,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
        node->dir_blk = ((dir->blk << GRUB_ISO9660_LOG2_BLKSZ)
                         + offset / GRUB_DISK_SECTOR_SIZE);
        node->dir_off = offset % GRUB_DISK_SECTOR_SIZE;
-       
+
        /* If the filetype was not stored using rockridge, use
           whatever is stored in the iso9660 filesystem.  */
        if (type == GRUB_FSHELP_UNKNOWN)
@@ -612,7 +612,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
            else
              type = GRUB_FSHELP_REG;
          }
-       
+
        /* The filename was not stored in a rock ridge entry.  Read it
           from the iso9660 filesystem.  */
        if (!filename)
@@ -621,7 +621,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
            filename = grub_strrchr (name, ';');
            if (filename)
              *filename = '\0';
-           
+
            if (dirent.namelen == 1 && name[0] == 0)
              filename = ".";
            else if (dirent.namelen == 1 && name[0] == 1)
@@ -629,7 +629,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
            else
              filename = name;
          }
-       
+
         if (dir->data->joliet)
           {
             char *oldname;
@@ -653,24 +653,24 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
        if (filename_alloc)
          grub_free (filename);
       }
-      
+
       offset += dirent.len;
     }
-  
+
   return 0;
 }
 
 
 \f
 static grub_err_t
-grub_iso9660_dir (grub_device_t device, const char *path, 
-                 int (*hook) (const char *filename, 
+grub_iso9660_dir (grub_device_t device, const char *path,
+                 int (*hook) (const char *filename,
                               const struct grub_dirhook_info *info))
 {
   struct grub_iso9660_data *data = 0;
   struct grub_fshelp_node rootnode;
   struct grub_fshelp_node *foundnode;
-  
+
   auto int NESTED_FUNC_ATTR iterate (const char *filename,
                                     enum grub_fshelp_filetype filetype,
                                     grub_fshelp_node_t node);
@@ -691,11 +691,11 @@ grub_iso9660_dir (grub_device_t device, const char *path,
   data = grub_iso9660_mount (device->disk);
   if (! data)
     goto fail;
-  
+
   rootnode.data = data;
   rootnode.blk = grub_le_to_cpu32 (data->voldesc.rootdir.first_sector);
   rootnode.size = grub_le_to_cpu32 (data->voldesc.rootdir.size);
-  
+
   /* Use the fshelp function to traverse the path.  */
   if (grub_fshelp_find_file (path, &rootnode,
                             &foundnode,
@@ -703,13 +703,13 @@ grub_iso9660_dir (grub_device_t device, const char *path,
                             grub_iso9660_read_symlink,
                             GRUB_FSHELP_DIR))
     goto fail;
-  
+
   /* List the files in the directory.  */
   grub_iso9660_iterate_dir (foundnode, iterate);
-  
+
   if (foundnode != &rootnode)
     grub_free (foundnode);
-  
+
  fail:
   grub_free (data);
 
@@ -726,17 +726,17 @@ grub_iso9660_open (struct grub_file *file, const char *name)
   struct grub_iso9660_data *data;
   struct grub_fshelp_node rootnode;
   struct grub_fshelp_node *foundnode;
-  
+
   grub_dl_ref (my_mod);
 
   data = grub_iso9660_mount (file->device->disk);
   if (!data)
     goto fail;
-  
+
   rootnode.data = data;
   rootnode.blk = grub_le_to_cpu32 (data->voldesc.rootdir.first_sector);
   rootnode.size = grub_le_to_cpu32 (data->voldesc.rootdir.size);
-  
+
   /* Use the fshelp function to traverse the path.  */
   if (grub_fshelp_find_file (name, &rootnode,
                             &foundnode,
@@ -744,21 +744,21 @@ grub_iso9660_open (struct grub_file *file, const char *name)
                             grub_iso9660_read_symlink,
                             GRUB_FSHELP_REG))
     goto fail;
-  
+
   data->first_sector = foundnode->blk;
   data->length = foundnode->size;
-  
+
   file->data = data;
   file->size = foundnode->size;
   file->offset = 0;
-  
+
   return 0;
-  
+
  fail:
   grub_dl_unref (my_mod);
-  
+
   grub_free (data);
-  
+
   return grub_errno;;
 }
 
@@ -766,17 +766,17 @@ grub_iso9660_open (struct grub_file *file, const char *name)
 static grub_ssize_t
 grub_iso9660_read (grub_file_t file, char *buf, grub_size_t len)
 {
-  struct grub_iso9660_data *data = 
+  struct grub_iso9660_data *data =
     (struct grub_iso9660_data *) file->data;
-  
+
   /* XXX: The file is stored in as a single extent.  */
-  data->disk->read_hook = file->read_hook;       
+  data->disk->read_hook = file->read_hook;
   grub_disk_read (data->disk,
                  data->first_sector << GRUB_ISO9660_LOG2_BLKSZ,
                  file->offset,
                  len, buf);
   data->disk->read_hook = 0;
-  
+
   return len;
 }
 
@@ -785,9 +785,9 @@ static grub_err_t
 grub_iso9660_close (grub_file_t file)
 {
   grub_free (file->data);
-  
+
   grub_dl_unref (my_mod);
-  
+
   return GRUB_ERR_NONE;
 }
 
@@ -797,7 +797,7 @@ grub_iso9660_label (grub_device_t device, char **label)
 {
   struct grub_iso9660_data *data;
   data = grub_iso9660_mount (device->disk);
-  
+
   if (data)
     {
       if (data->joliet)
@@ -837,11 +837,11 @@ grub_iso9660_uuid (grub_device_t device, char **uuid)
          grub_error (GRUB_ERR_BAD_NUMBER, "No creation date in filesystem to generate UUID.");
          *uuid = NULL;
        }
-      else 
+      else
        {
          *uuid = grub_malloc (sizeof ("YYYY-MM-DD-HH-mm-ss-hh"));
          grub_sprintf (*uuid, "%c%c%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c",
-                       data->voldesc.modified.year[0], data->voldesc.modified.year[1], 
+                       data->voldesc.modified.year[0], data->voldesc.modified.year[1],
                        data->voldesc.modified.year[2], data->voldesc.modified.year[3],
                        data->voldesc.modified.month[0], data->voldesc.modified.month[1],
                        data->voldesc.modified.day[0], data->voldesc.modified.day[1],
index 4bb2af962eb8167057d5d6e75259d511a97e191e..4f9182576fbc26687a4aa3e1c077855bf168d2c4 100644 (file)
--- a/fs/jfs.c
+++ b/fs/jfs.c
@@ -43,14 +43,14 @@ struct grub_jfs_sblock
   grub_uint8_t magic[4];
   grub_uint32_t version;
   grub_uint64_t ag_size;
-  
+
   /* The size of a filesystem block in bytes.  XXX: currently only
      4096 was tested.  */
   grub_uint32_t blksz;
   grub_uint16_t log2_blksz;
-  
+
   grub_uint8_t unused[71];
-  grub_uint8_t volname[11];  
+  grub_uint8_t volname[11];
 };
 
 struct grub_jfs_extent
@@ -58,7 +58,7 @@ struct grub_jfs_extent
   /* The length of the extent in filesystem blocks.  */
   grub_uint16_t length;
   grub_uint8_t length2;
-  
+
   /* The physical offset of the first block on the disk.  */
   grub_uint8_t blk1;
   grub_uint32_t blk2;
@@ -76,10 +76,10 @@ struct grub_jfs_treehead
 {
   grub_uint64_t next;
   grub_uint64_t prev;
-  
-  grub_uint8_t flags; 
+
+  grub_uint8_t flags;
   grub_uint8_t unused;
-  
+
   grub_uint16_t count;
   grub_uint16_t max;
   grub_uint8_t unused2[10];
@@ -94,7 +94,7 @@ struct grub_jfs_tree_extent
   /* The offset is the key used to lookup an extent.  */
   grub_uint8_t offset1;
   grub_uint32_t offset2;
-  
+
   struct grub_jfs_extent extent;
 } __attribute__ ((packed));
 
@@ -105,15 +105,15 @@ struct grub_jfs_tree_dir
      this level.  */
   grub_uint64_t nextb;
   grub_uint64_t prevb;
-  
+
   grub_uint8_t flags;
-  
+
   /* The amount of dirents in this node.  */
   grub_uint8_t count;
   grub_uint8_t freecnt;
   grub_uint8_t freelist;
   grub_uint8_t maxslot;
-  
+
   /* The location of the sorted array of pointers to dirents.  */
   grub_uint8_t sindex;
   grub_uint8_t unused[10];
@@ -161,7 +161,7 @@ struct grub_jfs_inode
   grub_uint32_t mode;
   grub_uint8_t unused3[72];
   grub_uint8_t unused4[96];
-  
+
   union
   {
     /* The tree describing the extents of the file.  */
@@ -177,7 +177,7 @@ struct grub_jfs_inode
       {
        grub_uint8_t unused[16];
        grub_uint8_t flags;
-       
+
        /* Amount of dirents in this node.  */
        grub_uint8_t count;
        grub_uint8_t freecnt;
@@ -222,7 +222,7 @@ struct grub_jfs_diropen
   char *sorted;
   struct grub_jfs_leaf_dirent *leaf;
   struct grub_jfs_leaf_next_dirent *next_leaf;
-  
+
   /* The filename and inode of the last read dirent.  */
   char name[255];
   grub_uint32_t ino;
@@ -241,19 +241,19 @@ grub_jfs_blkno (struct grub_jfs_data *data, struct grub_jfs_inode *inode,
 {
   auto int getblk (struct grub_jfs_treehead *treehead,
                   struct grub_jfs_tree_extent *extents);
-  
+
   int getblk (struct grub_jfs_treehead *treehead,
              struct grub_jfs_tree_extent *extents)
     {
       int found = -1;
       int i;
-      
+
       for (i = 0; i < grub_le_to_cpu16 (treehead->count) - 2; i++)
        {
          if (treehead->flags & GRUB_JFS_TREE_LEAF)
            {
              /* Read the leafnode.  */
-             if (grub_le_to_cpu32 (extents[i].offset2) <= blk 
+             if (grub_le_to_cpu32 (extents[i].offset2) <= blk
                  && ((grub_le_to_cpu16 (extents[i].extent.length))
                      + (extents[i].extent.length2 << 8)
                      + grub_le_to_cpu32 (extents[i].offset2)) > blk)
@@ -264,7 +264,7 @@ grub_jfs_blkno (struct grub_jfs_data *data, struct grub_jfs_inode *inode,
            if (blk >= grub_le_to_cpu32 (extents[i].offset2))
              found = i;
        }
-      
+
       if (found != -1)
        {
          struct
@@ -272,20 +272,20 @@ grub_jfs_blkno (struct grub_jfs_data *data, struct grub_jfs_inode *inode,
            struct grub_jfs_treehead treehead;
            struct grub_jfs_tree_extent extents[254];
          } tree;
-                 
+
          if (grub_disk_read (data->disk,
                              grub_le_to_cpu32 (extents[found].extent.blk2)
                              << (grub_le_to_cpu16 (data->sblock.log2_blksz)
                                  - GRUB_DISK_SECTOR_BITS), 0,
                              sizeof (tree), (char *) &tree))
            return -1;
-         
+
          return getblk (&tree.treehead, &tree.extents[0]);
        }
-      
+
       return -1;
     }
-  
+
   return getblk (&inode->file.tree, &inode->file.extents[0]);
 }
 
@@ -311,12 +311,12 @@ grub_jfs_read_inode (struct grub_jfs_data *data, int ino,
                                 - GRUB_DISK_SECTOR_BITS), 0,
                      sizeof (struct grub_jfs_iag), &iag))
     return grub_errno;
-  
+
   inoblk = grub_le_to_cpu32 (iag.inodes[inoext].blk2);
   inoblk <<= (grub_le_to_cpu16 (data->sblock.log2_blksz)
              - GRUB_DISK_SECTOR_BITS);
   inoblk += inonum;
-  
+
   if (grub_disk_read (data->disk, inoblk, 0,
                      sizeof (struct grub_jfs_inode), inode))
     return grub_errno;
@@ -338,13 +338,13 @@ grub_jfs_mount (grub_disk_t disk)
   if (grub_disk_read (disk, GRUB_JFS_SBLOCK, 0,
                      sizeof (struct grub_jfs_sblock), &data->sblock))
     goto fail;
-  
+
   if (grub_strncmp ((char *) (data->sblock.magic), "JFS1", 4))
     {
       grub_error (GRUB_ERR_BAD_FS, "not a jfs filesystem");
       goto fail;
     }
-  
+
   data->disk = disk;
   data->pos = 0;
   data->linknest = 0;
@@ -353,15 +353,15 @@ grub_jfs_mount (grub_disk_t disk)
   if (grub_disk_read (data->disk, GRUB_JFS_FS1_INODE_BLK, 0,
                      sizeof (struct grub_jfs_inode), &data->fileset))
     goto fail;
-  
+
   return data;
-  
+
  fail:
   grub_free (data);
-  
+
   if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
     grub_error (GRUB_ERR_BAD_FS, "not a jfs filesystem");
-  
+
   return 0;
 }
 
@@ -372,20 +372,20 @@ grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode)
   struct grub_jfs_internal_dirent *de;
   struct grub_jfs_diropen *diro;
   int blk;
-  
+
   de = (struct grub_jfs_internal_dirent *) inode->dir.dirents;
-  
+
   if (!((grub_le_to_cpu32 (inode->mode)
         & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_DIR))
     {
       grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
       return 0;
     }
-  
+
   diro = grub_malloc (sizeof (struct grub_jfs_diropen));
   if (!diro)
     return 0;
-  
+
   diro->index = 0;
   diro->data = data;
   diro->inode = inode;
@@ -408,10 +408,10 @@ grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode)
       grub_free (diro);
       return 0;
     }
-  
+
   blk = grub_le_to_cpu32 (de[inode->dir.header.sorted[0]].ex.blk2);
   blk <<= (grub_le_to_cpu16 (data->sblock.log2_blksz) - GRUB_DISK_SECTOR_BITS);
-  
+
   /* Read in the nodes until we are on the leaf node level.  */
   do
     {
@@ -436,7 +436,7 @@ grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode)
   diro->next_leaf = diro->dirpage->next_dirent;
   diro->sorted = &diro->dirpage->sorted[diro->dirpage->header.sindex * 32];
   diro->count = diro->dirpage->header.count;
-  
+
   return diro;
 }
 
@@ -461,31 +461,31 @@ grub_jfs_getent (struct grub_jfs_diropen *diro)
   int len;
   int nextent;
   grub_uint16_t filename[255];
-  
+
   auto void addstr (grub_uint16_t *uname, int ulen);
-  
+
   /* Add the unicode string to the utf16 filename buffer.  */
   void addstr (grub_uint16_t *name, int ulen)
     {
       while (ulen--)
        filename[strpos++] = *(name++);
     }
-  
+
   /* The last node, read in more.  */
   if (diro->index == diro->count)
     {
       unsigned int next;
-      
+
       /* If the inode contains the entry tree or if this was the last
         node, there is nothing to read.  */
       if ((diro->inode->file.tree.flags & GRUB_JFS_TREE_LEAF)
          || !grub_le_to_cpu64 (diro->dirpage->header.nextb))
        return GRUB_ERR_OUT_OF_RANGE;
-      
+
       next = grub_le_to_cpu64 (diro->dirpage->header.nextb);
       next <<= (grub_le_to_cpu16 (diro->data->sblock.log2_blksz)
                - GRUB_DISK_SECTOR_BITS);
-      
+
       if (grub_disk_read (diro->data->disk, next, 0,
                          grub_le_to_cpu32 (diro->data->sblock.blksz),
                          diro->dirpage->sorted))
@@ -500,18 +500,18 @@ grub_jfs_getent (struct grub_jfs_diropen *diro)
 
   leaf = &diro->leaf[(int) diro->sorted[diro->index]];
   next_leaf = &diro->next_leaf[diro->index];
-  
+
   len = leaf->len;
   if (!len)
     {
       diro->index++;
       return grub_jfs_getent (diro);
     }
-  
+
   addstr (leaf->namepart, len < 11 ? len : 11);
   diro->ino = grub_le_to_cpu32 (leaf->inode);
   len -= 11;
-  
+
   /* Move down to the leaf level.  */
   nextent = leaf->next;
   if (leaf->next != 255)
@@ -519,7 +519,7 @@ grub_jfs_getent (struct grub_jfs_diropen *diro)
       {
        next_leaf = &diro->next_leaf[nextent];
        addstr (next_leaf->namepart, len < 15 ? len : 15 );
-       
+
        len -= 15;
        nextent = next_leaf->next;
       } while (next_leaf->next != 255 && len > 0);
@@ -528,7 +528,7 @@ grub_jfs_getent (struct grub_jfs_diropen *diro)
 
   /* Convert the temporary UTF16 filename to UTF8.  */
   *grub_utf16_to_utf8 ((grub_uint8_t *) (diro->name), filename, strpos) = '\0';
-  
+
   return 0;
 }
 
@@ -550,15 +550,15 @@ grub_jfs_read_file (struct grub_jfs_data *data,
 
   blockcnt = ((len + pos + grub_le_to_cpu32 (data->sblock.blksz) - 1)
              / grub_le_to_cpu32 (data->sblock.blksz));
-  
+
   for (i = pos / grub_le_to_cpu32 (data->sblock.blksz); i < blockcnt; i++)
     {
       int blknr;
       int blockoff = pos % grub_le_to_cpu32 (data->sblock.blksz);
       int blockend = grub_le_to_cpu32 (data->sblock.blksz);
-      
+
       int skipfirst = 0;
-      
+
       blknr = grub_jfs_blkno (data, &data->currinode, i);
       if (grub_errno)
        return -1;
@@ -567,31 +567,31 @@ grub_jfs_read_file (struct grub_jfs_data *data,
       if (i == blockcnt - 1)
        {
          blockend = (len + pos) % grub_le_to_cpu32 (data->sblock.blksz);
-         
+
          if (!blockend)
            blockend = grub_le_to_cpu32 (data->sblock.blksz);
        }
-      
+
       /* First block.  */
       if (i == (pos / (int) grub_le_to_cpu32 (data->sblock.blksz)))
        {
          skipfirst = blockoff;
          blockend -= skipfirst;
        }
-      
+
       data->disk->read_hook = read_hook;
       grub_disk_read (data->disk,
                      blknr << (grub_le_to_cpu16 (data->sblock.log2_blksz)
                                - GRUB_DISK_SECTOR_BITS),
                      skipfirst, blockend, buf);
-      
+
       data->disk->read_hook = 0;
       if (grub_errno)
        return -1;
-      
+
       buf += grub_le_to_cpu32 (data->sblock.blksz) - skipfirst;
     }
-  
+
   return len;
 }
 
@@ -606,9 +606,9 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path)
   char *next;
   unsigned int pos = 0;
   struct grub_jfs_diropen *diro;
-  
+
   grub_strncpy (fpath, path, grub_strlen (path) + 1);
-  
+
   if (grub_jfs_read_inode (data, GRUB_JFS_AGGR_INODE, &data->currinode))
     return grub_errno;
 
@@ -633,28 +633,28 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path)
   diro = grub_jfs_opendir (data, &data->currinode);
   if (!diro)
     return grub_errno;
-    
+
   for (;;)
     {
       if (grub_strlen (name) == 0)
        return GRUB_ERR_NONE;
-      
+
       if (grub_jfs_getent (diro) == GRUB_ERR_OUT_OF_RANGE)
        break;
-      
+
       /* Check if the current direntry matches the current part of the
         pathname.  */
       if (!grub_strcmp (name, diro->name))
        {
          int ino = diro->ino;
          int dirino = grub_le_to_cpu32 (data->currinode.inode);
-         
+
          grub_jfs_closedir (diro);
          diro = 0;
-         
+
          if (grub_jfs_read_inode (data, ino, &data->currinode))
            break;
-         
+
          /* Check if this is a symlink.  */
          if ((grub_le_to_cpu32 (data->currinode.mode)
               & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_LNK)
@@ -663,12 +663,12 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path)
              if (grub_errno)
                return grub_errno;
            }
-         
+
          if (!next)
            return 0;
 
          pos = 0;
-         
+
          name = next;
          next = grub_strchr (name, '/');
          if (next)
@@ -676,12 +676,12 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path)
              next[0] = '\0';
              next++;
            }
-         
+
          /* Open this directory for reading dirents.  */
          diro = grub_jfs_opendir (data, &data->currinode);
          if (!diro)
            return grub_errno;
-         
+
          continue;
        }
     }
@@ -700,33 +700,33 @@ grub_jfs_lookup_symlink (struct grub_jfs_data *data, int ino)
 
   if (++data->linknest > GRUB_JFS_MAX_SYMLNK_CNT)
     return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");
-  
+
   if (size <= 128)
     grub_strncpy (symlink, (char *) (data->currinode.symlink.path), 128);
   else if (grub_jfs_read_file (data, 0, 0, size, symlink) < 0)
     return grub_errno;
 
   symlink[size] = '\0';
-  
+
   /* The symlink is an absolute path, go back to the root inode.  */
   if (symlink[0] == '/')
     ino = 2;
-  
+
   /* Now load in the old inode.  */
   if (grub_jfs_read_inode (data, ino, &data->currinode))
     return grub_errno;
-  
+
   grub_jfs_find_file (data, symlink);
   if (grub_errno)
     grub_error (grub_errno, "Can not follow symlink `%s'.", symlink);
-  
+
   return grub_errno;
 }
 \f
 
 static grub_err_t
-grub_jfs_dir (grub_device_t device, const char *path, 
-             int (*hook) (const char *filename, 
+grub_jfs_dir (grub_device_t device, const char *path,
+             int (*hook) (const char *filename,
                           const struct grub_dirhook_info *info))
 {
   struct grub_jfs_data *data = 0;
@@ -740,7 +740,7 @@ grub_jfs_dir (grub_device_t device, const char *path,
 
   if (grub_jfs_find_file (data, path))
     goto fail;
-  
+
   diro = grub_jfs_opendir (data, &data->currinode);
   if (!diro)
     goto fail;
@@ -751,16 +751,16 @@ grub_jfs_dir (grub_device_t device, const char *path,
       struct grub_jfs_inode inode;
       struct grub_dirhook_info info;
       grub_memset (&info, 0, sizeof (info));
-      
+
       if (grub_jfs_read_inode (data, diro->ino, &inode))
        goto fail;
-      
+
       info.dir = (grub_le_to_cpu32 (inode.mode)
                  & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_DIR;
       if (hook (diro->name, &info))
        goto fail;
     }
-  
+
   /* XXX: GRUB_ERR_OUT_OF_RANGE is used for the last dirent.  */
   if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
     grub_errno = 0;
@@ -786,11 +786,11 @@ grub_jfs_open (struct grub_file *file, const char *name)
   data = grub_jfs_mount (file->device->disk);
   if (!data)
     goto fail;
-  
+
   grub_jfs_find_file (data, name);
   if (grub_errno)
     goto fail;
-  
+
   /* It is only possible for open regular files.  */
   if (! ((grub_le_to_cpu32 (data->currinode.mode)
          & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_REG))
@@ -798,18 +798,18 @@ grub_jfs_open (struct grub_file *file, const char *name)
       grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a regular file");
       goto fail;
     }
-  
+
   file->data = data;
   file->size = grub_le_to_cpu64 (data->currinode.size);
-  
+
   return 0;
-  
+
  fail:
 
   grub_dl_unref (my_mod);
-  
+
   grub_free (data);
-  
+
   return grub_errno;;
 }
 
@@ -817,9 +817,9 @@ grub_jfs_open (struct grub_file *file, const char *name)
 static grub_ssize_t
 grub_jfs_read (grub_file_t file, char *buf, grub_size_t len)
 {
-  struct grub_jfs_data *data = 
+  struct grub_jfs_data *data =
     (struct grub_jfs_data *) file->data;
-  
+
   return grub_jfs_read_file (data, file->read_hook, file->offset, len, buf);
 }
 
@@ -828,9 +828,9 @@ static grub_err_t
 grub_jfs_close (grub_file_t file)
 {
   grub_free (file->data);
-  
+
   grub_dl_unref (my_mod);
-  
+
   return GRUB_ERR_NONE;
 }
 
@@ -840,12 +840,12 @@ grub_jfs_label (grub_device_t device, char **label)
 {
   struct grub_jfs_data *data;
   data = grub_jfs_mount (device->disk);
-  
+
   if (data)
     *label = grub_strndup ((char *) (data->sblock.volname), 11);
   else
     *label = 0;
-  
+
   return grub_errno;
 }
 \f
index 279366bd2cb7498cb61137f2d6ff50dff0f09688..44218fb8959c0d722875101c4cb5b502cfe21869 100644 (file)
@@ -96,7 +96,7 @@ struct grub_minix2_inode
   grub_uint32_t indir_zone;
   grub_uint32_t double_indir_zone;
   grub_uint32_t unused;
-  
+
 };
 
 /* Information about a "mounted" minix filesystem.  */
@@ -147,11 +147,11 @@ grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
          return grub_le_to_cpu32 (indir32);
        }
     }
-  
+
   /* Direct block.  */
   if (blk < 7)
     return GRUB_MINIX_INODE_DIR_ZONES (data, blk);
-  
+
   /* Indirect block.  */
   blk -= 7;
   if (blk < GRUB_MINIX_ZONESZ / GRUB_MINIX_INODE_BLKSZ (data))
@@ -159,23 +159,23 @@ grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
       indir = grub_get_indir (GRUB_MINIX_INODE_INDIR_ZONE (data), blk);
       return indir;
     }
-  
+
   /* Double indirect block.  */
   blk -= GRUB_MINIX_ZONESZ / GRUB_MINIX_INODE_BLKSZ (data);
   if (blk < (GRUB_MINIX_ZONESZ / GRUB_MINIX_INODE_BLKSZ (data))
       * (GRUB_MINIX_ZONESZ / GRUB_MINIX_INODE_BLKSZ (data)))
     {
-      indir = grub_get_indir (GRUB_MINIX_INODE_DINDIR_ZONE (data), 
+      indir = grub_get_indir (GRUB_MINIX_INODE_DINDIR_ZONE (data),
                              blk / GRUB_MINIX_ZONESZ);
-      
+
       indir = grub_get_indir (indir, blk % GRUB_MINIX_ZONESZ);
-      
+
       return indir;
     }
-  
+
   /* This should never happen.  */
   grub_error (GRUB_ERR_OUT_OF_RANGE, "file bigger than maximum size");
-  
+
   return 0;
 }
 
@@ -197,46 +197,46 @@ grub_minix_read_file (struct grub_minix_data *data,
     len = GRUB_MINIX_INODE_SIZE (data);
 
   blockcnt = (len + pos + GRUB_MINIX_BSIZE - 1) / GRUB_MINIX_BSIZE;
-  
+
   for (i = pos / GRUB_MINIX_BSIZE; i < blockcnt; i++)
     {
       int blknr;
       int blockoff = pos % GRUB_MINIX_BSIZE;
       int blockend = GRUB_MINIX_BSIZE;
-      
+
       int skipfirst = 0;
-      
+
       blknr = grub_minix_get_file_block (data, i);
       if (grub_errno)
        return -1;
-      
+
       /* Last block.  */
       if (i == blockcnt - 1)
        {
          blockend = (len + pos) % GRUB_MINIX_BSIZE;
-         
+
          if (!blockend)
            blockend = GRUB_MINIX_BSIZE;
        }
-      
+
       /* First block.  */
       if (i == (pos / (int) GRUB_MINIX_BSIZE))
        {
          skipfirst = blockoff;
          blockend -= skipfirst;
        }
-      
+
       data->disk->read_hook = read_hook;
       grub_disk_read (data->disk, blknr << GRUB_MINIX_LOG2_ZONESZ,
                      skipfirst, blockend, buf);
-      
+
       data->disk->read_hook = 0;
       if (grub_errno)
        return -1;
-      
+
       buf += GRUB_MINIX_BSIZE - skipfirst;
     }
-  
+
   return len;
 }
 
@@ -254,33 +254,33 @@ grub_minix_read_inode (struct grub_minix_data *data, int ino)
 
   /* The first inode in minix is inode 1.  */
   ino--;
-  
+
   block = ((2 + grub_le_to_cpu16 (sblock->inode_bmap_size)
            + grub_le_to_cpu16 (sblock->zone_bmap_size))
           << GRUB_MINIX_LOG2_BSIZE);
-  
+
   if (data->version == 1)
     {
       block += ino / (GRUB_DISK_SECTOR_SIZE / sizeof (struct grub_minix_inode));
-      int offs = (ino % (GRUB_DISK_SECTOR_SIZE 
+      int offs = (ino % (GRUB_DISK_SECTOR_SIZE
                         / sizeof (struct grub_minix_inode))
                  * sizeof (struct grub_minix_inode));
-      
+
       grub_disk_read (data->disk, block, offs,
                      sizeof (struct grub_minix_inode), &data->inode);
     }
   else
     {
-      block += ino / (GRUB_DISK_SECTOR_SIZE 
+      block += ino / (GRUB_DISK_SECTOR_SIZE
                      / sizeof (struct grub_minix2_inode));
-      int offs = (ino 
+      int offs = (ino
                  % (GRUB_DISK_SECTOR_SIZE / sizeof (struct grub_minix2_inode))
                  * sizeof (struct grub_minix2_inode));
-      
+
       grub_disk_read (data->disk, block, offs,
                      sizeof (struct grub_minix2_inode),&data->inode2);
     }
-  
+
   return GRUB_ERR_NONE;
 }
 
@@ -291,28 +291,28 @@ static grub_err_t
 grub_minix_lookup_symlink (struct grub_minix_data *data, int ino)
 {
   char symlink[GRUB_MINIX_INODE_SIZE (data) + 1];
-  
+
   if (++data->linknest > GRUB_MINIX_MAX_SYMLNK_CNT)
     return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");
-  
+
   if (grub_minix_read_file (data, 0, 0,
                            GRUB_MINIX_INODE_SIZE (data), symlink) < 0)
     return grub_errno;
 
   symlink[GRUB_MINIX_INODE_SIZE (data)] = '\0';
-  
+
   /* The symlink is an absolute path, go back to the root inode.  */
   if (symlink[0] == '/')
     ino = GRUB_MINIX_ROOT_INODE;
-  
+
   /* Now load in the old inode.  */
   if (grub_minix_read_inode (data, ino))
     return grub_errno;
-  
+
   grub_minix_find_file (data, symlink);
   if (grub_errno)
     grub_error (grub_errno, "Can not follow symlink `%s'.", symlink);
-  
+
   return grub_errno;
 }
 
@@ -327,9 +327,9 @@ grub_minix_find_file (struct grub_minix_data *data, const char *path)
   char *next;
   unsigned int pos = 0;
   int dirino;
-  
+
   grub_strcpy (fpath, path);
-  
+
   /* Skip the first slash.  */
   if (name[0] == '/')
     {
@@ -345,15 +345,15 @@ grub_minix_find_file (struct grub_minix_data *data, const char *path)
       next[0] = '\0';
       next++;
     }
-  
+
   do
     {
       grub_uint16_t ino;
       char filename[data->filename_size + 1];
-      
+
       if (grub_strlen (name) == 0)
        return GRUB_ERR_NONE;
-      
+
       if (grub_minix_read_file (data, 0, pos, sizeof (ino),
                                (char *) &ino) < 0)
        return grub_errno;
@@ -362,28 +362,28 @@ grub_minix_find_file (struct grub_minix_data *data, const char *path)
        return grub_errno;
 
       filename[data->filename_size] = '\0';
-      
+
       /* Check if the current direntry matches the current part of the
         pathname.  */
       if (!grub_strcmp (name, filename))
        {
          dirino = data->ino;
          grub_minix_read_inode (data, grub_le_to_cpu16 (ino));
-         
+
          /* Follow the symlink.  */
-         if ((GRUB_MINIX_INODE_MODE (data) 
+         if ((GRUB_MINIX_INODE_MODE (data)
               & GRUB_MINIX_IFLNK) == GRUB_MINIX_IFLNK)
            {
              grub_minix_lookup_symlink (data, dirino);
              if (grub_errno)
                return grub_errno;
            }
-         
+
          if (!next)
            return 0;
-         
+
          pos = 0;
-         
+
          name = next;
          next = grub_strchr (name, '/');
          if (next)
@@ -391,17 +391,17 @@ grub_minix_find_file (struct grub_minix_data *data, const char *path)
              next[0] = '\0';
              next++;
            }
-         
+
          if ((GRUB_MINIX_INODE_MODE (data)
               & GRUB_MINIX_IFDIR) != GRUB_MINIX_IFDIR)
            return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
-         
+
          continue;
        }
-      
+
       pos += sizeof (ino) + data->filename_size;
     } while (pos < GRUB_MINIX_INODE_SIZE (data));
-  
+
   grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
   return grub_errno;
 }
@@ -412,11 +412,11 @@ static struct grub_minix_data *
 grub_minix_mount (grub_disk_t disk)
 {
   struct grub_minix_data *data;
-  
+
   data = grub_malloc (sizeof (struct grub_minix_data));
   if (!data)
     return 0;
-  
+
   /* Read the superblock.  */
   grub_disk_read (disk, GRUB_MINIX_SBLOCK, 0,
                  sizeof (struct grub_minix_sblock),&data->sblock);
@@ -458,34 +458,34 @@ grub_minix_mount (grub_disk_t disk)
 }
 \f
 static grub_err_t
-grub_minix_dir (grub_device_t device, const char *path, 
-                 int (*hook) (const char *filename, 
+grub_minix_dir (grub_device_t device, const char *path,
+                 int (*hook) (const char *filename,
                               const struct grub_dirhook_info *info))
 {
   struct grub_minix_data *data = 0;
   struct grub_minix_sblock *sblock;
   unsigned int pos = 0;
-  
+
   data = grub_minix_mount (device->disk);
   if (!data)
     return grub_errno;
-  
+
   grub_minix_read_inode (data, GRUB_MINIX_ROOT_INODE);
   if (grub_errno)
     goto fail;
-  
+
   sblock = &data->sblock;
 
   grub_minix_find_file (data, path);
   if (grub_errno)
     goto fail;
-  
+
   if ((GRUB_MINIX_INODE_MODE (data) & GRUB_MINIX_IFDIR) != GRUB_MINIX_IFDIR)
     {
       grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
       goto fail;
     }
-  
+
   while (pos < GRUB_MINIX_INODE_SIZE (data))
     {
       grub_uint16_t ino;
@@ -494,31 +494,31 @@ grub_minix_dir (grub_device_t device, const char *path,
       struct grub_dirhook_info info;
       grub_memset (&info, 0, sizeof (info));
 
-      
+
       if (grub_minix_read_file (data, 0, pos, sizeof (ino),
                                (char *) &ino) < 0)
        return grub_errno;
-      
+
       if (grub_minix_read_file (data, 0, pos + sizeof (ino),
                                data->filename_size,
                                (char *) filename) < 0)
        return grub_errno;
       filename[data->filename_size] = '\0';
-      
+
       /* The filetype is not stored in the dirent.  Read the inode to
         find out the filetype.  This *REALLY* sucks.  */
       grub_minix_read_inode (data, grub_le_to_cpu16 (ino));
-      info.dir = ((GRUB_MINIX_INODE_MODE (data) 
+      info.dir = ((GRUB_MINIX_INODE_MODE (data)
                   & GRUB_MINIX_IFDIR) == GRUB_MINIX_IFDIR);
       if (hook (filename, &info) ? 1 : 0)
        break;
-      
+
       /* Load the old inode back in.  */
       grub_minix_read_inode (data, dirino);
 
       pos += sizeof (ino) + data->filename_size;
     }
-  
+
  fail:
   grub_free (data);
   return grub_errno;
@@ -541,13 +541,13 @@ grub_minix_open (struct grub_file *file, const char *name)
       grub_free (data);
       return grub_errno;
     }
-    
+
   if (!name || name[0] != '/')
     {
       grub_error (GRUB_ERR_BAD_FILENAME, "bad filename");
       return grub_errno;
     }
-  
+
   /* Traverse the directory tree to the node that should be
      opened.  */
   grub_minix_find_file (data, name);
@@ -556,10 +556,10 @@ grub_minix_open (struct grub_file *file, const char *name)
       grub_free (data);
       return grub_errno;
     }
-  
+
   file->data = data;
   file->size = GRUB_MINIX_INODE_SIZE (data);
-  
+
   return GRUB_ERR_NONE;
 }
 
@@ -567,9 +567,9 @@ grub_minix_open (struct grub_file *file, const char *name)
 static grub_ssize_t
 grub_minix_read (grub_file_t file, char *buf, grub_size_t len)
 {
-  struct grub_minix_data *data = 
+  struct grub_minix_data *data =
     (struct grub_minix_data *) file->data;
-  
+
   return grub_minix_read_file (data, file->read_hook, file->offset, len, buf);
 }
 
@@ -578,7 +578,7 @@ static grub_err_t
 grub_minix_close (grub_file_t file)
 {
   grub_free (file->data);
-  
+
   return GRUB_ERR_NONE;
 }
 
index 709c6d9eda1ad4c33b2c4a49b6769045d5a9f1f1..c312b8b62c897fae2d4e4f985f6a4b2c0c43b5f7 100644 (file)
--- a/fs/ntfs.c
+++ b/fs/ntfs.c
@@ -862,7 +862,7 @@ fail:
 
 static grub_err_t
 grub_ntfs_dir (grub_device_t device, const char *path,
-              int (*hook) (const char *filename, 
+              int (*hook) (const char *filename,
                            const struct grub_dirhook_info *info))
 {
   struct grub_ntfs_data *data = 0;
index 9d5e9d8912c3a2c0d0e7890c587abe6a36f285c8..04d33150fe0e9cdf9cc9a6e5cd143ea99ce41daf 100644 (file)
@@ -319,7 +319,7 @@ grub_reiserfs_print_key (const struct grub_reiserfs_key *key)
     "any      ",
     "unknown  "
   };
-  
+
   for (a = 0; a < sizeof (struct grub_reiserfs_key); a++)
     grub_printf ("%02x ", ((unsigned int) ((unsigned char *) key)[a]) & 0xFF);
   grub_printf ("parent id = 0x%08x, self id = 0x%08x, type = %s, offset = ",
@@ -376,7 +376,7 @@ grub_reiserfs_set_key_type (struct grub_reiserfs_key *key,
                             int version)
 {
   grub_uint32_t type;
-  
+
   switch (grub_type)
     {
     case GRUB_REISERFS_STAT:
@@ -397,14 +397,14 @@ grub_reiserfs_set_key_type (struct grub_reiserfs_key *key,
     default:
       return;
     }
-  
+
   if (version == 1)
     key->u.v1.type = grub_cpu_to_le32 (type);
   else
     key->u.v2.offset_type
       = ((key->u.v2.offset_type & grub_cpu_to_le64 (~0ULL >> 4))
          | grub_cpu_to_le64 ((grub_uint64_t) type << 60));
-  
+
   assert (grub_reiserfs_get_key_type (key) == grub_type);
 }
 
@@ -418,31 +418,31 @@ grub_reiserfs_compare_keys (const struct grub_reiserfs_key *key1,
   grub_uint64_t offset1, offset2;
   enum grub_reiserfs_item_type type1, type2;
   grub_uint32_t id1, id2;
-  
+
   if (! key1 || ! key2)
     return -2;
-  
+
   id1 = grub_le_to_cpu32 (key1->directory_id);
   id2 = grub_le_to_cpu32 (key2->directory_id);
   if (id1 < id2)
     return -1;
   if (id1 > id2)
     return 1;
-  
+
   id1 = grub_le_to_cpu32 (key1->object_id);
   id2 = grub_le_to_cpu32 (key2->object_id);
   if (id1 < id2)
     return -1;
   if (id1 > id2)
     return 1;
-  
+
   offset1 = grub_reiserfs_get_key_offset (key1);
   offset2 = grub_reiserfs_get_key_offset (key2);
   if (offset1 < offset2)
     return -1;
   if (offset1 > offset2)
     return 1;
-  
+
   type1 = grub_reiserfs_get_key_type (key1);
   type2 = grub_reiserfs_get_key_type (key2);
   if ((type1 == GRUB_REISERFS_ANY
@@ -456,7 +456,7 @@ grub_reiserfs_compare_keys (const struct grub_reiserfs_key *key1,
     return -1;
   if (type1 > type2)
     return 1;
-  
+
   return 0;
 }
 
@@ -474,7 +474,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data,
   grub_uint16_t i;
   grub_uint16_t previous_level = ~0;
   struct grub_reiserfs_item_header *item_headers = 0;
-  
+
   if (! data)
     {
       grub_error (GRUB_ERR_TEST_FAILURE, "data is NULL");
@@ -492,7 +492,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data,
       grub_error (GRUB_ERR_TEST_FAILURE, "item is NULL");
       goto fail;
     }
-  
+
   block_size = grub_le_to_cpu16 (data->superblock.block_size);
   block_number = grub_le_to_cpu32 (data->superblock.root_block);
 #ifdef GRUB_REISERFS_DEBUG
@@ -502,7 +502,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data,
   block_header = grub_malloc (block_size);
   if (! block_header)
     goto fail;
-  
+
   item->next_offset = 0;
   do
     {
@@ -534,7 +534,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data,
           struct grub_reiserfs_disk_child *children
             = ((struct grub_reiserfs_disk_child *)
                (keys + item_count));
-          
+
           for (i = 0;
                i < item_count
                  && grub_reiserfs_compare_keys (key, &(keys[i])) >= 0;
@@ -620,7 +620,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data,
       grub_reiserfs_print_key (block_key);
 #endif
     }
-  
+
   assert (grub_errno == GRUB_ERR_NONE);
   grub_free (block_header);
   return GRUB_ERR_NONE;
@@ -740,7 +740,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item,
       struct grub_fshelp_node directory_item;
       grub_uint16_t entry_count, entry_number;
       struct grub_reiserfs_item_header *item_headers;
-      
+
       grub_disk_read (data->disk,
                       block_number * (block_size >> GRUB_DISK_SECTOR_BITS),
                       (((grub_off_t) block_number * block_size)
@@ -758,7 +758,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item,
           goto fail;
         }
 #endif
-      
+
       item_headers = (struct grub_reiserfs_item_header *) (block_header + 1);
       directory_headers
         = ((struct grub_reiserfs_directory_header *)
@@ -772,7 +772,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item,
             = &directory_headers[entry_number];
           grub_uint16_t entry_state
             = grub_le_to_cpu16 (directory_header->state);
-          
+
           if (entry_state & GRUB_REISERFS_VISIBLE_MASK)
             {
               grub_fshelp_node_t entry_item;
@@ -792,14 +792,14 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item,
               entry_item = grub_malloc (sizeof (*entry_item));
               if (! entry_item)
                 goto fail;
-              
+
               if (grub_reiserfs_get_item (data, &entry_key, entry_item)
                   != GRUB_ERR_NONE)
                 {
                   grub_free (entry_item);
                   goto fail;
                 }
-              
+
               if (entry_item->type == GRUB_REISERFS_DIRECTORY)
                 entry_type = GRUB_FSHELP_DIR;
               else
@@ -945,7 +945,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item,
                                   the current one.  */
             }
         }
-      
+
       if (next_offset == 0)
         break;
 
@@ -1096,7 +1096,7 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len)
   while (current_position < final_position)
     {
       grub_reiserfs_set_key_offset (&key, current_key_offset);
-    
+
       if (grub_reiserfs_get_item (data, &key, &found) != GRUB_ERR_NONE)
         goto fail;
       if (found.block_number == 0)
@@ -1186,7 +1186,7 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len)
         }
       current_key_offset = current_position + 1;
     }
-  
+
   grub_dprintf ("reiserfs",
                "Have successfully read %lld bytes (%ld requested)\n",
                (unsigned long long) (current_position - initial_position),
@@ -1258,7 +1258,7 @@ grub_reiserfs_close (grub_file_t file)
 /* Call HOOK with each file under DIR.  */
 static grub_err_t
 grub_reiserfs_dir (grub_device_t device, const char *path,
-                   int (*hook) (const char *filename, 
+                   int (*hook) (const char *filename,
                                const struct grub_dirhook_info *info))
 {
   struct grub_reiserfs_data *data = 0;
index 4e0ef618e9f7dbaad5b82b1490aa3be8bb40351f..ec59b73ca306e00c1d4ed01502f25be11d45a694 100644 (file)
--- a/fs/sfs.c
+++ b/fs/sfs.c
@@ -194,7 +194,7 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block,
              /* We found a correct leaf.  */
              *size = grub_be_to_cpu16 (extent->size);
              *nextext = grub_be_to_cpu32 (extent->next);
-             
+
              grub_free (treeblock);
              return 0;
            }
@@ -370,7 +370,7 @@ grub_sfs_iterate_dir (grub_fshelp_node_t dir,
       node->data = data;
       node->size = size;
       node->block = block;
-      
+
       return hook (name, type, node);
     }
 
@@ -451,18 +451,18 @@ grub_sfs_open (struct grub_file *file, const char *name)
 {
   struct grub_sfs_data *data;
   struct grub_fshelp_node *fdiro = 0;
-  
+
   grub_dl_ref (my_mod);
-  
+
   data = grub_sfs_mount (file->device->disk);
   if (!data)
     goto fail;
-  
+
   grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_sfs_iterate_dir,
                         grub_sfs_read_symlink, GRUB_FSHELP_REG);
   if (grub_errno)
     goto fail;
-  
+
   file->size = fdiro->size;
   data->diropen = *fdiro;
   grub_free (fdiro);
@@ -478,7 +478,7 @@ grub_sfs_open (struct grub_file *file, const char *name)
   if (data)
     grub_free (data->label);
   grub_free (data);
-  
+
   grub_dl_unref (my_mod);
 
   return grub_errno;
@@ -510,13 +510,13 @@ grub_sfs_read (grub_file_t file, char *buf, grub_size_t len)
 
 
 static grub_err_t
-grub_sfs_dir (grub_device_t device, const char *path, 
-              int (*hook) (const char *filename, 
+grub_sfs_dir (grub_device_t device, const char *path,
+              int (*hook) (const char *filename,
                            const struct grub_dirhook_info *info))
 {
   struct grub_sfs_data *data = 0;
   struct grub_fshelp_node *fdiro = 0;
-  
+
   auto int NESTED_FUNC_ATTR iterate (const char *filename,
                                     enum grub_fshelp_filetype filetype,
                                     grub_fshelp_node_t node);
@@ -533,7 +533,7 @@ grub_sfs_dir (grub_device_t device, const char *path,
     }
 
   grub_dl_ref (my_mod);
-  
+
   data = grub_sfs_mount (device->disk);
   if (!data)
     goto fail;
@@ -544,7 +544,7 @@ grub_sfs_dir (grub_device_t device, const char *path,
     goto fail;
 
   grub_sfs_iterate_dir (fdiro, iterate);
-  
+
  fail:
   if (data && fdiro != &data->diropen)
     grub_free (fdiro);
index b45615de1a05aade0d465a82570a556ddf237db3..7741d45e7394432ab35f3aba108e4f61f2e95b85 100644 (file)
--- a/fs/udf.c
+++ b/fs/udf.c
@@ -766,7 +766,7 @@ grub_udf_iterate_dir (grub_fshelp_node_t dir,
 
 static grub_err_t
 grub_udf_dir (grub_device_t device, const char *path,
-             int (*hook) (const char *filename, 
+             int (*hook) (const char *filename,
                           const struct grub_dirhook_info *info))
 {
   struct grub_udf_data *data = 0;
index 75a2d404f77e5e49ae5c05cc361deeb4112c4e1b..7a2d21f251dbaffe88bbe500c348cea0ade0f687 100644 (file)
--- a/fs/ufs.c
+++ b/fs/ufs.c
@@ -71,30 +71,30 @@ struct grub_ufs_sblock
   grub_uint8_t unused[16];
   /* The offset of the inodes in the cylinder group.  */
   grub_uint32_t inoblk_offs;
-  
+
   grub_uint8_t unused2[4];
-  
+
   /* The start of the cylinder group.  */
   grub_uint32_t cylg_offset;
   grub_uint8_t unused3[4];
 
   grub_uint32_t mtime;
   grub_uint8_t unused4[12];
-  
+
   /* The size of a block in bytes.  */
   grub_int32_t bsize;
   grub_uint8_t unused5[48];
-  
+
   /* The size of filesystem blocks to disk blocks.  */
   grub_uint32_t log2_blksz;
   grub_uint8_t unused6[80];
-  
+
   /* Inodes stored per cylinder group.  */
   grub_uint32_t ino_per_group;
-  
+
   /* The frags per cylinder group.  */
   grub_uint32_t frags_per_group;
-  
+
   grub_uint8_t unused7[488];
 
   /* Volume name for UFS2.  */
@@ -103,7 +103,7 @@ struct grub_ufs_sblock
 
   grub_uint64_t mtime2;
   grub_uint8_t unused9[420];
-  
+
   /* Magic value to check if this is really a UFS filesystem.  */
   grub_uint32_t magic;
 };
@@ -182,7 +182,7 @@ struct grub_ufs_dirent
     struct
     {
       grub_uint8_t filetype_bsd;
-      grub_uint8_t namelen_bsd;      
+      grub_uint8_t namelen_bsd;
     };
   };
 } __attribute__ ((packed));
@@ -219,16 +219,16 @@ grub_ufs_get_file_block (struct grub_ufs_data *data, unsigned int blk)
 {
   struct grub_ufs_sblock *sblock = &data->sblock;
   unsigned int indirsz;
-  int log2_blksz; 
-  
+  int log2_blksz;
+
   /* Direct.  */
   if (blk < GRUB_UFS_DIRBLKS)
     return INODE_DIRBLOCKS (data, blk);
-  
+
   log2_blksz = grub_le_to_cpu32 (data->sblock.log2_blksz);
-  
+
   blk -= GRUB_UFS_DIRBLKS;
-  
+
   indirsz = UFS_BLKSZ (sblock) / INODE_BLKSZ (data);
   /* Single indirect block.  */
   if (blk < indirsz)
@@ -239,20 +239,20 @@ grub_ufs_get_file_block (struct grub_ufs_data *data, unsigned int blk)
       return (data->ufs_type == UFS1) ? indir[blk] : indir[blk << 1];
     }
   blk -= indirsz;
-  
+
   /* Double indirect block.  */
   if (blk < indirsz * indirsz)
     {
       grub_uint32_t indir[UFS_BLKSZ (sblock) >> 2];
-      
+
       grub_disk_read (data->disk, INODE_INDIRBLOCKS (data, 1) << log2_blksz,
                      0, sizeof (indir), indir);
       grub_disk_read (data->disk,
                      ((data->ufs_type == UFS1) ?
-                     indir[blk / indirsz] : indir [(blk / indirsz) << 1]) 
+                     indir[blk / indirsz] : indir [(blk / indirsz) << 1])
                      << log2_blksz,
                      0, sizeof (indir), indir);
-      
+
       return (data->ufs_type == UFS1) ?
             indir[blk % indirsz] : indir[(blk % indirsz) << 1];
     }
@@ -281,35 +281,35 @@ grub_ufs_read_file (struct grub_ufs_data *data,
     len = INODE_SIZE (data);
 
   blockcnt = (len + pos + UFS_BLKSZ (sblock) - 1) / UFS_BLKSZ (sblock);
-  
+
   for (i = pos / UFS_BLKSZ (sblock); i < blockcnt; i++)
     {
       int blknr;
       int blockoff = pos % UFS_BLKSZ (sblock);
       int blockend = UFS_BLKSZ (sblock);
-      
+
       int skipfirst = 0;
-      
+
       blknr = grub_ufs_get_file_block (data, i);
       if (grub_errno)
        return -1;
-      
+
       /* Last block.  */
       if (i == blockcnt - 1)
        {
          blockend = (len + pos) % UFS_BLKSZ (sblock);
-         
+
          if (!blockend)
            blockend = UFS_BLKSZ (sblock);
        }
-      
+
       /* First block.  */
       if (i == (pos / (int) UFS_BLKSZ (sblock)))
        {
          skipfirst = blockoff;
          blockend -= skipfirst;
        }
-      
+
       /* XXX: If the block number is 0 this block is not stored on
         disk but is zero filled instead.  */
       if (blknr)
@@ -327,7 +327,7 @@ grub_ufs_read_file (struct grub_ufs_data *data,
 
       buf += UFS_BLKSZ (sblock) - skipfirst;
     }
-  
+
   return len;
 }
 
@@ -338,16 +338,16 @@ static grub_err_t
 grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode)
 {
   struct grub_ufs_sblock *sblock = &data->sblock;
-  
+
   /* Determine the group the inode is in.  */
   int group = ino / grub_le_to_cpu32 (sblock->ino_per_group);
-  
+
   /* Determine the inode within the group.  */
   int grpino = ino % grub_le_to_cpu32 (sblock->ino_per_group);
-  
+
   /* The first block of the group.  */
   int grpblk = group * (grub_le_to_cpu32 (sblock->frags_per_group));
-  
+
   if (data->ufs_type == UFS1)
     {
       if (!inode)
@@ -380,7 +380,7 @@ grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode)
                      sizeof (struct grub_ufs2_inode),
                      inode);
     }
-  
+
   return grub_errno;
 }
 
@@ -391,16 +391,16 @@ static grub_err_t
 grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino)
 {
   char symlink[INODE_SIZE (data)];
-  
+
   if (++data->linknest > GRUB_UFS_MAX_SYMLNK_CNT)
     return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");
-  
+
   if (INODE_NBLOCKS (data) == 0)
     grub_strcpy (symlink, (char *) INODE (data, symlink));
   else
     {
-      grub_disk_read (data->disk, 
-                     (INODE_DIRBLOCKS (data, 0) 
+      grub_disk_read (data->disk,
+                     (INODE_DIRBLOCKS (data, 0)
                       << grub_le_to_cpu32 (data->sblock.log2_blksz)),
                      0, INODE_SIZE (data), symlink);
       symlink[INODE_SIZE (data)] = '\0';
@@ -409,15 +409,15 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino)
   /* The symlink is an absolute path, go back to the root inode.  */
   if (symlink[0] == '/')
     ino = GRUB_UFS_INODE;
-  
+
   /* Now load in the old inode.  */
   if (grub_ufs_read_inode (data, ino, 0))
     return grub_errno;
-  
+
   grub_ufs_find_file (data, symlink);
   if (grub_errno)
     grub_error (grub_errno, "Can not follow symlink `%s'.", symlink);
-  
+
   return grub_errno;
 }
 
@@ -432,9 +432,9 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
   char *next;
   unsigned int pos = 0;
   int dirino;
-  
+
   grub_strcpy (fpath, path);
-  
+
   /* Skip the first slash.  */
   if (name[0] == '/')
     {
@@ -450,31 +450,31 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
       next[0] = '\0';
       next++;
     }
-  
+
   do
     {
       struct grub_ufs_dirent dirent;
       int namelen;
-      
+
       if (grub_strlen (name) == 0)
        return GRUB_ERR_NONE;
-      
+
       if (grub_ufs_read_file (data, 0, pos, sizeof (dirent),
                              (char *) &dirent) < 0)
        return grub_errno;
 
       namelen = (data->ufs_type == UFS2)
        ? dirent.namelen_bsd : grub_le_to_cpu16 (dirent.namelen);
-      
+
       {
        char filename[namelen + 1];
 
        if (grub_ufs_read_file (data, 0, pos + sizeof (dirent),
                                namelen, filename) < 0)
          return grub_errno;
-       
+
        filename[namelen] = '\0';
-       
+
        if (!grub_strcmp (name, filename))
          {
            dirino = data->ino;
@@ -500,17 +500,17 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
                next[0] = '\0';
                next++;
              }
-           
+
            if ((INODE_MODE(data) & GRUB_UFS_ATTR_TYPE) != GRUB_UFS_ATTR_DIR)
              return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
-           
+
            continue;
          }
       }
-      
+
       pos += grub_le_to_cpu16 (dirent.direntlen);
     } while (pos < INODE_SIZE (data));
-  
+
   grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
   return grub_errno;
 }
@@ -522,11 +522,11 @@ grub_ufs_mount (grub_disk_t disk)
 {
   struct grub_ufs_data *data;
   int *sblklist = sblocklist;
-  
+
   data = grub_malloc (sizeof (struct grub_ufs_data));
   if (!data)
     return 0;
-  
+
   /* Find a UFS1 or UFS2 sblock.  */
   data->ufs_type = UNKNOWN;
   while (*sblklist != -1)
@@ -535,7 +535,7 @@ grub_ufs_mount (grub_disk_t disk)
                      &data->sblock);
       if (grub_errno)
        goto fail;
-      
+
       if (grub_le_to_cpu32 (data->sblock.magic) == GRUB_UFS_MAGIC)
        {
          data->ufs_type = UFS1;
@@ -560,17 +560,17 @@ grub_ufs_mount (grub_disk_t disk)
 
  fail:
   grub_free (data);
-  
+
   if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
     grub_error (GRUB_ERR_BAD_FS, "not a ufs filesystem");
-  
+
   return 0;
 }
 
 
 static grub_err_t
-grub_ufs_dir (grub_device_t device, const char *path, 
-              int (*hook) (const char *filename, 
+grub_ufs_dir (grub_device_t device, const char *path,
+              int (*hook) (const char *filename,
                            const struct grub_dirhook_info *info))
 {
   struct grub_ufs_data *data;
@@ -580,50 +580,50 @@ grub_ufs_dir (grub_device_t device, const char *path,
   data = grub_ufs_mount (device->disk);
   if (!data)
     return grub_errno;
-  
+
   grub_ufs_read_inode (data, GRUB_UFS_INODE, 0);
   if (grub_errno)
     return grub_errno;
-  
+
   sblock = &data->sblock;
-  
+
   if (!path || path[0] != '/')
     {
       grub_error (GRUB_ERR_BAD_FILENAME, "bad filename");
       return grub_errno;
     }
-  
+
   grub_ufs_find_file (data, path);
   if (grub_errno)
-    goto fail;  
-  
+    goto fail;
+
   if ((INODE_MODE (data) & GRUB_UFS_ATTR_TYPE) != GRUB_UFS_ATTR_DIR)
     {
       grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
       goto fail;
     }
-  
+
   while (pos < INODE_SIZE (data))
     {
       struct grub_ufs_dirent dirent;
       int namelen;
-      
+
       if (grub_ufs_read_file (data, 0, pos, sizeof (dirent),
                              (char *) &dirent) < 0)
        break;
 
       namelen = (data->ufs_type == UFS2)
        ? dirent.namelen_bsd : grub_le_to_cpu16 (dirent.namelen);
-      
+
       {
        char filename[namelen + 1];
        struct grub_dirhook_info info;
        grub_memset (&info, 0, sizeof (info));
-       
+
        if (grub_ufs_read_file (data, 0, pos + sizeof (dirent),
                                namelen, filename) < 0)
          break;
-       
+
        filename[namelen] = '\0';
        if (data->ufs_type == UFS1)
          {
@@ -647,7 +647,7 @@ grub_ufs_dir (grub_device_t device, const char *path,
        if (hook (filename, &info))
          break;
       }
-      
+
       pos += grub_le_to_cpu16 (dirent.direntlen);
     }
 
@@ -666,27 +666,27 @@ grub_ufs_open (struct grub_file *file, const char *name)
   data = grub_ufs_mount (file->device->disk);
   if (!data)
     return grub_errno;
-  
+
   grub_ufs_read_inode (data, 2, 0);
   if (grub_errno)
     {
       grub_free (data);
       return grub_errno;
     }
-    
+
   if (!name || name[0] != '/')
     {
       grub_error (GRUB_ERR_BAD_FILENAME, "bad filename");
       return grub_errno;
     }
-  
+
   grub_ufs_find_file (data, name);
   if (grub_errno)
     {
       grub_free (data);
       return grub_errno;
     }
-  
+
   file->data = data;
   file->size = INODE_SIZE (data);
 
@@ -697,9 +697,9 @@ grub_ufs_open (struct grub_file *file, const char *name)
 static grub_ssize_t
 grub_ufs_read (grub_file_t file, char *buf, grub_size_t len)
 {
-  struct grub_ufs_data *data = 
+  struct grub_ufs_data *data =
     (struct grub_ufs_data *) file->data;
-  
+
   return grub_ufs_read_file (data, file->read_hook, file->offset, len, buf);
 }
 
@@ -708,7 +708,7 @@ static grub_err_t
 grub_ufs_close (grub_file_t file)
 {
   grub_free (file->data);
-  
+
   return GRUB_ERR_NONE;
 }
 
@@ -737,7 +737,7 @@ grub_ufs_label (grub_device_t device, char **label)
 }
 
 /* Get mtime.  */
-static grub_err_t 
+static grub_err_t
 grub_ufs_mtime (grub_device_t device, grub_int32_t *tm)
 {
   struct grub_ufs_data *data = 0;
index 4ba6c67cab458e40a3e9829c8c370b681b32e8dc..68a4b4f5603bffc37f979a9a19fe9abeb923aeb5 100644 (file)
--- a/fs/xfs.c
+++ b/fs/xfs.c
@@ -42,7 +42,7 @@ struct grub_xfs_sblock
   grub_uint8_t unused2[8];
   grub_uint64_t rootino;
   grub_uint8_t unused3[20];
-  grub_uint32_t agsize; 
+  grub_uint32_t agsize;
   grub_uint8_t unused4[20];
   grub_uint8_t label[12];
   grub_uint8_t log2_bsize;
@@ -395,7 +395,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
 {
   struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;
   auto int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, char *filename);
-    
+
   int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, char *filename)
     {
       struct grub_fshelp_node *fdiro;
@@ -403,7 +403,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
       fdiro = grub_malloc (sizeof (struct grub_fshelp_node));
       if (!fdiro)
        return 0;
-             
+
       /* The inode should be read, otherwise the filetype can
         not be determined.  */
       fdiro->ino = ino;
@@ -415,7 +415,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
                   grub_xfs_mode_to_filetype (fdiro->inode.mode),
                   fdiro);
     }
-  
+
   switch (diro->inode.format)
     {
     case XFS_INODE_FORMAT_INO:
@@ -453,7 +453,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
                            + sizeof (struct grub_xfs_dir_entry)
                            + de->len - 1);
            char name[de->len + 1];
-           
+
            if (smallino)
              {
                ino = grub_be_to_cpu32 (*(grub_uint32_t *) inopos);
@@ -467,7 +467,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
            if (call_hook (ino, name))
              return 1;
 
-           de = ((struct grub_xfs_dir_entry *) 
+           de = ((struct grub_xfs_dir_entry *)
                  (((char *) de)+ sizeof (struct grub_xfs_dir_entry) + de->len
                   + ((smallino ? sizeof (grub_uint32_t)
                       : sizeof (grub_uint64_t))) - 1));
@@ -493,7 +493,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
 
        /* Iterate over every block the directory has.  */
        for (blk = 0;
-            blk < (grub_be_to_cpu64 (dir->inode.size) 
+            blk < (grub_be_to_cpu64 (dir->inode.size)
                    >> dirblk_log2);
             blk++)
          {
@@ -585,7 +585,7 @@ grub_xfs_mount (grub_disk_t disk)
   if (grub_disk_read (disk, 0, 0,
                      sizeof (struct grub_xfs_sblock), &data->sblock))
     goto fail;
-  
+
   if (grub_strncmp ((char *) (data->sblock.magic), "XFSB", 4))
     {
       grub_error (GRUB_ERR_BAD_FS, "not a xfs filesystem");
@@ -606,24 +606,24 @@ grub_xfs_mount (grub_disk_t disk)
 
   return data;
  fail:
-  
+
   if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
     grub_error (GRUB_ERR_BAD_FS, "not an xfs filesystem");
 
   grub_free (data);
-  
+
   return 0;
 }
 
 \f
 static grub_err_t
-grub_xfs_dir (grub_device_t device, const char *path, 
-             int (*hook) (const char *filename, 
+grub_xfs_dir (grub_device_t device, const char *path,
+             int (*hook) (const char *filename,
                           const struct grub_dirhook_info *info))
 {
   struct grub_xfs_data *data = 0;;
   struct grub_fshelp_node *fdiro = 0;
-  
+
   auto int NESTED_FUNC_ATTR iterate (const char *filename,
                                     enum grub_fshelp_filetype filetype,
                                     grub_fshelp_node_t node);
@@ -640,18 +640,18 @@ grub_xfs_dir (grub_device_t device, const char *path,
     }
 
   grub_dl_ref (my_mod);
-  
+
   data = grub_xfs_mount (device->disk);
   if (!data)
     goto fail;
-  
+
   grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_xfs_iterate_dir,
                         grub_xfs_read_symlink, GRUB_FSHELP_DIR);
   if (grub_errno)
     goto fail;
 
   grub_xfs_iterate_dir (fdiro, iterate);
-  
+
  fail:
   if (fdiro != &data->diropen)
     grub_free (fdiro);
@@ -671,25 +671,25 @@ grub_xfs_open (struct grub_file *file, const char *name)
 {
   struct grub_xfs_data *data;
   struct grub_fshelp_node *fdiro = 0;
-  
+
   grub_dl_ref (my_mod);
-  
+
   data = grub_xfs_mount (file->device->disk);
   if (!data)
     goto fail;
-  
+
   grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_xfs_iterate_dir,
                         grub_xfs_read_symlink, GRUB_FSHELP_REG);
   if (grub_errno)
     goto fail;
-  
+
   if (!fdiro->inode_read)
     {
       grub_xfs_read_inode (data, fdiro->ino, &fdiro->inode);
       if (grub_errno)
        goto fail;
     }
-  
+
   grub_memcpy (data->inode,
               &fdiro->inode,
               sizeof (struct grub_xfs_inode));
@@ -705,7 +705,7 @@ grub_xfs_open (struct grub_file *file, const char *name)
   if (fdiro != &data->diropen)
     grub_free (fdiro);
   grub_free (data);
-  
+
   grub_dl_unref (my_mod);
 
   return grub_errno;
@@ -715,7 +715,7 @@ grub_xfs_open (struct grub_file *file, const char *name)
 static grub_ssize_t
 grub_xfs_read (grub_file_t file, char *buf, grub_size_t len)
 {
-  struct grub_xfs_data *data = 
+  struct grub_xfs_data *data =
     (struct grub_xfs_data *) file->data;
 
   return grub_xfs_read_file (&data->diropen, file->read_hook,
index 05ecc966261e42d551aba8f5ab6b27f74c8a027c..36f40201cc2924be495d2b792aa91bbfa782dd07 100644 (file)
--- a/genmk.rb
+++ b/genmk.rb
@@ -52,7 +52,7 @@ class Image
     objs_str = objs.join(' ')
     deps = objs.collect {|obj| obj.suffix('d')}
     deps_str = deps.join(' ')
-    
+
     "CLEANFILES += #{@name} #{exe} #{objs_str}
 MOSTLYCLEANFILES += #{deps_str}
 
@@ -79,7 +79,7 @@ endif
       flag = if /\.c$/ =~ src then 'CFLAGS' else 'ASFLAGS' end
       extra_flags = if /\.S$/ =~ src then '-DASM_FILE=1' else '' end
       dir = File.dirname(src)
-      
+
       "#{obj}: #{src} $(#{src}_DEPENDENCIES)
        $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $<
 -include #{dep}
@@ -113,7 +113,7 @@ class PModule
     undsym = 'und-' + @name.suffix('lst')
     mod_name = File.basename(@name, '.mod')
     symbolic_name = mod_name.sub(/\.[^\.]*$/, '')
-    
+
     "CLEANFILES += #{@name} #{mod_obj} #{mod_src} #{pre_obj} #{objs_str} #{undsym}
 ifneq ($(#{prefix}_EXPORTS),no)
 CLEANFILES += #{defsym}
@@ -304,7 +304,7 @@ class Script
     end
     src = sources[0]
     if /\.in$/ !~ src
-      raise "unknown source file `#{src}'" 
+      raise "unknown source file `#{src}'"
     end
 
     "CLEANFILES += #{@name}
@@ -340,7 +340,7 @@ while l = gets
   cont = (/\\$/ =~ l)
   unless cont
     str.gsub!(/\\\n/, ' ')
-    
+
     if /^([a-zA-Z0-9_]+)\s*\+?=\s*(.*?)\s*$/ =~ str
       var, args = $1, $2
 
@@ -357,7 +357,7 @@ while l = gets
          pmodules += args.split(/\s+/).collect do |pmod|
            PModule.new(prefix, pmod)
          end
-         
+
        when 'UTILITIES'
          utils += args.split(/\s+/).collect do |util|
            Utility.new(prefix, util)
@@ -387,10 +387,10 @@ while l = gets
          end
        end
       end
-      
+
     end
-    
+
   end
-  
+
 end
 
index 5b9bc621d6594b6b8fbe279ae971d82a9be87df5..f7f085e99018d6782df9554c8a3c894b6147aa3f 100644 (file)
@@ -40,7 +40,7 @@ FNR == 1 {
 END {
   if (error == 1)
     exit 1;
-  
+
   for (mod in modtab) {
     # Remove duplications.
     split(modtab[mod], depmods, " ");
index 26a84f8bf696d39a0d5c9edd99f4a09dc04d16bc..7933db8241646197b09376875fb49ccbace5f5ce 100644 (file)
@@ -50,7 +50,7 @@ struct grub_acpi_table_header
   grub_uint8_t oemtable[8];
   grub_uint32_t oemrev;
   grub_uint8_t creator_id[4];
-  grub_uint32_t creator_rev;  
+  grub_uint32_t creator_rev;
 } __attribute__ ((packed));
 
 struct grub_acpi_fadt
index f9c552a9ff790792eeaa6d11a5906d2a12e53009..4acd43965b46c1f6b36ded8775e9d61b218c5767 100644 (file)
@@ -65,8 +65,8 @@ static inline grub_err_t grub_autoefi_prepare (void)
 # define SYSTEM_TABLE_SIZEOF GRUB_EFIEMU_SYSTEM_TABLE_SIZEOF
 # define SYSTEM_TABLE_VAR GRUB_EFIEMU_SYSTEM_TABLE_VAR
 # define SYSTEM_TABLE_PTR GRUB_EFIEMU_SYSTEM_TABLE_PTR
-# define SIZEOF_OF_UINTN GRUB_EFIEMU_SIZEOF_OF_UINTN 
-# define SYSTEM_TABLE GRUB_EFIEMU_SYSTEM_TABLE 
+# define SIZEOF_OF_UINTN GRUB_EFIEMU_SIZEOF_OF_UINTN
+# define SYSTEM_TABLE GRUB_EFIEMU_SYSTEM_TABLE
 # define grub_efi_allocate_pages(x,y) (x)
 # define grub_efi_free_pages(x,y) GRUB_EFI_SUCCESS
 # define EFI_PRESENT 1
index f4bdae252a94042e326d76d85c4337df9306d740..2dbba55e223199683c3b45a71a94a0b5b6c3eb65 100644 (file)
@@ -41,7 +41,7 @@ grub_err_t grub_set_datetime (struct grub_datetime *datetime);
 int grub_get_weekday (struct grub_datetime *datetime);
 char *grub_get_weekday_name (struct grub_datetime *datetime);
 
-void grub_unixtime2datetime (grub_int32_t nix, 
+void grub_unixtime2datetime (grub_int32_t nix,
                             struct grub_datetime *datetime);
 
 
index efec0dd494d8337aa2dfd73c34baeb0dd3c42f6d..a0cc6427d4b9db9dacb1148ad1252b0e0900d7cf 100644 (file)
@@ -56,7 +56,7 @@ struct grub_disk_dev
 
   /* The device id used by the cache manager.  */
   unsigned long id;
-  
+
   /* Call HOOK with each device name, until HOOK returns non-zero.  */
   int (*iterate) (int (*hook) (const char *name));
 
@@ -102,7 +102,7 @@ struct grub_disk
 
   /* The id used by the disk cache manager.  */
   unsigned long id;
-  
+
   /* The partition information. This is machine-specific.  */
   struct grub_partition *partition;
 
index 432266bdfce0b5177794a0fd63f87c4264f2a8a8..e870eab410156edce9c67a10f5635a716ab9895c 100644 (file)
@@ -662,38 +662,38 @@ typedef struct grub_efi_table_header grub_efi_table_header_t;
 struct grub_efi_boot_services
 {
   grub_efi_table_header_t hdr;
-  
+
   grub_efi_tpl_t
   (*raise_tpl) (grub_efi_tpl_t new_tpl);
-  
+
   void
   (*restore_tpl) (grub_efi_tpl_t old_tpl);
-  
+
   grub_efi_status_t
   (*allocate_pages) (grub_efi_allocate_type_t type,
                     grub_efi_memory_type_t memory_type,
                     grub_efi_uintn_t pages,
                     grub_efi_physical_address_t *memory);
-  
+
   grub_efi_status_t
   (*free_pages) (grub_efi_physical_address_t memory,
                 grub_efi_uintn_t pages);
-  
+
   grub_efi_status_t
   (*get_memory_map) (grub_efi_uintn_t *memory_map_size,
                     grub_efi_memory_descriptor_t *memory_map,
                     grub_efi_uintn_t *map_key,
                     grub_efi_uintn_t *descriptor_size,
                     grub_efi_uint32_t *descriptor_version);
-  
+
   grub_efi_status_t
   (*allocate_pool) (grub_efi_memory_type_t pool_type,
                    grub_efi_uintn_t size,
                    void **buffer);
-  
+
   grub_efi_status_t
   (*free_pool) (void *buffer);
-  
+
   grub_efi_status_t
   (*create_event) (grub_efi_uint32_t type,
                   grub_efi_tpl_t notify_tpl,
@@ -706,7 +706,7 @@ struct grub_efi_boot_services
   (*set_timer) (grub_efi_event_t event,
                grub_efi_timer_delay_t type,
                grub_efi_uint64_t trigger_time);
-  
+
    grub_efi_status_t
    (*wait_for_event) (grub_efi_uintn_t num_events,
                      grub_efi_event_t *event,
@@ -714,10 +714,10 @@ struct grub_efi_boot_services
 
   grub_efi_status_t
   (*signal_event) (grub_efi_event_t event);
-  
+
   grub_efi_status_t
   (*close_event) (grub_efi_event_t event);
-  
+
   grub_efi_status_t
   (*check_event) (grub_efi_event_t event);
 
@@ -726,13 +726,13 @@ struct grub_efi_boot_services
                                  grub_efi_guid_t *protocol,
                                  grub_efi_interface_type_t interface_type,
                                  void *interface);
-  
+
   grub_efi_status_t
   (*reinstall_protocol_interface) (grub_efi_handle_t handle,
                                   grub_efi_guid_t *protocol,
                                   void *old_interface,
                                   void *new_interface);
-  
+
   grub_efi_status_t
   (*uninstall_protocol_interface) (grub_efi_handle_t handle,
                                   grub_efi_guid_t *protocol,
@@ -742,9 +742,9 @@ struct grub_efi_boot_services
   (*handle_protocol) (grub_efi_handle_t handle,
                      grub_efi_guid_t *protocol,
                      void **interface);
-  
+
   void *reserved;
-  
+
   grub_efi_status_t
   (*register_protocol_notify) (grub_efi_guid_t *protocol,
                               grub_efi_event_t event,
@@ -874,7 +874,7 @@ struct grub_efi_runtime_services
 {
   grub_efi_table_header_t hdr;
 
-  grub_efi_status_t 
+  grub_efi_status_t
   (*get_time) (grub_efi_time_t *time,
               grub_efi_time_capabilities_t *capabilities);
 
@@ -944,11 +944,11 @@ struct grub_efi_simple_input_interface
   grub_efi_status_t
   (*reset) (struct grub_efi_simple_input_interface *this,
            grub_efi_boolean_t extended_verification);
-  
+
   grub_efi_status_t
   (*read_key_stroke) (struct grub_efi_simple_input_interface *this,
                      grub_efi_input_key_t *key);
-  
+
   grub_efi_event_t wait_for_key;
 };
 typedef struct grub_efi_simple_input_interface grub_efi_simple_input_interface_t;
@@ -973,7 +973,7 @@ struct grub_efi_simple_text_output_interface
                 grub_efi_uintn_t *columns,
                 grub_efi_uintn_t *rows);
 
-  grub_efi_status_t 
+  grub_efi_status_t
   (*set_mode) (struct grub_efi_simple_text_output_interface *this,
               grub_efi_uintn_t mode_number);
 
@@ -992,7 +992,7 @@ struct grub_efi_simple_text_output_interface
   grub_efi_status_t
   (*enable_cursor) (struct grub_efi_simple_text_output_interface *this,
                    grub_efi_boolean_t visible);
-  
+
   grub_efi_simple_text_output_mode_t *mode;
 };
 typedef struct grub_efi_simple_text_output_interface grub_efi_simple_text_output_interface_t;
index e1ac47cef50f6faad16c5093e3aa8014973155a9..e5ea58d6762364451d4a189d9fffdfc9db5eb3e5 100644 (file)
 #define GRUB_MACHINE_MEMORY_NVS         4
 #define GRUB_MACHINE_MEMORY_CODE        5
 #define GRUB_MACHINE_MEMORY_MAX_TYPE   5
-  /* This one is special: it's used internally but is never reported 
+  /* This one is special: it's used internally but is never reported
      by firmware. */
 #define GRUB_MACHINE_MEMORY_HOLE       6
 
 
-grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate) 
+grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate)
 (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
-grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size, 
+grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size,
                                       int type, int handle);
 grub_err_t grub_machine_mmap_unregister (int handle);
 
index 15de7906e13c78961ea8447cf0479c9aaf45ab71..4fb8d098cf8a7db1530c613125bc475ba33c7ca4 100644 (file)
@@ -98,7 +98,7 @@ struct grub_pe32_optional_header
   grub_uint32_t bss_size;
   grub_uint32_t entry_addr;
   grub_uint32_t code_base;
-  
+
 #if GRUB_TARGET_SIZEOF_VOID_P == 4
   grub_uint32_t data_base;
   grub_uint32_t image_base;
@@ -139,7 +139,7 @@ struct grub_pe32_optional_header
 
   grub_uint32_t loader_flags;
   grub_uint32_t num_data_directories;
-  
+
   /* Data directories.  */
   struct grub_pe32_data_directory export_table;
   struct grub_pe32_data_directory import_table;
@@ -210,7 +210,7 @@ struct grub_pe32_header
 {
   /* This should be filled in with GRUB_PE32_MSDOS_STUB.  */
   grub_uint8_t msdos_stub[GRUB_PE32_MSDOS_STUB_SIZE];
-  
+
   /* This is always PE\0\0.  */
   char signature[4];
 
index 78373e4e1eb10b4ae6618af95f7771e0b20fe58e..ed934a228842b333a849e43d23d5dc826d4e6c24 100644 (file)
@@ -155,10 +155,10 @@ grub_err_t grub_efiemu_loadcore_init32 (void *core, grub_size_t core_size,
                                        grub_efiemu_segment_t *segments);
 grub_err_t grub_efiemu_loadcore_init64 (void *core, grub_size_t core_size,
                                        grub_efiemu_segment_t *segments);
-grub_err_t grub_efiemu_loadcore_load32 (void *core, 
+grub_err_t grub_efiemu_loadcore_load32 (void *core,
                                        grub_size_t core_size,
                                        grub_efiemu_segment_t segments);
-grub_err_t grub_efiemu_loadcore_load64 (void *core, 
+grub_err_t grub_efiemu_loadcore_load64 (void *core,
                                        grub_size_t core_size,
                                        grub_efiemu_segment_t segments);
 grub_err_t grub_efiemu_loadcore_unload32 (void);
@@ -189,14 +189,14 @@ struct grub_efiemu_configuration_table64
 } __attribute__ ((packed));
 typedef struct grub_efiemu_configuration_table32 grub_efiemu_configuration_table64_t;
 grub_err_t grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid);
-grub_err_t 
-grub_efiemu_register_configuration_table (grub_efi_guid_t guid, 
+grub_err_t
+grub_efiemu_register_configuration_table (grub_efi_guid_t guid,
                                          void * (*get_table) (void *data),
-                                         void (*unload) (void *data), 
+                                         void (*unload) (void *data),
                                          void *data);
 
 /* Memory management functions */
-int grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, 
+int grub_efiemu_request_memalign (grub_size_t align, grub_size_t size,
                                  grub_efi_memory_type_t type);
 void *grub_efiemu_mm_obtain_request (int handle);
 int grub_efiemu_get_memory_map (grub_efi_uintn_t *memory_map_size,
@@ -218,8 +218,8 @@ int grub_efiemu_get_memory_map (grub_efi_uintn_t *memory_map_size,
                                grub_efi_uintn_t *descriptor_size,
                                grub_efi_uint32_t *descriptor_version);
 grub_err_t
-grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, 
-                                                       grub_uint64_t, 
+grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
+                                                       grub_uint64_t,
                                                        grub_uint32_t));
 int grub_efiemu_sizeof_uintn_t (void);
 int grub_efiemu_exit_boot_services (grub_efi_uintn_t map_key);
@@ -242,30 +242,30 @@ struct grub_efiemu_prepare_hook
   void (*unload) (void *data);
   void *data;
 };
-grub_err_t grub_efiemu_prepare32 (struct grub_efiemu_prepare_hook 
+grub_err_t grub_efiemu_prepare32 (struct grub_efiemu_prepare_hook
                                  *prepare_hooks,
-                                 struct grub_efiemu_configuration_table 
+                                 struct grub_efiemu_configuration_table
                                  *config_tables);
-grub_err_t grub_efiemu_prepare64 (struct grub_efiemu_prepare_hook 
+grub_err_t grub_efiemu_prepare64 (struct grub_efiemu_prepare_hook
                                  *prepare_hooks,
-                                 struct grub_efiemu_configuration_table 
+                                 struct grub_efiemu_configuration_table
                                  *config_tables);
 grub_err_t grub_efiemu_unload (void);
 grub_err_t grub_efiemu_prepare (void);
 grub_err_t
 grub_efiemu_register_prepare_hook (grub_err_t (*hook) (void *data),
-                                  void (*unload) (void *data), 
+                                  void (*unload) (void *data),
                                   void *data);
 
 /* symbols and pointers */
 grub_err_t grub_efiemu_alloc_syms (void);
 grub_err_t grub_efiemu_request_symbols (int num);
-grub_err_t grub_efiemu_resolve_symbol (const char *name, 
+grub_err_t grub_efiemu_resolve_symbol (const char *name,
                                       int *handle, grub_off_t *off);
-grub_err_t grub_efiemu_register_symbol (const char *name, 
+grub_err_t grub_efiemu_register_symbol (const char *name,
                                        int handle, grub_off_t off);
 void grub_efiemu_free_syms (void);
-grub_err_t grub_efiemu_write_value (void * addr, grub_uint32_t value, 
+grub_err_t grub_efiemu_write_value (void * addr, grub_uint32_t value,
                                    int plus_handle,
                                    int minus_handle, int ptv_needed, int size);
 grub_err_t grub_efiemu_pnvram (void);
index fa2c07096f786bcb1aee5a3e3bcb8aac8075cb80..41732e48d28dd633b06cf1cfddc98e194c5a570b 100644 (file)
@@ -43,18 +43,18 @@ struct grub_fs
 
   /* Call HOOK with each file under DIR.  */
   grub_err_t (*dir) (grub_device_t device, const char *path,
-                    int (*hook) (const char *filename, 
+                    int (*hook) (const char *filename,
                                  const struct grub_dirhook_info *info));
-  
+
   /* Open a file named NAME and initialize FILE.  */
   grub_err_t (*open) (struct grub_file *file, const char *name);
-  
+
   /* Read LEN bytes data from FILE into BUF.  */
   grub_ssize_t (*read) (struct grub_file *file, char *buf, grub_size_t len);
-  
+
   /* Close the file FILE.  */
   grub_err_t (*close) (struct grub_file *file);
-  
+
   /* Return the label of the device DEVICE in LABEL.  The label is
      returned in a grub_malloc'ed buffer and should be freed by the
      caller.  */
index 311b998f6a1cf3142f06ca45544208560ebc895f..08b947ccb28c6f85563514aaa0192962e8e1553e 100644 (file)
@@ -47,7 +47,7 @@ struct grub_hfs_sblock
 
   /* A pascal style string that holds the volumename.  */
   grub_uint8_t volname[28];
-  
+
   grub_uint8_t unused5[60];
   grub_uint16_t embed_sig;
   struct grub_hfs_extent embed_extent;
index 1b29f459fc660b76b796a82594d19bf01deedcfd..edb13ff37766b85c7f0badd135482475cf930817 100644 (file)
 #define GRUB_ARCH_EFI_EMU_HEADER       1
 
 grub_err_t
-grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, 
+grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs,
                                     struct grub_efiemu_elf_sym *elfsyms,
                                     void *ehdr);
 grub_err_t
-grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, 
+grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs,
                                     struct grub_efiemu_elf_sym *elfsyms,
                                     void *ehdr);
 
index 70eba1da7c793c1d505eb93b3f348b7e9c07dae1..1e601955cfef5c24f74c3a2347439c1588dd28e0 100644 (file)
@@ -83,7 +83,7 @@ struct grub_e820_mmap
 
 /* For the Linux/i386 boot protocol version 2.03.  */
 struct linux_kernel_header
-{ 
+{
   grub_uint8_t code1[0x0020];
   grub_uint16_t cl_magic;              /* Magic number 0xA33F */
   grub_uint16_t cl_offset;             /* The offset of command line */
@@ -135,21 +135,21 @@ struct linux_kernel_params
   grub_uint8_t video_cursor_y;
 
   grub_uint16_t ext_mem;               /* 2 */
-  
+
   grub_uint16_t video_page;            /* 4 */
   grub_uint8_t video_mode;             /* 6 */
   grub_uint8_t video_width;            /* 7 */
-  
+
   grub_uint8_t padding1[0xa - 0x8];
-  
+
   grub_uint16_t video_ega_bx;          /* a */
-  
+
   grub_uint8_t padding2[0xe - 0xc];
-  
+
   grub_uint8_t video_height;           /* e */
   grub_uint8_t have_vga;               /* f */
   grub_uint16_t font_size;             /* 10 */
-  
+
   grub_uint16_t lfb_width;             /* 12 */
   grub_uint16_t lfb_height;            /* 14 */
   grub_uint16_t lfb_depth;             /* 16 */
@@ -183,16 +183,16 @@ struct linux_kernel_params
   grub_uint16_t apm_flags;             /* 4c */
   grub_uint32_t apm_code_len;          /* 4e */
   grub_uint16_t apm_data_len;          /* 52 */
-  
+
   grub_uint8_t padding4[0x60 - 0x54];
-  
+
   grub_uint32_t ist_signature;         /* 60 */
   grub_uint32_t ist_command;           /* 64 */
   grub_uint32_t ist_event;             /* 68 */
   grub_uint32_t ist_perf_level;                /* 6c */
 
   grub_uint8_t padding5[0x80 - 0x70];
-  
+
   grub_uint8_t hd0_drive_info[0x10];   /* 80 */
   grub_uint8_t hd1_drive_info[0x10];   /* 90 */
   grub_uint16_t rom_config_len;                /* a0 */
@@ -232,15 +232,15 @@ struct linux_kernel_params
           grub_uint32_t efi_mmap_hi;           /* 1dc */
         } v0206;
     };
-  
+
   grub_uint32_t alt_mem;               /* 1e0 */
-  
+
   grub_uint8_t padding8[0x1e8 - 0x1e4];
-  
+
   grub_uint32_t mmap_size;             /* 1e8 */
 
   grub_uint8_t padding9[0x1f1 - 0x1ec];
-  
+
   grub_uint8_t setup_sects;            /* The size of the setup in sectors */
   grub_uint16_t root_flags;            /* If the root is mounted readonly */
   grub_uint16_t syssize;               /* obsolete */
index 64d4f217f698fd43a898be38f3278297ac64f3fd..b87e0e4334924ec9eda9febc000e184ea4f67502 100644 (file)
@@ -72,7 +72,7 @@ struct grub_biosdisk_drp
   grub_uint8_t device_path[8];
   grub_uint8_t reserved2;
   grub_uint8_t checksum;
-  
+
   /* XXX: This is necessary, because the BIOS of Thinkpad X20
      writes a garbage to the tail of drive parameters,
      regardless of a size specified in a caller.  */
index c95eae0ce831d87dab19a2a537fb63ee08224a46..d7910ab1574d5d2a82f85062006fc92e7b08320d 100644 (file)
@@ -90,7 +90,7 @@ struct grub_machine_mmap_entry
 #define GRUB_MACHINE_MEMORY_ACPI       3
 #define GRUB_MACHINE_MEMORY_NVS        4
 #define GRUB_MACHINE_MEMORY_MAX_TYPE   4
-  /* This one is special: it's used internally but is never reported 
+  /* This one is special: it's used internally but is never reported
      by firmware. */
 #define GRUB_MACHINE_MEMORY_HOLE       5
 
@@ -107,19 +107,19 @@ grub_uint64_t grub_mmap_get_lower (void);
 #define GRUB_MMAP_MALLOC_LOW 1
 
 #ifdef GRUB_MACHINE_PCBIOS
-grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size, 
+grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size,
                                       int type, int handle);
 grub_err_t grub_machine_mmap_unregister (int handle);
 #else
-static inline grub_err_t 
-grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), 
-                           grub_uint64_t size __attribute__ ((unused)), 
-                           int type __attribute__ ((unused)), 
+static inline grub_err_t
+grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)),
+                           grub_uint64_t size __attribute__ ((unused)),
+                           int type __attribute__ ((unused)),
                            int handle __attribute__ ((unused)))
 {
   return GRUB_ERR_NONE;
 }
-static inline grub_err_t 
+static inline grub_err_t
 grub_machine_mmap_unregister (int handle  __attribute__ ((unused)))
 {
   return GRUB_ERR_NONE;
index 9a8cb954dff50bcf7066ff74e4886f0626e75e7c..bd6ecd7e4e097bfd93c08729f7291d58b5180bf6 100644 (file)
@@ -143,9 +143,9 @@ struct grub_vbe_mode_info_block
   grub_uint8_t lin_rsvd_field_position;
   grub_uint32_t max_pixel_clock;
 
-  /* Reserved field to make structure to be 256 bytes long, VESA BIOS 
-     Extension 3.0 Specification says to reserve 189 bytes here but 
-     that doesn't make structure to be 256 bytes.  So additional one is 
+  /* Reserved field to make structure to be 256 bytes long, VESA BIOS
+     Extension 3.0 Specification says to reserve 189 bytes here but
+     that doesn't make structure to be 256 bytes.  So additional one is
      added here.  */
   grub_uint8_t reserved4[189 + 1];
 } __attribute__ ((packed));
index aa4014575acedde4cfaec2d483cb5f152e2ac961..46041c2b244c7beaffdfad1f99254cf3c7166456 100644 (file)
@@ -41,7 +41,7 @@ grub_get_tsc (void)
                        "pop %%rbx\n"
 #else
                        "pop %%ebx\n"
-#endif 
+#endif
                        :::"%rax", "%rcx", "%rdx");
 #else
   __asm__ __volatile__ ("xorl %%eax, %%eax\n\t"
index c4c10b0f4ba46fc72499d2fd8ab2aef782ba4383..ebc38eb61edb01fe93979f4af08d5ece582dc414 100644 (file)
@@ -6,22 +6,22 @@ typedef grub_uint32_t grub_xnu_ptr_t;
 
 struct grub_xnu_boot_params
 {
-  grub_uint16_t verminor; 
-  grub_uint16_t vermajor; 
+  grub_uint16_t verminor;
+  grub_uint16_t vermajor;
   /* Command line passed to xnu. */
-  grub_uint8_t cmdline[1024]; 
+  grub_uint8_t cmdline[1024];
 
   /* Later are the same as EFI's get_memory_map (). */
-  grub_xnu_ptr_t efi_mmap;               
-  grub_uint32_t efi_mmap_size;          
-  grub_uint32_t efi_mem_desc_size;      
-  grub_uint32_t efi_mem_desc_version;   
+  grub_xnu_ptr_t efi_mmap;
+  grub_uint32_t efi_mmap_size;
+  grub_uint32_t efi_mem_desc_size;
+  grub_uint32_t efi_mem_desc_version;
 
   /* Later are video parameters. */
   grub_xnu_ptr_t lfb_base;
 #define GRUB_XNU_VIDEO_SPLASH 1
 #define GRUB_XNU_VIDEO_TEXT_IN_VIDEO 2
-  grub_uint32_t lfb_mode; 
+  grub_uint32_t lfb_mode;
   grub_uint32_t lfb_line_len;
   grub_uint32_t lfb_width;
   grub_uint32_t lfb_height;
@@ -30,12 +30,12 @@ struct grub_xnu_boot_params
   /* Pointer to device tree and its len. */
   grub_xnu_ptr_t devtree;
   grub_uint32_t devtreelen;
-  
+
   /* First used address by kernel or boot structures. */
   grub_xnu_ptr_t heap_start;
-  /* Last used address by kernel or boot structures minus previous value. */  
+  /* Last used address by kernel or boot structures minus previous value. */
   grub_uint32_t heap_size;
-  
+
   /* First memory page containing runtime code or data. */
   grub_uint32_t efi_runtime_first_page;
   /* First memory page containing runtime code or data minus previous value. */
index 751055fc136052fa16bd7af82704fce9f24c20aa..818046fa07a87ba290ed3de87177a7e1498c7b26 100644 (file)
@@ -33,7 +33,7 @@ struct grub_ieee1275_devalias
   char *type;
 };
 
-struct grub_ieee1275_mem_region 
+struct grub_ieee1275_mem_region
 {
   unsigned int start;
   unsigned int size;
@@ -46,9 +46,9 @@ struct grub_ieee1275_mem_region
 #define IEEE1275_CALL_ENTRY_FN(args) (*grub_ieee1275_entry_fn) (args)
 #endif
 
-/* All backcalls to the firmware is done by calling an entry function 
-   which was passed to us from the bootloader.  When doing the backcall, 
-   a structure is passed which specifies what the firmware should do.  
+/* All backcalls to the firmware is done by calling an entry function
+   which was passed to us from the bootloader.  When doing the backcall,
+   a structure is passed which specifies what the firmware should do.
    NAME is the requested service.  NR_INS and NR_OUTS is the number of
    passed arguments and the expected number of return values, resp. */
 struct grub_ieee1275_common_hdr
@@ -122,14 +122,14 @@ int EXPORT_FUNC(grub_ieee1275_get_integer_property) (grub_ieee1275_phandle_t pha
                                                     grub_ssize_t *actual);
 int EXPORT_FUNC(grub_ieee1275_next_property) (grub_ieee1275_phandle_t phandle,
                                              char *prev_prop, char *prop);
-int EXPORT_FUNC(grub_ieee1275_get_property_length) 
+int EXPORT_FUNC(grub_ieee1275_get_property_length)
      (grub_ieee1275_phandle_t phandle, const char *prop, grub_ssize_t *length);
-int EXPORT_FUNC(grub_ieee1275_instance_to_package) 
+int EXPORT_FUNC(grub_ieee1275_instance_to_package)
      (grub_ieee1275_ihandle_t ihandle, grub_ieee1275_phandle_t *phandlep);
 int EXPORT_FUNC(grub_ieee1275_package_to_path) (grub_ieee1275_phandle_t phandle,
                                                char *path, grub_size_t len,
                                                grub_ssize_t *actual);
-int EXPORT_FUNC(grub_ieee1275_instance_to_path) 
+int EXPORT_FUNC(grub_ieee1275_instance_to_path)
      (grub_ieee1275_ihandle_t ihandle, char *path, grub_size_t len,
       grub_ssize_t *actual);
 int EXPORT_FUNC(grub_ieee1275_write) (grub_ieee1275_ihandle_t ihandle,
index dd91cc6726c018ddb1b50f52badf65af1ea08bf1..a4bf3b28846e1312952140eb0ae8ff893c0aeefa 100644 (file)
@@ -121,7 +121,7 @@ struct grub_lvm_mda_header {
   grub_uint32_t version;
   grub_uint64_t start;         /* Absolute start byte of mda_header */
   grub_uint64_t size;          /* Size of metadata area */
-  
+
   struct grub_lvm_raw_locn raw_locns[0];       /* NULL-terminated list */
 } __attribute__ ((packed));
 
index 7dfd54e2e37b2a2a1d96fc3ac8a48c73016e0914..0463d3753f2a9786b74a55fe9db7595630e0c4c5 100644 (file)
@@ -73,7 +73,7 @@ union grub_macho_filestart
 {
   struct grub_macho_fat_header fat;
   struct grub_macho_header32 thin32;
-  struct grub_macho_header64 thin64;  
+  struct grub_macho_header64 thin64;
 } __attribute__ ((packed));
 
 /* Common header of Mach-O commands. */
index 572496fd38fdb7996925a1e6220b5554bfc54afa..a80bac68cbcead0455f134793b41ab322c111ce2 100644 (file)
@@ -54,7 +54,7 @@ grub_uint32_t grub_macho32_get_entry_point (grub_macho_t macho);
 #define GRUB_MACHO_NOBSS 0x1
 grub_err_t grub_macho32_load (grub_macho_t macho, char *offset, int flags);
 
-/* Like filesize and file_read but take only 32-bit part 
+/* Like filesize and file_read but take only 32-bit part
    for current architecture. */
 grub_size_t grub_macho32_filesize (grub_macho_t macho);
 grub_err_t grub_macho32_readfile (grub_macho_t macho, void *dest);
index f7fe2becac250dee9448fbd795d6348dd28d0e68..43f90e1dd26a96249ca8e4dbf33136974e9d30bd 100644 (file)
@@ -24,8 +24,8 @@
 #include <grub/err.h>
 #include <grub/machine/memory.h>
 
-grub_err_t grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, 
-                                                           grub_uint64_t, 
+grub_err_t grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
+                                                           grub_uint64_t,
                                                            grub_uint32_t));
 int grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type);
 grub_err_t grub_mmap_unregister (int handle);
index 5285ea2f59a7266cc82a41f959312b6d87f30235..2cb00a06d9958416368e653ec044851586bcbcb8 100644 (file)
@@ -30,7 +30,7 @@ void grub_module (int argc, char *argv[]);
 #include <grub/types.h>
 
 struct grub_multiboot_header
-{ 
+{
   /* Must be MULTIBOOT_MAGIC - see above.  */
   grub_uint32_t magic;
 
@@ -39,7 +39,7 @@ struct grub_multiboot_header
 
   /* The above fields plus this one must equal 0 mod 2^32. */
   grub_uint32_t checksum;
-  
+
   /* These are only valid if MULTIBOOT_AOUT_KLUDGE is set.  */
   grub_uint32_t header_addr;
   grub_uint32_t load_addr;
@@ -58,34 +58,34 @@ struct grub_multiboot_info
 {
   /* Multiboot info version number */
   grub_uint32_t flags;
-  
+
   /* Available memory from BIOS */
   grub_uint32_t mem_lower;
   grub_uint32_t mem_upper;
-  
+
   /* "root" partition */
   grub_uint32_t boot_device;
-  
+
   /* Kernel command line */
   grub_uint32_t cmdline;
-  
+
   /* Boot-Module list */
   grub_uint32_t mods_count;
   grub_uint32_t mods_addr;
-  
+
   grub_uint32_t syms[4];
-  
+
   /* Memory Mapping buffer */
   grub_uint32_t mmap_length;
   grub_uint32_t mmap_addr;
-  
+
   /* Drive Info buffer */
   grub_uint32_t drives_length;
   grub_uint32_t drives_addr;
-  
+
   /* ROM configuration table */
   grub_uint32_t config_table;
-  
+
   /* Boot Loader Name */
   grub_uint32_t boot_loader_name;
 
@@ -116,10 +116,10 @@ struct grub_mod_list
   /* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
   grub_uint32_t mod_start;
   grub_uint32_t mod_end;
-  
+
   /* Module command line */
   grub_uint32_t cmdline;
-  
+
   /* padding to take it to 16 bytes (must be zero) */
   grub_uint32_t pad;
 };
index 0d53f8ff7239b3a7278b32756d03b24911b42eb2..69d9393447f425bd39adbee860edab548e93e738 100644 (file)
@@ -35,19 +35,19 @@ struct multiboot_tag_header;
 grub_err_t
 grub_mb2_tag_alloc (grub_addr_t *addr, int key, grub_size_t len);
 
-grub_err_t 
+grub_err_t
 grub_mb2_tags_arch_create (void);
 
-void 
+void
 grub_mb2_arch_boot (grub_addr_t entry, void *tags);
 
-void 
+void
 grub_mb2_arch_unload (struct multiboot_tag_header *tags);
 
 grub_err_t
 grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, grub_addr_t *addr);
 
-grub_err_t 
+grub_err_t
 grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr, grub_addr_t *addr);
 
 grub_err_t
@@ -56,10 +56,10 @@ grub_mb2_arch_module_alloc (grub_size_t size, grub_addr_t *addr);
 grub_err_t
 grub_mb2_arch_module_free (grub_addr_t addr, grub_size_t size);
 
-void 
+void
 grub_multiboot2 (int argc, char *argv[]);
 
-void 
+void
 grub_module2 (int argc, char *argv[]);
 
 #define for_each_tag(tag, tags) \
index 2eac431cc9f2c284a0aa863b36fe73d2c4f370b6..c6d71d5b62834f4273cad0922789ae35ef0a50d3 100644 (file)
@@ -49,7 +49,7 @@ struct grub_net
 {
   /* The net name.  */
   const char *name;
-  
+
   /* The underlying disk device.  */
   grub_net_dev_t dev;
 
@@ -58,7 +58,7 @@ struct grub_net
 
   /* FIXME: More data would be required, such as an IP address, a mask,
      a gateway, etc.  */
-  
+
   /* Device-specific data.  */
   void *data;
 };
index 6e74cd5060af75839e6768113a708a34b029aca9..37c5f24036c2b1bb1d0b5f6f1e352ebb763b5054 100644 (file)
@@ -30,19 +30,19 @@ struct grub_partition_map
 {
   /* The name of the partition map type.  */
   const char *name;
-  
+
   /* Call HOOK with each partition, until HOOK returns non-zero.  */
   grub_err_t (*iterate) (struct grub_disk *disk,
                         int (*hook) (struct grub_disk *disk,
                                      const grub_partition_t partition));
-  
+
   /* Return the partition named STR on the disk DISK.  */
   grub_partition_t (*probe) (struct grub_disk *disk,
                             const char *str);
-  
+
   /* Return the name of the partition PARTITION.  */
   char *(*get_name) (const grub_partition_t partition);
-  
+
   /* The next partition map type.  */
   struct grub_partition_map *next;
 };
@@ -62,10 +62,10 @@ struct grub_partition
 
   /* The index of this partition in the partition table.  */
   int index;
-  
+
   /* Partition map type specific data.  */
   void *data;
-  
+
   /* The type partition map.  */
   grub_partition_map_t partmap;
 };
@@ -78,7 +78,7 @@ int EXPORT_FUNC(grub_partition_iterate) (struct grub_disk *disk,
 char *EXPORT_FUNC(grub_partition_get_name) (const grub_partition_t partition);
 
 int EXPORT_FUNC(grub_partition_map_iterate) (int (*hook) (const grub_partition_map_t partmap));
-                                             
+
 void EXPORT_FUNC(grub_partition_map_register) (grub_partition_map_t partmap);
 
 void EXPORT_FUNC(grub_partition_map_unregister) (grub_partition_map_t partmap);
index 0e05f4cc5a33d582dcf95f3068882c3bf03dfdfb..8291e1161472b5eafd6105fed9393e839b355c81 100644 (file)
@@ -23,7 +23,7 @@ struct grub_parttool_argdesc
 {
   char *name;
   char *desc;
-  enum {GRUB_PARTTOOL_ARG_END, GRUB_PARTTOOL_ARG_BOOL, GRUB_PARTTOOL_ARG_VAL} 
+  enum {GRUB_PARTTOOL_ARG_END, GRUB_PARTTOOL_ARG_BOOL, GRUB_PARTTOOL_ARG_VAL}
     type;
 };
 
@@ -37,7 +37,7 @@ struct grub_parttool_args
   };
 };
 
-typedef grub_err_t (*grub_parttool_function_t) (const grub_device_t dev, 
+typedef grub_err_t (*grub_parttool_function_t) (const grub_device_t dev,
                                                const struct grub_parttool_args *args);
 
 struct grub_parttool
@@ -50,7 +50,7 @@ struct grub_parttool
   grub_parttool_function_t func;
 };
 
-int grub_parttool_register(const char *part_name, 
+int grub_parttool_register(const char *part_name,
                           const grub_parttool_function_t func,
                           const struct grub_parttool_argdesc *args);
 void grub_parttool_unregister (int handle);
index 3251e36ba5df75da487f8ae68bb61db8af653b75..9ce3be7d185c5fb051b5a37d67cd6b50dc76e7cb 100644 (file)
@@ -151,10 +151,10 @@ struct grub_term_input
 
   /* Clean up the terminal.  */
   grub_err_t (*fini) (void);
-  
+
   /* Check if any input character is available.  */
   int (*checkkey) (void);
-  
+
   /* Get a character.  */
   int (*getkey) (void);
 };
@@ -173,37 +173,37 @@ struct grub_term_output
 
   /* Clean up the terminal.  */
   grub_err_t (*fini) (void);
-  
+
   /* Put a character. C is encoded in Unicode.  */
   void (*putchar) (grub_uint32_t c);
 
   /* Get the number of columns occupied by a given character C. C is
      encoded in Unicode.  */
   grub_ssize_t (*getcharwidth) (grub_uint32_t c);
-  
+
   /* Get the screen size. The return value is ((Width << 8) | Height).  */
   grub_uint16_t (*getwh) (void);
 
   /* Get the cursor position. The return value is ((X << 8) | Y).  */
   grub_uint16_t (*getxy) (void);
-  
+
   /* Go to the position (X, Y).  */
   void (*gotoxy) (grub_uint8_t x, grub_uint8_t y);
-  
+
   /* Clear the screen.  */
   void (*cls) (void);
-  
+
   /* Set the current color to be used */
   void (*setcolorstate) (grub_term_color_state state);
-  
+
   /* Set the normal color and the highlight color. The format of each
      color is VGA's.  */
   void (*setcolor) (grub_uint8_t normal_color, grub_uint8_t highlight_color);
-  
+
   /* Get the normal color and the highlight color. The format of each
      color is VGA's.  */
   void (*getcolor) (grub_uint8_t *normal_color, grub_uint8_t *highlight_color);
-  
+
   /* Turn on/off the cursor.  */
   void (*setcursor) (int on);
 
index 027e7ed3400d7eb8b20cd66bd6bae5a08794cd8a..2f711d7550c6ad9d257594883a68e9ea6dad92ea 100644 (file)
@@ -46,7 +46,7 @@ struct grub_usb_desc_device
   grub_uint8_t strvendor;
   grub_uint8_t strprod;
   grub_uint8_t strserial;
-  grub_uint8_t configcnt;  
+  grub_uint8_t configcnt;
 } __attribute__ ((packed));
 
 struct grub_usb_desc_config
index 3b276553c54bd49df5d5301f5a2807e47216ee6a..c98731ddf6e0a9cdddc563acbade23609f5036ed 100644 (file)
@@ -74,7 +74,7 @@ enum grub_video_blit_format
 
     /* When needed, decode color or just use value as is.  */
     GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR,
-    
+
     /* Two color bitmap; bits packed: rows are not padded to byte boundary.  */
     GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED
   };
index c6b2e88168be26bcd79894d43147727b33dc1f57..c3902e670d02cf08f163820e2297edd7423529f1 100644 (file)
@@ -36,7 +36,7 @@ struct grub_xnu_hibernate_header
   /* %esp at start. */
   grub_uint32_t stack;
   grub_uint8_t unknown2[44];
-#define GRUB_XNU_HIBERNATE_MAGIC 0x73696d65  
+#define GRUB_XNU_HIBERNATE_MAGIC 0x73696d65
   grub_uint32_t magic;
   grub_uint8_t unknown3[28];
   /* This value is non-zero if page is encrypted. Unsupported. */
@@ -51,7 +51,7 @@ struct grub_xnu_hibernate_header
 /* In-memory structure for temporary keeping device tree. */
 struct grub_xnu_devtree_key
 {
-  char *name; 
+  char *name;
   int datasize; /* -1 for not leaves. */
   union
   {
@@ -62,7 +62,7 @@ struct grub_xnu_devtree_key
 };
 
 /* A structure used in memory-map values. */
-struct 
+struct
 grub_xnu_extdesc
 {
   grub_uint32_t addr;
@@ -95,9 +95,9 @@ grub_err_t grub_xnu_resume (char *imagename);
 struct grub_xnu_devtree_key *grub_xnu_find_key (struct grub_xnu_devtree_key *parent,
                                                char *name);
 grub_err_t grub_xnu_align_heap (int align);
-grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired, 
+grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired,
                                        int maxrecursion);
-grub_err_t grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, 
+grub_err_t grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
                                        int maxrecursion);
 void *grub_xnu_heap_malloc (int size);
 extern grub_uint32_t grub_xnu_heap_real_start;
index 2298fa200f2c55c19ca8a8f1177ef4c0661819a3..110ad2f17434c62fdffa9415a54960da3c89b103 100644 (file)
@@ -38,7 +38,7 @@
 /* Alignment of the multiboot info structure.  */
 #define MULTIBOOT_INFO_ALIGN            0x00000004
 
-/* 
+/*
  * Flags set in the 'flags' member of the multiboot header.
  */
 
index 0fada6cc5e2b5b7f3e0833b67b683902d03293a7..f3b71183cd5c1635e3357f8ec2020e91acc374e4 100644 (file)
--- a/io/gzio.c
+++ b/io/gzio.c
@@ -169,7 +169,7 @@ test_header (grub_file_t file)
 
   if (grub_file_tell (gzio->file) != 0)
     grub_file_seek (gzio->file, 0);
-  
+
   /*
    *  This checks if the file is gzipped.  If a problem occurs here
    *  (other than a real error with the disk) then we don't think it
@@ -202,9 +202,9 @@ test_header (grub_file_t file)
     }
 
   gzio->data_offset = grub_file_tell (gzio->file);
-  
+
   grub_file_seek (gzio->file, grub_file_size (gzio->file) - 8);
-  
+
   if (grub_file_read (gzio->file, (char *) buf, 8) != 8)
     {
       grub_error (GRUB_ERR_BAD_FILE_TYPE, "unsupported gzip format");
@@ -362,7 +362,7 @@ static int
 get_byte (grub_file_t file)
 {
   grub_gzio_t gzio = file->data;
-  
+
   if (grub_file_tell (gzio->file) == (grub_off_t) gzio->data_offset
       || gzio->inbuf_d == INBUFSIZ)
     {
@@ -614,7 +614,7 @@ inflate_codes_in_window (grub_file_t file)
   register ulg b;              /* bit buffer */
   register unsigned k;         /* number of bits in bit buffer */
   grub_gzio_t gzio = file->data;
-  
+
   /* make local copies of globals */
   d = gzio->inflate_d;
   n = gzio->inflate_n;
@@ -746,7 +746,7 @@ init_stored_block (grub_file_t file)
   register ulg b;              /* bit buffer */
   register unsigned k;         /* number of bits in bit buffer */
   grub_gzio_t gzio = file->data;
-  
+
   /* make local copies of globals */
   b = gzio->bb;                        /* initialize bit buffer */
   k = gzio->bk;
@@ -780,7 +780,7 @@ init_fixed_block (grub_file_t file)
   int i;                       /* temporary variable */
   unsigned l[288];             /* length list for huft_build */
   grub_gzio_t gzio = file->data;
-  
+
   /* set up literal table */
   for (i = 0; i < 144; i++)
     l[i] = 8;
@@ -836,7 +836,7 @@ init_dynamic_block (grub_file_t file)
   register ulg b;              /* bit buffer */
   register unsigned k;         /* number of bits in bit buffer */
   grub_gzio_t gzio = file->data;
-  
+
   /* make local bit buffer */
   b = gzio->bb;
   k = gzio->bk;
@@ -971,7 +971,7 @@ get_new_block (grub_file_t file)
   register ulg b;              /* bit buffer */
   register unsigned k;         /* number of bits in bit buffer */
   grub_gzio_t gzio = file->data;
-  
+
   /* make local bit buffer */
   b = gzio->bb;
   k = gzio->bk;
@@ -1011,7 +1011,7 @@ static void
 inflate_window (grub_file_t file)
 {
   grub_gzio_t gzio = file->data;
-  
+
   /* initialize window */
   gzio->wp = 0;
 
@@ -1081,7 +1081,7 @@ static void
 initialize_tables (grub_file_t file)
 {
   grub_gzio_t gzio = file->data;
-  
+
   gzio->saved_offset = 0;
   grub_file_seek (gzio->file, gzio->data_offset);
 
@@ -1107,7 +1107,7 @@ grub_gzio_open (grub_file_t io, int transparent)
 {
   grub_file_t file;
   grub_gzio_t gzio = 0;
-  
+
   file = (grub_file_t) grub_malloc (sizeof (*file));
   if (! file)
     return 0;
@@ -1118,10 +1118,10 @@ grub_gzio_open (grub_file_t io, int transparent)
       grub_free (file);
       return 0;
     }
-  
+
   grub_memset (gzio, 0, sizeof (*gzio));
   gzio->file = io;
-  
+
   file->device = io->device;
   file->offset = 0;
   file->data = gzio;
@@ -1142,7 +1142,7 @@ grub_gzio_open (grub_file_t io, int transparent)
       else
        return 0;
     }
-  
+
   return file;
 }
 
@@ -1151,7 +1151,7 @@ grub_file_t
 grub_gzfile_open (const char *name, int transparent)
 {
   grub_file_t io, file;
-  
+
   io = grub_file_open (name);
   if (! io)
     return 0;
@@ -1172,7 +1172,7 @@ grub_gzio_read (grub_file_t file, char *buf, grub_size_t len)
   grub_ssize_t ret = 0;
   grub_gzio_t gzio = file->data;
   grub_off_t offset;
-  
+
   /* Do we reset decompression to the beginning of the file?  */
   if (gzio->saved_offset > file->offset + WSIZE)
     initialize_tables (file);
@@ -1184,7 +1184,7 @@ grub_gzio_read (grub_file_t file, char *buf, grub_size_t len)
    */
 
   offset = file->offset;
-  
+
   while (len > 0 && grub_errno == GRUB_ERR_NONE)
     {
       register grub_size_t size;
@@ -1217,7 +1217,7 @@ static grub_err_t
 grub_gzio_close (grub_file_t file)
 {
   grub_gzio_t gzio = file->data;
-  
+
   grub_file_close (gzio->file);
   huft_free (gzio->tl);
   huft_free (gzio->td);
index 9c189460c9339d31584981d6f2a764af8c078fd9..03944f2df5b3b95f0ba5a1058cee1b0d960c31fe 100644 (file)
@@ -117,7 +117,7 @@ grub_mini_print_devices (const char *name)
 }
 
 static int
-grub_mini_print_files (const char *filename, 
+grub_mini_print_files (const char *filename,
                       const struct grub_dirhook_info *info)
 {
   grub_printf ("%s%s ", filename, info->dir ? "/" : "");
index 184c3a27fd4a53e54568d3338560b53cc3b99389..55c750bfccbff34337ac0662fbe12d56991fd63d 100644 (file)
@@ -41,11 +41,11 @@ grub_device_open (const char *name)
          goto fail;
        }
     }
-    
+
   dev = grub_malloc (sizeof (*dev));
   if (! dev)
     goto fail;
-  
+
   /* Try to open a disk.  */
   disk = grub_disk_open (name);
   if (! disk)
@@ -59,7 +59,7 @@ grub_device_open (const char *name)
  fail:
   if (disk)
     grub_disk_close (disk);
-  
+
   grub_free (dev);
 
   return 0;
@@ -82,7 +82,7 @@ grub_device_iterate (int (*hook) (const char *name))
   auto int iterate_disk (const char *disk_name);
   auto int iterate_partition (grub_disk_t disk,
                              const grub_partition_t partition);
-  
+
   struct part_ent
   {
     struct part_ent *next;
@@ -95,11 +95,11 @@ grub_device_iterate (int (*hook) (const char *name))
 
       if (hook (disk_name))
        return 1;
-      
+
       dev = grub_device_open (disk_name);
       if (! dev)
        return 0;
-      
+
       if (dev->disk && dev->disk->has_partitions)
        {
          struct part_ent *p;
@@ -127,12 +127,12 @@ grub_device_iterate (int (*hook) (const char *name))
       grub_device_close (dev);
       return 0;
     }
-  
+
   int iterate_partition (grub_disk_t disk, const grub_partition_t partition)
     {
       char *partition_name;
       struct part_ent *p;
-      
+
       partition_name = grub_partition_get_name (partition);
       if (! partition_name)
        return 1;
index 645d7e7e53c5d5991be468640573c291ee4693e0..ad778d44edf4f716e03fe83de51b2fec0d524874 100644 (file)
@@ -132,7 +132,7 @@ grub_disk_cache_fetch (unsigned long dev_id, unsigned long disk_id,
 #if 0
   grub_disk_cache_misses++;
 #endif
-  
+
   return 0;
 }
 
@@ -157,19 +157,19 @@ grub_disk_cache_store (unsigned long dev_id, unsigned long disk_id,
 {
   unsigned index;
   struct grub_disk_cache *cache;
-  
+
   index = grub_disk_cache_get_index (dev_id, disk_id, sector);
   cache = grub_disk_cache_table + index;
+
   cache->lock = 1;
   grub_free (cache->data);
   cache->data = 0;
   cache->lock = 0;
-  
+
   cache->data = grub_malloc (GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS);
   if (! cache->data)
     return grub_errno;
-  
+
   grub_memcpy (cache->data, data,
               GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS);
   cache->dev_id = dev_id;
@@ -194,7 +194,7 @@ void
 grub_disk_dev_unregister (grub_disk_dev_t dev)
 {
   grub_disk_dev_t *p, q;
-  
+
   for (p = &grub_disk_dev_list, q = *p; q; p = &(q->next), q = q->next)
     if (q == dev)
       {
@@ -255,12 +255,12 @@ grub_disk_open (const char *name)
   disk->name = grub_strdup (name);
   if (! disk->name)
     goto fail;
-  
+
   p = find_part_sep (name);
   if (p)
     {
       grub_size_t len = p - name;
-      
+
       raw = grub_malloc (len + 1);
       if (! raw)
        goto fail;
@@ -290,7 +290,7 @@ grub_disk_open (const char *name)
       grub_error (GRUB_ERR_BAD_DEVICE, "no partition on this disk");
       goto fail;
     }
-  
+
   disk->dev = dev;
 
   if (p)
@@ -310,11 +310,11 @@ grub_disk_open (const char *name)
   if (current_time > (grub_last_time
                      + GRUB_CACHE_TIMEOUT * 1000))
     grub_disk_cache_invalidate_all ();
-  
+
   grub_last_time = current_time;
-  
+
  fail:
-  
+
   if (raw && raw != name)
     grub_free (raw);
 
@@ -357,7 +357,7 @@ grub_disk_adjust_range (grub_disk_t disk, grub_disk_addr_t *sector,
 {
   *sector += *offset >> GRUB_DISK_SECTOR_BITS;
   *offset &= GRUB_DISK_SECTOR_SIZE - 1;
-  
+
   if (disk->partition)
     {
       grub_disk_addr_t start;
@@ -391,7 +391,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
   unsigned real_offset;
 
   grub_dprintf ("disk", "Reading `%s'...\n", disk->name);
-  
+
   /* First of all, check if the region is within the disk.  */
   if (grub_disk_adjust_range (disk, &sector, &offset, size) != GRUB_ERR_NONE)
     {
@@ -403,7 +403,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
     }
 
   real_offset = offset;
-  
+
   /* Allocate a temporary buffer.  */
   tmp_buf = grub_malloc (GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS);
   if (! tmp_buf)
@@ -454,7 +454,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
                goto finish;
 
              tmp_buf = p;
-             
+
              if ((disk->dev->read) (disk, sector, num, tmp_buf))
                {
                  grub_error_push ();
@@ -493,33 +493,33 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
        {
          grub_disk_addr_t s = sector;
          grub_size_t l = len;
-         
+
          while (l)
            {
              (disk->read_hook) (s, real_offset,
                                 ((l > GRUB_DISK_SECTOR_SIZE)
                                  ? GRUB_DISK_SECTOR_SIZE
                                  : l));
-             
+
              if (l < GRUB_DISK_SECTOR_SIZE - real_offset)
                break;
-             
+
              s++;
              l -= GRUB_DISK_SECTOR_SIZE - real_offset;
              real_offset = 0;
            }
        }
-      
+
       sector = start_sector + GRUB_DISK_CACHE_SIZE;
       buf = (char *) buf + len;
       size -= len;
       real_offset = 0;
     }
-  
+
  finish:
-  
+
   grub_free (tmp_buf);
-  
+
   return grub_errno;
 }
 
@@ -528,21 +528,21 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
                 grub_off_t offset, grub_size_t size, const void *buf)
 {
   unsigned real_offset;
-  
+
   grub_dprintf ("disk", "Writing `%s'...\n", disk->name);
 
   if (grub_disk_adjust_range (disk, &sector, &offset, size) != GRUB_ERR_NONE)
     return -1;
 
   real_offset = offset;
-  
+
   while (size)
     {
       if (real_offset != 0 || (size < GRUB_DISK_SECTOR_SIZE && size != 0))
        {
          char tmp_buf[GRUB_DISK_SECTOR_SIZE];
          grub_size_t len;
-         
+
          if (grub_disk_read (disk, sector, 0, GRUB_DISK_SECTOR_SIZE, tmp_buf)
              != GRUB_ERR_NONE)
            goto finish;
@@ -550,7 +550,7 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
          len = GRUB_DISK_SECTOR_SIZE - real_offset;
          if (len > size)
            len = size;
-         
+
          grub_memcpy (tmp_buf + real_offset, buf, len);
 
          grub_disk_cache_invalidate (disk->dev->id, disk->id, sector);
@@ -570,7 +570,7 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
 
          len = size & ~(GRUB_DISK_SECTOR_SIZE - 1);
          n = size >> GRUB_DISK_SECTOR_BITS;
-         
+
          if ((disk->dev->write) (disk, sector, n, buf) != GRUB_ERR_NONE)
            goto finish;
 
@@ -587,7 +587,7 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
   return grub_errno;
 }
 
-grub_uint64_t 
+grub_uint64_t
 grub_disk_get_size (grub_disk_t disk)
 {
   if (disk->partition)
index 84c465ccba39bd886544a26fcfd1aaaadab5f8f8..d729c08740f5602c936f260e6488efc4effe5c67 100644 (file)
--- a/kern/dl.c
+++ b/kern/dl.c
@@ -72,7 +72,7 @@ grub_dl_add (grub_dl_t mod)
   if (grub_dl_get (mod->name))
     return grub_error (GRUB_ERR_BAD_MODULE,
                       "`%s' is already loaded", mod->name);
-  
+
   l = (grub_dl_list_t) grub_malloc (sizeof (*l));
   if (! l)
     return grub_errno;
@@ -169,7 +169,7 @@ grub_dl_register_symbol (const char *name, void *addr, grub_dl_t mod)
 {
   grub_symbol_t sym;
   unsigned k;
-  
+
   sym = (grub_symbol_t) grub_malloc (sizeof (*sym));
   if (! sym)
     return grub_errno;
@@ -185,10 +185,10 @@ grub_dl_register_symbol (const char *name, void *addr, grub_dl_t mod)
     }
   else
     sym->name = name;
-  
+
   sym->addr = addr;
   sym->mod = mod;
-  
+
   k = grub_symbol_hash (name);
   sym->next = grub_symtab[k];
   grub_symtab[k] = sym;
@@ -204,7 +204,7 @@ grub_dl_unregister_symbols (grub_dl_t mod)
 
   if (! mod)
     grub_fatal ("core symbols cannot be unregistered");
-  
+
   for (i = 0; i < GRUB_SYMTAB_SIZE; i++)
     {
       grub_symbol_t sym, *p, q;
@@ -266,7 +266,7 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e)
 {
   unsigned i;
   Elf_Shdr *s;
-  
+
   for (i = 0, s = (Elf_Shdr *)((char *) e + e->e_shoff);
        i < e->e_shnum;
        i++, s = (Elf_Shdr *)((char *) s + e->e_shentsize))
@@ -278,7 +278,7 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e)
          seg = (grub_dl_segment_t) grub_malloc (sizeof (*seg));
          if (! seg)
            return grub_errno;
-         
+
          if (s->sh_size)
            {
              void *addr;
@@ -323,7 +323,7 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e)
   Elf_Sym *sym;
   const char *str;
   Elf_Word size, entsize;
-  
+
   for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff);
        i < e->e_shnum;
        i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize))
@@ -336,7 +336,7 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e)
   sym = (Elf_Sym *) ((char *) e + s->sh_offset);
   size = s->sh_size;
   entsize = s->sh_entsize;
-  
+
   s = (Elf_Shdr *) ((char *) e + e->e_shoff + e->e_shentsize * s->sh_link);
   str = (char *) e + s->sh_offset;
 
@@ -347,7 +347,7 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e)
       unsigned char type = ELF_ST_TYPE (sym->st_info);
       unsigned char bind = ELF_ST_BIND (sym->st_info);
       const char *name = str + sym->st_name;
-      
+
       switch (type)
        {
        case STT_NOTYPE:
@@ -377,7 +377,7 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e)
          if (bind != STB_LOCAL)
            if (grub_dl_register_symbol (name, (void *) sym->st_value, mod))
              return grub_errno;
-         
+
          if (grub_strcmp (name, "grub_mod_init") == 0)
            mod->init = (void (*) (grub_dl_t)) sym->st_value;
          else if (grub_strcmp (name, "grub_mod_fini") == 0)
@@ -445,7 +445,7 @@ grub_dl_resolve_dependencies (grub_dl_t mod, Elf_Ehdr *e)
 
   s = (Elf_Shdr *) ((char *) e + e->e_shoff + e->e_shstrndx * e->e_shentsize);
   str = (char *) e + s->sh_offset;
-  
+
   for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff);
        i < e->e_shnum;
        i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize))
@@ -458,21 +458,21 @@ grub_dl_resolve_dependencies (grub_dl_t mod, Elf_Ehdr *e)
          {
            grub_dl_t m;
            grub_dl_dep_t dep;
-           
+
            m = grub_dl_load (name);
            if (! m)
              return grub_errno;
 
            grub_dl_ref (m);
-           
+
            dep = (grub_dl_dep_t) grub_malloc (sizeof (*dep));
            if (! dep)
              return grub_errno;
-           
+
            dep->mod = m;
            dep->next = mod->dep;
            mod->dep = dep;
-           
+
            name += grub_strlen (name) + 1;
          }
       }
@@ -488,7 +488,7 @@ grub_dl_ref (grub_dl_t mod)
 
   for (dep = mod->dep; dep; dep = dep->next)
     grub_dl_ref (dep->mod);
-  
+
   return ++mod->ref_count;
 }
 
@@ -499,7 +499,7 @@ grub_dl_unref (grub_dl_t mod)
 
   for (dep = mod->dep; dep; dep = dep->next)
     grub_dl_unref (dep->mod);
-  
+
   return --mod->ref_count;
 }
 #endif
@@ -590,7 +590,7 @@ grub_dl_load_file (const char *filename)
   grub_ssize_t size;
   void *core = 0;
   grub_dl_t mod = 0;
-  
+
   file = grub_file_open (filename);
   if (! file)
     return 0;
@@ -621,7 +621,7 @@ grub_dl_load_file (const char *filename)
       grub_free (core);
       return 0;
     }
-  
+
   mod->ref_count = 0;
   return mod;
 }
@@ -637,7 +637,7 @@ grub_dl_load (const char *name)
   mod = grub_dl_get (name);
   if (mod)
     return mod;
-  
+
   if (! grub_dl_dir) {
     grub_error (GRUB_ERR_FILE_NOT_FOUND, "\"prefix\" is not set");
     return 0;
@@ -647,17 +647,17 @@ grub_dl_load (const char *name)
                                   + grub_strlen (name) + 4 + 1);
   if (! filename)
     return 0;
-  
+
   grub_sprintf (filename, "%s/%s.mod", grub_dl_dir, name);
   mod = grub_dl_load_file (filename);
   grub_free (filename);
 
   if (! mod)
     return 0;
-  
+
   if (grub_strcmp (mod->name, name) != 0)
     grub_error (GRUB_ERR_BAD_MODULE, "mismatched names");
-  
+
   return mod;
 }
 
@@ -673,17 +673,17 @@ grub_dl_unload (grub_dl_t mod)
 
   if (mod->fini)
     (mod->fini) ();
-  
+
   grub_dl_remove (mod);
   grub_dl_unregister_symbols (mod);
-  
+
   for (dep = mod->dep; dep; dep = depn)
     {
       depn = dep->next;
-      
+
       if (! grub_dl_unref (dep->mod))
        grub_dl_unload (dep->mod);
-      
+
       grub_free (dep);
     }
 
@@ -693,7 +693,7 @@ grub_dl_unload (grub_dl_t mod)
       grub_free (seg->addr);
       grub_free (seg);
     }
-  
+
   grub_free (mod->name);
   grub_free (mod);
   return 1;
@@ -706,7 +706,7 @@ grub_dl_unload_unneeded (void)
   /* Because grub_dl_remove modifies the list of modules, this
      implementation is tricky.  */
   grub_dl_list_t p = grub_dl_head;
-  
+
   while (p)
     {
       if (grub_dl_unload (p->mod))
@@ -726,7 +726,7 @@ grub_dl_unload_all (void)
   while (grub_dl_head)
     {
       grub_dl_list_t p;
-      
+
       grub_dl_unload_unneeded ();
 
       /* Force to decrement the ref count. This will purge pre-loaded
index 25007e310bf1b50e0c7ddab326d8ca0f5130cc86..3da2beba3e952d56a8f1df5266ae935eff365c54 100644 (file)
@@ -42,12 +42,12 @@ grub_efi_locate_protocol (grub_efi_guid_t *protocol, void *registration)
 {
   void *interface;
   grub_efi_status_t status;
-  
+
   status = efi_call_3 (grub_efi_system_table->boot_services->locate_protocol,
                        protocol, registration, &interface);
   if (status != GRUB_EFI_SUCCESS)
     return 0;
-  
+
   return interface;
 }
 
@@ -64,11 +64,11 @@ grub_efi_locate_handle (grub_efi_locate_search_type_t search_type,
   grub_efi_status_t status;
   grub_efi_handle_t *buffer;
   grub_efi_uintn_t buffer_size = 8 * sizeof (grub_efi_handle_t);
-  
+
   buffer = grub_malloc (buffer_size);
   if (! buffer)
     return 0;
-  
+
   b = grub_efi_system_table->boot_services;
   status = efi_call_5 (b->locate_handle, search_type, protocol, search_key,
                             &buffer_size, buffer);
@@ -78,7 +78,7 @@ grub_efi_locate_handle (grub_efi_locate_search_type_t search_type,
       buffer = grub_malloc (buffer_size);
       if (! buffer)
        return 0;
-      
+
       status = efi_call_5 (b->locate_handle, search_type, protocol, search_key,
                                 &buffer_size, buffer);
     }
@@ -101,7 +101,7 @@ grub_efi_open_protocol (grub_efi_handle_t handle,
   grub_efi_boot_services_t *b;
   grub_efi_status_t status;
   void *interface;
-  
+
   b = grub_efi_system_table->boot_services;
   status = efi_call_6 (b->open_protocol, handle,
                       protocol,
@@ -126,7 +126,7 @@ grub_efi_set_text_mode (int on)
     /* No console control protocol instance available, assume it is
        already in text mode. */
     return 1;
-  
+
   if (efi_call_4 (c->get_mode, c, &mode, 0, 0) != GRUB_EFI_SUCCESS)
     return 0;
 
@@ -181,7 +181,7 @@ grub_efi_exit_boot_services (grub_efi_uintn_t map_key)
 {
   grub_efi_boot_services_t *b;
   grub_efi_status_t status;
-  
+
   b = grub_efi_system_table->boot_services;
   status = efi_call_2 (b->exit_boot_services, grub_efi_image_handle, map_key);
   return status == GRUB_EFI_SUCCESS;
@@ -215,7 +215,7 @@ grub_arch_modules_addr (void)
   struct grub_pe32_section_table *section;
   struct grub_module_info *info;
   grub_uint16_t i;
-  
+
   image = grub_efi_get_loaded_image (grub_efi_image_handle);
   if (! image)
     return 0;
@@ -250,7 +250,7 @@ char *
 grub_efi_get_filename (grub_efi_device_path_t *dp)
 {
   char *name = 0;
-  
+
   while (1)
     {
       grub_efi_uint8_t type = GRUB_EFI_DEVICE_PATH_TYPE (dp);
@@ -274,7 +274,7 @@ grub_efi_get_filename (grub_efi_device_path_t *dp)
            }
          else
            size = 0;
-         
+
          len = ((GRUB_EFI_DEVICE_PATH_LENGTH (dp) - 4)
                 / sizeof (grub_efi_char16_t));
          p = grub_realloc (name, size + len * 4 + 1);
@@ -420,17 +420,17 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp)
                grub_efi_expanded_acpi_device_path_t eacpi;
                grub_memcpy (&eacpi, dp, sizeof (eacpi));
                grub_printf ("/ACPI(");
-               
+
                if (GRUB_EFI_EXPANDED_ACPI_HIDSTR (dp)[0] == '\0')
                  grub_printf ("%x,", (unsigned) eacpi.hid);
                else
                  grub_printf ("%s,", GRUB_EFI_EXPANDED_ACPI_HIDSTR (dp));
-               
+
                if (GRUB_EFI_EXPANDED_ACPI_UIDSTR (dp)[0] == '\0')
                  grub_printf ("%x,", (unsigned) eacpi.uid);
                else
                  grub_printf ("%s,", GRUB_EFI_EXPANDED_ACPI_UIDSTR (dp));
-               
+
                if (GRUB_EFI_EXPANDED_ACPI_CIDSTR (dp)[0] == '\0')
                  grub_printf ("%x)", (unsigned) eacpi.cid);
                else
@@ -727,7 +727,7 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp)
          return;
          break;
        }
-      
+
       if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp))
        break;
 
@@ -749,7 +749,7 @@ grub_efi_finish_boot_services (void)
     return 0;
 
   mmap_buf = grub_malloc (mmap_size);
-  
+
   if (grub_efi_get_memory_map (&mmap_size, mmap_buf, &map_key,
                               &desc_size, &desc_version) <= 0)
     return 0;
index 115a087fadbb87430e7d8326946a0c7a2f40625d..f9ba03852f6cc419f30ddf2d95fc30c125a47e2a 100644 (file)
@@ -43,7 +43,7 @@ void
 grub_efi_set_prefix (void)
 {
   grub_efi_loaded_image_t *image;
-  
+
   image = grub_efi_get_loaded_image (grub_efi_image_handle);
   if (image)
     {
@@ -52,12 +52,12 @@ grub_efi_set_prefix (void)
 
       device = grub_efidisk_get_device_name (image->device_handle);
       file = grub_efi_get_filename (image->file_path);
-      
+
       if (device && file)
        {
          char *p;
          char *prefix;
-         
+
          /* Get the directory.  */
          p = grub_strrchr (file, '/');
          if (p)
@@ -72,7 +72,7 @@ grub_efi_set_prefix (void)
              grub_free (prefix);
            }
        }
-      
+
       grub_free (device);
       grub_free (file);
     }
index 30b5ab4ad85b85b002ab00d79666a03a62113a4a..e1fca81f376c4c24649760a3e1780d1abd46d73b 100644 (file)
@@ -64,7 +64,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
   if (address > 0xffffffff)
     return 0;
 #endif
-  
+
 #if GRUB_TARGET_SIZEOF_VOID_P < 8 || defined (MCMODEL_SMALL)
   if (address == 0)
     {
@@ -95,7 +95,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
       if (status != GRUB_EFI_SUCCESS)
        return 0;
     }
-      
+
   if (allocated_pages)
     {
       unsigned i;
@@ -111,7 +111,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
       if (i == MAX_ALLOCATED_PAGES)
        grub_fatal ("too many page allocations");
     }
-  
+
   return (void *) ((grub_addr_t) address);
 }
 
@@ -127,7 +127,7 @@ grub_efi_free_pages (grub_efi_physical_address_t address,
          != address))
     {
       unsigned i;
-      
+
       for (i = 0; i < MAX_ALLOCATED_PAGES; i++)
        if (allocated_pages[i].addr == address)
          {
@@ -135,7 +135,7 @@ grub_efi_free_pages (grub_efi_physical_address_t address,
            break;
          }
     }
-  
+
   b = grub_efi_system_table->boot_services;
   efi_call_2 (b->free_pages, address, pages);
 }
@@ -159,7 +159,7 @@ grub_efi_get_memory_map (grub_efi_uintn_t *memory_map_size,
     map_key = &key;
   if (! descriptor_version)
     descriptor_version = &version;
-  
+
   b = grub_efi_system_table->boot_services;
   status = efi_call_5 (b->get_memory_map, memory_map_size, memory_map, map_key,
                              descriptor_size, descriptor_version);
@@ -179,13 +179,13 @@ sort_memory_map (grub_efi_memory_descriptor_t *memory_map,
 {
   grub_efi_memory_descriptor_t *d1;
   grub_efi_memory_descriptor_t *d2;
-  
+
   for (d1 = memory_map;
        d1 < memory_map_end;
        d1 = NEXT_MEMORY_DESCRIPTOR (d1, desc_size))
     {
       grub_efi_memory_descriptor_t *max_desc = d1;
-      
+
       for (d2 = NEXT_MEMORY_DESCRIPTOR (d1, desc_size);
           d2 < memory_map_end;
           d2 = NEXT_MEMORY_DESCRIPTOR (d2, desc_size))
@@ -227,7 +227,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
          && desc->num_pages != 0)
        {
          grub_memcpy (filtered_desc, desc, desc_size);
-         
+
          /* Avoid less than 1MB, because some loaders seem to be confused.  */
          if (desc->physical_start < 0x100000)
            {
@@ -235,7 +235,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
                                                 - desc->physical_start);
              desc->physical_start = 0x100000;
            }
-         
+
 #if GRUB_TARGET_SIZEOF_VOID_P < 8 || defined (MCMODEL_SMALL)
          if (BYTES_TO_PAGES (filtered_desc->physical_start)
              + filtered_desc->num_pages
@@ -244,10 +244,10 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
              = (BYTES_TO_PAGES (0x100000000LL)
                 - BYTES_TO_PAGES (filtered_desc->physical_start));
 #endif
-         
+
          if (filtered_desc->num_pages == 0)
            continue;
-         
+
          filtered_desc = NEXT_MEMORY_DESCRIPTOR (filtered_desc, desc_size);
        }
     }
@@ -263,7 +263,7 @@ get_total_pages (grub_efi_memory_descriptor_t *memory_map,
 {
   grub_efi_memory_descriptor_t *desc;
   grub_efi_uint64_t total = 0;
-  
+
   for (desc = memory_map;
        desc < memory_map_end;
        desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
@@ -280,7 +280,7 @@ add_memory_regions (grub_efi_memory_descriptor_t *memory_map,
                    grub_efi_uint64_t required_pages)
 {
   grub_efi_memory_descriptor_t *desc;
-  
+
   for (desc = memory_map;
        desc < memory_map_end;
        desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
@@ -323,7 +323,7 @@ print_memory_map (grub_efi_memory_descriptor_t *memory_map,
 {
   grub_efi_memory_descriptor_t *desc;
   int i;
-  
+
   for (desc = memory_map, i = 0;
        desc < memory_map_end;
        desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size), i++)
@@ -354,7 +354,7 @@ grub_efi_mm_init (void)
     grub_fatal ("cannot allocate memory");
 
   grub_memset (allocated_pages, 0, ALLOCATED_PAGES_SIZE);
-  
+
   /* Prepare a memory region to store two memory maps.  */
   memory_map = grub_efi_allocate_pages (0,
                                        2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE));
@@ -370,10 +370,10 @@ grub_efi_mm_init (void)
     grub_fatal ("cannot get memory map");
 
   memory_map_end = NEXT_MEMORY_DESCRIPTOR (memory_map, map_size);
-  
+
   filtered_memory_map_end = filter_memory_map (memory_map, filtered_memory_map,
                                               desc_size, memory_map_end);
-  
+
   /* By default, request a quarter of the available memory.  */
   total_pages = get_total_pages (filtered_memory_map, desc_size,
                                 filtered_memory_map_end);
@@ -403,7 +403,7 @@ grub_efi_mm_init (void)
                    NEXT_MEMORY_DESCRIPTOR (memory_map, map_size));
   grub_abort ();
 #endif
-  
+
   /* Release the memory maps.  */
   grub_efi_free_pages ((grub_addr_t) memory_map,
                       2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE));
index d8447b9955920937f6443972a6b8816ec02f626e..e85627b0b1f6e3e996308f213f75d432efafb39c 100644 (file)
@@ -29,7 +29,7 @@ struct grub_env_context
 {
   /* A hash table for variables.  */
   struct grub_env_var *vars[HASHSZ];
-  
+
   /* One level deeper on the stack.  */
   struct grub_env_context *prev;
 };
@@ -92,7 +92,7 @@ grub_env_context_open (int export)
   for (i = 0; i < HASHSZ; i++)
     {
       struct grub_env_var *var;
-      
+
       for (var = context->prev->vars[i]; var; var = var->next)
        {
          if (export && var->type == GRUB_ENV_VAR_GLOBAL)
@@ -106,7 +106,7 @@ grub_env_context_open (int export)
            }
        }
     }
-  
+
   return GRUB_ERR_NONE;
 }
 
@@ -118,12 +118,12 @@ grub_env_context_close (void)
 
   if (! current_context->prev)
     grub_fatal ("cannot close the initial context");
-  
+
   /* Free the variables associated with this context.  */
   for (i = 0; i < HASHSZ; i++)
     {
       struct grub_env_var *p, *q;
-      
+
       for (p = current_context->vars[i]; p; p = q)
        {
          q = p->next;
@@ -192,7 +192,7 @@ grub_env_set (const char *name, const char *val)
        var->value = var->write_hook (var, val);
       else
        var->value = grub_strdup (val);
-      
+
       if (! var->value)
        {
          var->value = old;
@@ -207,17 +207,17 @@ grub_env_set (const char *name, const char *val)
   var = grub_malloc (sizeof (*var));
   if (! var)
     return grub_errno;
-  
+
   grub_memset (var, 0, sizeof (*var));
 
   /* This is not necessary, because GRUB_ENV_VAR_LOCAL == 0. But leave
      this for readability.  */
   var->type = GRUB_ENV_VAR_LOCAL;
-  
+
   var->name = grub_strdup (name);
   if (! var->name)
     goto fail;
-  
+
   var->value = grub_strdup (val);
   if (! var->value)
     goto fail;
@@ -238,7 +238,7 @@ char *
 grub_env_get (const char *name)
 {
   struct grub_env_var *var;
-  
+
   var = grub_env_find (name);
   if (! var)
     return 0;
@@ -253,7 +253,7 @@ void
 grub_env_unset (const char *name)
 {
   struct grub_env_var *var;
-  
+
   var = grub_env_find (name);
   if (! var)
     return;
@@ -277,12 +277,12 @@ grub_env_iterate (int (*func) (struct grub_env_var *var))
   struct grub_env_sorted_var *sorted_list = 0;
   struct grub_env_sorted_var *sorted_var;
   int i;
-  
+
   /* Add variables associated with this context into a sorted list.  */
   for (i = 0; i < HASHSZ; i++)
     {
       struct grub_env_var *var;
-      
+
       for (var = current_context->vars[i]; var; var = var->next)
        {
          struct grub_env_sorted_var *p, **q;
@@ -290,7 +290,7 @@ grub_env_iterate (int (*func) (struct grub_env_var *var))
          /* Ignore data slots.  */
          if (var->type == GRUB_ENV_VAR_DATA)
            continue;
-         
+
          sorted_var = grub_malloc (sizeof (*sorted_var));
          if (! sorted_var)
            goto fail;
@@ -302,7 +302,7 @@ grub_env_iterate (int (*func) (struct grub_env_var *var))
              if (grub_strcmp (p->var->name, var->name) > 0)
                break;
            }
-         
+
          sorted_var->next = *q;
          *q = sorted_var;
        }
@@ -336,11 +336,11 @@ grub_register_variable_hook (const char *name,
     {
       if (grub_env_set (name, "") != GRUB_ERR_NONE)
        return grub_errno;
-      
+
       var = grub_env_find (name);
       /* XXX Insert an assertion?  */
     }
-  
+
   var->read_hook = read_hook;
   var->write_hook = write_hook;
 
@@ -355,7 +355,7 @@ mangle_data_slot_name (const char *name)
   mangled_name = grub_malloc (grub_strlen (name) + 2);
   if (! mangled_name)
     return 0;
-  
+
   grub_sprintf (mangled_name, "\e%s", name);
   return mangled_name;
 }
@@ -382,7 +382,7 @@ grub_env_set_data_slot (const char *name, const void *ptr)
   var = grub_malloc (sizeof (*var));
   if (! var)
     goto fail;
-  
+
   grub_memset (var, 0, sizeof (*var));
 
   var->type = GRUB_ENV_VAR_DATA;
@@ -404,7 +404,7 @@ grub_env_get_data_slot (const char *name)
 {
   char *mangled_name;
   void *ptr = 0;
-  
+
   mangled_name = mangle_data_slot_name (name);
   if (! mangled_name)
     goto fail;
@@ -413,7 +413,7 @@ grub_env_get_data_slot (const char *name)
   grub_free (mangled_name);
 
  fail:
-  
+
   return ptr;
 }
 
@@ -421,7 +421,7 @@ void
 grub_env_unset_data_slot (const char *name)
 {
   char *mangled_name;
-  
+
   mangled_name = mangle_data_slot_name (name);
   if (! mangled_name)
     return;
index 8c78cb7b0cf1a2c8bd522cad439f1a83eb1805a4..311130154a896cfaf4f88bca2ee26e01345fc099 100644 (file)
@@ -40,7 +40,7 @@ grub_err_t
 grub_error (grub_err_t n, const char *fmt, ...)
 {
   va_list ap;
-  
+
   grub_errno = n;
 
   va_start (ap, fmt);
@@ -73,7 +73,7 @@ grub_error_push (void)
       grub_memcpy (grub_error_stack_items[grub_error_stack_pos].errmsg,
                    grub_errmsg,
                    sizeof (grub_errmsg));
-        
+
       /* Advance to next error stack position.  */
       grub_error_stack_pos++;
     }
@@ -96,19 +96,19 @@ grub_error_pop (void)
     {
       /* Pop error message from error stack to current active error.  */
       grub_error_stack_pos--;
-      
+
       grub_errno = grub_error_stack_items[grub_error_stack_pos].errno;
       grub_memcpy (grub_errmsg,
                    grub_error_stack_items[grub_error_stack_pos].errmsg,
                    sizeof (grub_errmsg));
-                  
+
       return 1;
     }
   else
     {
       /* There is no more items on error stack, reset to no error state.  */
       grub_errno = GRUB_ERR_NONE;
-      
+
       return 0;
     }
 }
@@ -122,9 +122,9 @@ grub_print_error (void)
     {
       if (grub_errno != GRUB_ERR_NONE)
         grub_err_printf ("error: %s\n", grub_errmsg);
-    } 
+    }
   while (grub_error_pop ());
-  
+
   /* If there was an assert while using error stack, report about it.  */
   if (grub_error_stack_assert)
     {
index adf55daf38c69eea9d2d8dbb6434fa866f159a97..17e6e781b7a7cbd7701422210a8022ca687a93df 100644 (file)
@@ -32,7 +32,7 @@ grub_file_get_device_name (const char *name)
     {
       char *p = grub_strchr (name, ')');
       char *ret;
-      
+
       if (! p)
        {
          grub_error (GRUB_ERR_BAD_FILENAME, "missing `)'");
@@ -42,7 +42,7 @@ grub_file_get_device_name (const char *name)
       ret = (char *) grub_malloc (p - name);
       if (! ret)
        return 0;
-      
+
       grub_memcpy (ret, name + 1, p - name - 1);
       ret[p - name - 1] = '\0';
       return ret;
@@ -74,16 +74,16 @@ grub_file_open (const char *name)
   grub_free (device_name);
   if (! device)
     goto fail;
-  
+
   file = (grub_file_t) grub_malloc (sizeof (*file));
   if (! file)
     goto fail;
-  
+
   file->device = device;
   file->offset = 0;
   file->data = 0;
   file->read_hook = 0;
-    
+
   if (device->disk && file_name[0] != '/')
     /* This is a block list.  */
     file->fs = &grub_fs_blocklist;
@@ -106,7 +106,7 @@ grub_file_open (const char *name)
   /* if (net) grub_net_close (net);  */
 
   grub_free (file);
-  
+
   return 0;
 }
 
@@ -114,17 +114,17 @@ grub_ssize_t
 grub_file_read (grub_file_t file, char *buf, grub_size_t len)
 {
   grub_ssize_t res;
-  
+
   if (len == 0 || len > file->size - file->offset)
     len = file->size - file->offset;
 
   /* Prevent an overflow.  */
   if ((grub_ssize_t) len < 0)
     len >>= 1;
-  
+
   if (len == 0)
     return 0;
-  
+
   res = (file->fs->read) (file, buf, len);
   if (res > 0)
     file->offset += res;
@@ -155,7 +155,7 @@ grub_file_seek (grub_file_t file, grub_off_t offset)
                  "attempt to seek outside of the file");
       return -1;
     }
-  
+
   old = file->offset;
   file->offset = offset;
   return old;
index e2e4300ee15b908e9aaa57ea9ade3c1031c98f2e..c8f4970b961264ad7e40207f6816c604a6177bcd 100644 (file)
--- a/kern/fs.c
+++ b/kern/fs.c
@@ -65,7 +65,7 @@ grub_fs_t
 grub_fs_probe (grub_device_t device)
 {
   grub_fs_t p;
-  auto int dummy_func (const char *filename, 
+  auto int dummy_func (const char *filename,
                       const struct grub_dirhook_info *info);
 
   int dummy_func (const char *filename __attribute__ ((unused)),
@@ -100,24 +100,24 @@ grub_fs_probe (grub_device_t device)
       if (grub_fs_autoload_hook && count == 0)
        {
          count++;
-         
+
          while (grub_fs_autoload_hook ())
            {
              p = grub_fs_list;
-             
+
              (p->dir) (device, "/", dummy_func);
              if (grub_errno == GRUB_ERR_NONE)
                {
                  count--;
                  return p;
                }
-             
+
              if (grub_errno != GRUB_ERR_BAD_FS)
                {
                  count--;
                  return 0;
                }
-             
+
              grub_errno = GRUB_ERR_NONE;
            }
 
@@ -149,7 +149,7 @@ grub_fs_blocklist_open (grub_file_t file, const char *name)
   unsigned i;
   grub_disk_t disk = file->device->disk;
   struct grub_fs_block *blocks;
-  
+
   /* First, count the number of blocks.  */
   do
     {
@@ -198,14 +198,14 @@ grub_fs_blocklist_open (grub_file_t file, const char *name)
          grub_error (GRUB_ERR_BAD_FILENAME, "beyond the total sectors");
          goto fail;
        }
-      
+
       file->size += (blocks[i].length << GRUB_DISK_SECTOR_BITS);
       p++;
     }
 
   blocks[i].length = 0;
   file->data = blocks;
-  
+
   return GRUB_ERR_NONE;
 
  fail:
@@ -236,11 +236,11 @@ grub_fs_blocklist_read (grub_file_t file, char *buf, grub_size_t len)
          if (((size + offset + GRUB_DISK_SECTOR_SIZE - 1)
               >> GRUB_DISK_SECTOR_BITS) > p->length - sector)
            size = ((p->length - sector) << GRUB_DISK_SECTOR_BITS) - offset;
-         
+
          if (grub_disk_read (file->device->disk, p->offset + sector, offset,
                              size, buf) != GRUB_ERR_NONE)
            return -1;
-         
+
          ret += size;
          len -= size;
          sector -= ((size + offset) >> GRUB_DISK_SECTOR_BITS);
index 20d883d4401dea8e71fc4b6d92d60414d62d5992..9d5971f217a80e4fb8a7fc823682b108ff1e2ab9 100644 (file)
@@ -29,9 +29,9 @@ grub_millisleep (grub_uint32_t ms)
 
   start = grub_get_time_ms ();
 
-  /* Instead of setting an end time and looping while the current time is 
+  /* Instead of setting an end time and looping while the current time is
      less than that, comparing the elapsed sleep time with the desired sleep
-     time handles the (unlikely!) case that the timer would wrap around 
+     time handles the (unlikely!) case that the timer would wrap around
      during the sleep. */
 
   while (grub_get_time_ms () - start < ms)
index 74979e7fd6b397ea2b989dd3d82a8dc13415dad0..3592336286060f57efac8872a6c6fcd4e2f0e8b9 100644 (file)
@@ -26,8 +26,8 @@
 grub_uint64_t
 grub_rtc_get_time_ms (void)
 {
-  /* By dimensional analysis: 
-    
+  /* By dimensional analysis:
+
       1000 ms   N rtc ticks       1 s
       ------- * ----------- * ----------- = 1000*N/T ms
         1 s          1        T rtc ticks
index e9e43e513e75c175cbcbf6a4358ce5af1bb28282..978bfb1662651c6637b51f4f2c4c131bc3e99985 100644 (file)
@@ -56,7 +56,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
 
   if (i == e->e_shnum)
     return grub_error (GRUB_ERR_BAD_MODULE, "no symtab found");
-  
+
   symtab = (Elf32_Sym *) ((char *) e + s->sh_offset);
   entsize = s->sh_entsize;
 
@@ -75,7 +75,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
        if (seg)
          {
            Elf32_Rel *rel, *max;
-           
+
            for (rel = (Elf32_Rel *) ((char *) e + s->sh_offset),
                   max = rel + s->sh_size / s->sh_entsize;
                 rel < max;
@@ -83,15 +83,15 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
              {
                Elf32_Word *addr;
                Elf32_Sym *sym;
-               
+
                if (seg->size < rel->r_offset)
                  return grub_error (GRUB_ERR_BAD_MODULE,
                                     "reloc offset is out of the segment");
-               
+
                addr = (Elf32_Word *) ((char *) seg->addr + rel->r_offset);
                sym = (Elf32_Sym *) ((char *) symtab
                                     + entsize * ELF32_R_SYM (rel->r_info));
-               
+
                switch (ELF32_R_TYPE (rel->r_info))
                  {
                  case R_386_32:
index 066373e2e6d078f8be34ad16a5234944e9c851ab..2289f9b24fb4670dc59411f1156d51f72da0b3e5 100644 (file)
@@ -25,7 +25,7 @@ grub_stop_floppy (void)
 {
 }
 
-void 
+void
 grub_arch_sync_caches (void *address __attribute__ ((unused)),
                       grub_size_t len __attribute__ ((unused)))
 {
index c64497ed623d6a9638870c84957bfbc00d9fb2f1..b5339214e002a32cfd3b2b51d93f819b6e1d2cf1 100644 (file)
@@ -46,7 +46,7 @@ static int num_regions;
 grub_addr_t grub_os_area_addr;
 grub_size_t grub_os_area_size;
 
-void 
+void
 grub_arch_sync_caches (void *address __attribute__ ((unused)),
                       grub_size_t len __attribute__ ((unused)))
 {
@@ -64,20 +64,20 @@ make_install_device (void)
          to the boot drive.  */
       if (grub_root_drive == 0xFF)
         grub_root_drive = grub_boot_drive;
-      
+
       grub_sprintf (dev, "(%cd%u", (grub_root_drive & 0x80) ? 'h' : 'f',
                     grub_root_drive & 0x7f);
-      
+
       if (grub_install_dos_part >= 0)
        grub_sprintf (dev + grub_strlen (dev), ",%u", grub_install_dos_part + 1);
-      
+
       if (grub_install_bsd_part >= 0)
        grub_sprintf (dev + grub_strlen (dev), ",%c", grub_install_bsd_part + 'a');
-      
+
       grub_sprintf (dev + grub_strlen (dev), ")%s", grub_prefix);
       grub_strcpy (grub_prefix, dev);
     }
-      
+
   return grub_prefix;
 }
 
@@ -115,7 +115,7 @@ compact_mem_regions (void)
     if (mem_regions[i].addr + mem_regions[i].size >= mem_regions[i + 1].addr)
       {
        j = i + 1;
-       
+
        if (mem_regions[i].addr + mem_regions[i].size
            < mem_regions[j].addr + mem_regions[j].size)
          mem_regions[i].size = (mem_regions[j].addr + mem_regions[j].size
@@ -133,12 +133,12 @@ grub_machine_init (void)
 {
   int i;
   int grub_lower_mem;
-  
+
   /* Initialize the console as early as possible.  */
   grub_console_init ();
-  
+
   grub_lower_mem = grub_get_memsize (0) << 10;
-  
+
   /* Sanity check.  */
   if (grub_lower_mem < GRUB_MEMORY_MACHINE_RESERVED_END)
     grub_fatal ("too small memory");
@@ -157,7 +157,7 @@ grub_machine_init (void)
     add_mem_region (GRUB_MEMORY_MACHINE_RESERVED_END,
                    grub_lower_mem - GRUB_MEMORY_MACHINE_RESERVED_END);
 #endif
-  
+
   auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t);
   int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type)
     {
@@ -166,16 +166,16 @@ grub_machine_init (void)
        {
          if (size <= 0x100000 - addr)
            return 0;
-         
+
          size -= 0x100000 - addr;
          addr = 0x100000;
        }
-       
+
       /* Ignore >4GB.  */
       if (addr <= 0xFFFFFFFF && type == GRUB_MACHINE_MEMORY_AVAILABLE)
        {
          grub_size_t len;
-         
+
          len = (grub_size_t) ((addr + size > 0xFFFFFFFF)
                 ? 0xFFFFFFFF - addr
                 : size);
@@ -186,7 +186,7 @@ grub_machine_init (void)
     }
 
   grub_machine_mmap_iterate (hook);
-  
+
   compact_mem_regions ();
 
   /* Add the memory regions to free memory, except for the region starting
@@ -204,7 +204,7 @@ grub_machine_init (void)
       }
     else
       grub_mm_init_region ((void *) mem_regions[i].addr, mem_regions[i].size);
-  
+
   if (! grub_os_area_addr)
     grub_fatal ("no upper memory");
 
index e942e98d6902332d02c687d29b464ba3785d5049..49ba8cc1a60fa64f5fb5fc6b156bd222f617cfd0 100644 (file)
@@ -16,7 +16,7 @@
  *  You should have received a copy of the GNU General Public License
  *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
  */
-       
+
 /*
  * This code was stolen from the files enter.sh, leave.sh, lzo1x_d.sh,
  * lzo1x_f.s and lzo_asm.h in LZO version 1.08, and was heavily modified
@@ -37,7 +37,7 @@
 #define MOVSL(r1,r2,x) movl (r1), x ; addl $4, r1 ; movl x, (r2) ; addl $4, r2
 #define COPYL_C(r1,r2,x,rc)    9: MOVSL(r1,r2,x) ; decl rc ; jnz 9b
 #define COPYL(r1,r2,x) COPYL_C(r1,r2,x,%ecx)
-       
+
 lzo1x_decompress:
        pushl   %ebp
        pushl   %edi
@@ -50,7 +50,7 @@ lzo1x_decompress:
        movl    OUTP, %edi
        movl    $3, %ebp
 
-       
+
        xorl    %eax, %eax
        xorl    %ebx, %ebx      /* high bits 9-32 stay 0 */
        lodsb
@@ -283,7 +283,7 @@ lzo1x_decompress:
 .L_leave:
        negl    %eax
        jnz     1f
-       
+
        subl    OUTP, %edi       /* write back the uncompressed size */
        movl    %edi, %eax
 
index d289c731de3f75bf2dfa6bef3f523c72afad1f91..52d8fd5971267aa4e8973554769dab6daed51be9 100644 (file)
@@ -27,7 +27,7 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uin
   grub_uint32_t cont;
   struct grub_machine_mmap_entry *entry
     = (struct grub_machine_mmap_entry *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR;
-  
+
   /* Check if grub_get_mmap_entry works.  */
   cont = grub_get_mmap_entry (entry, 0);
 
index cd323125fd61a75ef5c39d8e92b9a5ec822daa8b..0f80e8ab87af5606af92a579dfe0183aa8110b63 100644 (file)
@@ -21,7 +21,7 @@
  * Note: These functions defined in this file may be called from C.
  *       Be careful of that you must not modify some registers. Quote
  *       from gcc-2.95.2/gcc/config/i386/i386.h:
-       
+
    1 for registers not available across function calls.
    These must include the FIXED_REGISTERS and also any
    registers that can be used without being saved.
@@ -52,9 +52,9 @@
 #include <grub/term.h>
 #include <multiboot.h>
 #include <multiboot2.h>
-               
+
 #define ABS(x) ((x) - _start + GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200)
-       
+
        .file   "startup.S"
 
        .text
@@ -140,7 +140,7 @@ multiboot_header:
        .long   0
        /* entry addr */
        .long   multiboot_entry - _start + 0x100000 + 0x200
-       
+
 multiboot_entry:
        .code32
        /* obtain the boot device */
@@ -157,7 +157,7 @@ multiboot_entry:
        /* jump to the real address */
        movl    $multiboot_trampoline, %eax
        jmp     *%eax
-       
+
 multiboot_trampoline:
        /* fill the boot information */
        movl    %edx, %eax
@@ -178,7 +178,7 @@ multiboot_trampoline:
        /* enter the usual booting */
        call    prot_to_real
        .code16
-       
+
 /* the real mode code continues... */
 codestart:
        cli             /* we're not safe here! */
@@ -201,7 +201,7 @@ codestart:
 
        /* reset disk system (%ah = 0) */
        int     $0x13
-       
+
        /* transition to protected mode */
        DATA32  call real_to_prot
 
@@ -210,7 +210,7 @@ codestart:
 
        incl    %eax
        call    EXT_C(grub_gate_a20)
-       
+
 #if defined(ENABLE_LZO)
        /* decompress the compressed part and put the result at 1MB */
        movl    $GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR, %esi
@@ -260,7 +260,7 @@ codestart:
        rep
        movsb
 #endif
-       
+
 #ifdef APPLE_CC
        /* clean out the bss */
        bss_start_abs = ABS (bss_start)
@@ -279,13 +279,13 @@ codestart:
        movl    $END_SYMBOL, %ecx
        subl    %edi, %ecx
 #endif
-                       
+
        /* clean out */
        xorl    %eax, %eax
        cld
        rep
        stosb
-       
+
        /*
         *  Call the start of main body of C code.
         */
@@ -304,7 +304,7 @@ VARIABLE(grub_root_drive)
        .byte   0
 
        .p2align        2       /* force 4-byte alignment */
-       
+
 /*
  *  These next two routines, "real_to_prot" and "prot_to_real" are structured
  *  in a very specific way.  Be very careful when changing them.
@@ -375,7 +375,7 @@ protcseg:
 FUNCTION(grub_gate_a20)
        movl    %eax, %edx
 
-gate_a20_test_current_state:   
+gate_a20_test_current_state:
        /* first of all, test if already in a good state */
        call    gate_a20_check_state
        cmpb    %al, %dl
@@ -402,7 +402,7 @@ gate_a20_try_bios:
        cmpb    %al, %dl
        jnz     gate_a20_try_system_control_port_a
        ret
-       
+
 gate_a20_try_system_control_port_a:
        /*
         * In macbook, the keyboard test would hang the machine, so we move
@@ -430,7 +430,7 @@ gate_a20_flush_keyboard_buffer:
        inb     $0x64
        andb    $0x02, %al
        jnz     gate_a20_flush_keyboard_buffer
-2:     
+2:
        inb     $0x64
        andb    $0x01, %al
        jz      3f
@@ -438,14 +438,14 @@ gate_a20_flush_keyboard_buffer:
        jmp     2b
 3:
        ret
-       
-gate_a20_try_keyboard_controller:      
+
+gate_a20_try_keyboard_controller:
        /* third, try the keyboard controller */
        call    gate_a20_flush_keyboard_buffer
 
        movb    $0xd1, %al
        outb    $0x64
-4:     
+4:
        inb     $0x64
        andb    $0x02, %al
        jnz     4b
@@ -467,18 +467,18 @@ gate_a20_try_keyboard_controller:
        /* everything failed, so restart from the beginning */
        jnz     gate_a20_try_bios
        ret
-       
+
 gate_a20_check_state:
        /* iterate the checking for a while */
        movl    $100, %ecx
-1:     
+1:
        call    3f
        cmpb    %al, %dl
        jz      2f
        loop    1b
 2:
        ret
-3:     
+3:
        pushl   %ebx
        pushl   %ecx
        xorl    %eax, %eax
@@ -567,7 +567,7 @@ FUNCTION(grub_exit)
        int     $0x18
        jmp     cold_reboot
        .code32
-       
+
 /*
  * grub_reboot()
  *
@@ -576,13 +576,13 @@ FUNCTION(grub_exit)
 FUNCTION(grub_reboot)
        call    prot_to_real
        .code16
-cold_reboot:   
+cold_reboot:
        /* cold boot */
        movw    $0x0472, %di
        movw    %ax, (%di)
        ljmp    $0xFFFF, $0x0000
        .code32
-       
+
 /*
  * grub_halt(int no_apm)
  *
@@ -596,7 +596,7 @@ FUNCTION(grub_halt)
 
        call    prot_to_real
        .code16
-       
+
        /* detect APM */
        movw    $0x5300, %ax
        xorw    %bx, %bx
@@ -621,7 +621,7 @@ FUNCTION(grub_halt)
        movw    $0x0101, %cx
        int     $0x15
        jc      EXT_C(grub_hard_stop)
-       
+
        /* set the power state to off */
        movw    $0x5307, %ax
        movw    $1, %bx
@@ -631,8 +631,8 @@ FUNCTION(grub_halt)
        /* shouldn't reach here */
        jmp     EXT_C(grub_hard_stop)
        .code32
-       
-       
+
+
 /*
  *  void grub_chainloader_real_boot (int drive, void *part_addr)
  *
@@ -683,7 +683,7 @@ FUNCTION(grub_biosdisk_rw_int13_extensions)
        movb    %al, %dh
        /* enter real mode */
        call    prot_to_real
-       
+
        .code16
        movb    %dh, %ah
        movw    %cx, %ds
@@ -699,7 +699,7 @@ FUNCTION(grub_biosdisk_rw_int13_extensions)
        popl    %ebp
 
        ret
-       
+
 /*
  *   int grub_biosdisk_rw_standard (int ah, int drive, int coff, int hoff,
  *                                  int soff, int nsec, int segment)
@@ -735,7 +735,7 @@ FUNCTION(grub_biosdisk_rw_standard)
        movw    %ax, %di
        /* save SEGMENT in %bx */
        movw    0x14(%ebp), %bx
-               
+
        /* enter real mode */
        call    prot_to_real
 
@@ -744,7 +744,7 @@ FUNCTION(grub_biosdisk_rw_standard)
        xorw    %bx, %bx
        movw    $3, %si         /* attempt at least three times */
 
-1:     
+1:
        movw    %di, %ax
        int     $0x13           /* do the operation */
        jnc     2f              /* check if successful */
@@ -753,19 +753,19 @@ FUNCTION(grub_biosdisk_rw_standard)
        /* if fail, reset the disk system */
        xorw    %ax, %ax
        int     $0x13
-       
+
        decw    %si
        cmpw    $0, %si
        je      2f
        xorb    %bl, %bl
        jmp     1b              /* retry */
-2:     
+2:
        /* back to protected mode */
        DATA32  call    real_to_prot
        .code32
 
        movb    %bl, %al        /* return value in %eax */
-       
+
        popl    %esi
        popl    %edi
        popl    %ebx
@@ -794,7 +794,7 @@ FUNCTION(grub_biosdisk_check_int13_extensions)
        movb    $0x41, %ah
        movw    $0x55aa, %bx
        int     $0x13           /* do the operation */
-       
+
        /* check the result */
        jc      1f
        cmpw    $0xaa55, %bx
@@ -805,7 +805,7 @@ FUNCTION(grub_biosdisk_check_int13_extensions)
        /* check if AH=0x42 is supported */
        andw    $1, %cx
        jnz     2f
-       
+
 1:
        xorb    %bl, %bl
 2:
@@ -870,13 +870,13 @@ FUNCTION(grub_biosdisk_get_diskinfo_int13_extensions)
        popl    %esi
        popl    %ebx
        popl    %ebp
-       
+
        ret
 
 
 /*
  *   int grub_biosdisk_get_diskinfo_standard (int drive,
- *                                            unsigned long *cylinders, 
+ *                                            unsigned long *cylinders,
  *                                            unsigned long *heads,
  *                                            unsigned long *sectors)
  *
@@ -894,7 +894,7 @@ FUNCTION(grub_biosdisk_get_diskinfo_standard)
        /* push HEADS */
        pushl   %ecx
        /* SECTORS is on the stack */
-       
+
        /* drive */
        movb    %al, %dl
        /* enter real mode */
@@ -936,7 +936,7 @@ FUNCTION(grub_biosdisk_get_diskinfo_standard)
        andb    $0x3f, %cl
        movzbl  %cl, %eax
        movl    %eax, (%edi)
-       
+
        xorl    %eax, %eax
        movb    %bl, %al        /* return value in %eax */
 
@@ -955,20 +955,20 @@ FUNCTION(grub_biosdisk_get_num_floppies)
 
        xorl    %edx, %edx
        call    prot_to_real
-       
+
        .code16
        /* reset the disk system first */
        int     $0x13
 1:
        stc
-       
+
        /* call GET DISK TYPE */
        movb    $0x15, %ah
        int     $0x13
 
        jc      2f
 
-       /* check if this drive exists */        
+       /* check if this drive exists */
        testb   $0x3, %ah
        jz      2f
 
@@ -982,8 +982,8 @@ FUNCTION(grub_biosdisk_get_num_floppies)
        movl    %edx, %eax
        popl    %ebp
        ret
-       
-       
+
+
 /*
  *
  * grub_get_memsize(i) :  return the memory size in KB. i == 0 for conventional
@@ -1080,7 +1080,7 @@ FUNCTION(grub_get_mmap_entry)
 
        /* push ADDR */
        pushl   %eax
-       
+
        /* place address (+4) in ES:DI */
        addl    $4, %eax
        movl    %eax, %edi
@@ -1148,7 +1148,7 @@ xsmap:
        popl    %ebp
        ret
 
-       
+
 /*
  * void grub_console_real_putchar (int c)
  *
@@ -1167,7 +1167,7 @@ FUNCTION(grub_console_real_putchar)
        movl    %eax, %edx
        pusha
        movb    EXT_C(grub_console_cur_color), %bl
-       
+
        call    prot_to_real
        .code16
        movb    %dl, %al
@@ -1186,7 +1186,7 @@ FUNCTION(grub_console_real_putchar)
        /* save the character and the attribute on the stack */
        pushw   %ax
        pushw   %bx
-       
+
        /* get the current position */
        movb    $0x3, %ah
        int     $0x10
@@ -1194,22 +1194,22 @@ FUNCTION(grub_console_real_putchar)
        /* check the column with the width */
        cmpb    $79, %dl
        jl      2f
-       
-       /* print CR and LF, if next write will exceed the width */      
+
+       /* print CR and LF, if next write will exceed the width */
        movw    $0x0e0d, %ax
        int     $0x10
        movb    $0x0a, %al
        int     $0x10
-       
+
        /* get the current position */
        movb    $0x3, %ah
        int     $0x10
 
-2:     
+2:
        /* restore the character and the attribute */
        popw    %bx
        popw    %ax
-       
+
        /* write the character with the attribute */
        movb    $0x9, %ah
        movw    $1, %cx
@@ -1225,13 +1225,13 @@ FUNCTION(grub_console_real_putchar)
 1:     movw    $1, %bx
        movb    $0xe, %ah
        int     $0x10
-       
+
 3:     DATA32  call    real_to_prot
        .code32
-       
+
        popa
        ret
-       
+
 
 /*
  * int grub_console_getkey (void)
@@ -1254,7 +1254,7 @@ translation_table:
        .word   GRUB_CONSOLE_KEY_PPAGE, GRUB_TERM_PPAGE
        .word   GRUB_CONSOLE_KEY_NPAGE, GRUB_TERM_NPAGE
        .word   0
-       
+
 /*
  * translate_keycode translates the key code %dx to an ascii code.
  */
@@ -1263,14 +1263,14 @@ translation_table:
 translate_keycode:
        pushw   %bx
        pushw   %si
-       
+
 #ifdef APPLE_CC
        translation_table_abs = ABS (translation_table) - 0x10000
        movw    $(translation_table_abs), %si
 #else
        movw    $ABS(translation_table), %si
 #endif
-       
+
 1:     lodsw
        /* check if this is the end */
        testw   %ax, %ax
@@ -1289,7 +1289,7 @@ translate_keycode:
        ret
 
        .code32
-       
+
 FUNCTION(grub_console_getkey)
        pushl   %ebp
 
@@ -1317,7 +1317,7 @@ FUNCTION(grub_console_getkey)
 
        movw    %ax, %dx                /* real_to_prot uses %eax */
        call    translate_keycode
-               
+
        DATA32  call    real_to_prot
        .code32
 
@@ -1343,7 +1343,7 @@ FUNCTION(grub_console_getkey)
 FUNCTION(grub_console_checkkey)
        pushl   %ebp
        xorl    %edx, %edx
-       
+
        call    prot_to_real    /* enter real mode */
        .code16
 
@@ -1351,7 +1351,7 @@ FUNCTION(grub_console_checkkey)
        int     $0x16
 
        jz      notpending
-       
+
        movw    %ax, %dx
        DATA32  jmp     pending
 
@@ -1367,7 +1367,7 @@ pending:
        popl    %ebp
        ret
 
-       
+
 /*
  * grub_uint16_t grub_console_getxy (void)
  * BIOS call "INT 10H Function 03h" to get cursor position
@@ -1433,7 +1433,7 @@ FUNCTION(grub_console_gotoxy)
        popl    %ebp
        ret
 
-       
+
 /*
  * void grub_console_cls (void)
  * BIOS call "INT 10H Function 09h" to write character and attribute
@@ -1474,7 +1474,7 @@ FUNCTION(grub_console_cls)
        popl    %ebp
        ret
 
-       
+
 /*
  * void grub_console_setcursor (int on)
  * BIOS call "INT 10H Function 01h" to set cursor type
@@ -1487,14 +1487,14 @@ console_cursor_state:
        .byte   1
 console_cursor_shape:
        .word   0
-       
+
 FUNCTION(grub_console_setcursor)
        pushl   %ebp
        pushl   %ebx
 
        /* push ON */
        pushl   %eax
-       
+
        /* check if the standard cursor shape has already been saved */
        movw    console_cursor_shape, %ax
        testw   %ax, %ax
@@ -1518,12 +1518,12 @@ FUNCTION(grub_console_setcursor)
        testl   %eax, %eax
        jz      2f
        movw    console_cursor_shape, %cx
-2:     
+2:
        call    prot_to_real
        .code16
 
        movb    $0x1, %ah
-       int     $0x10 
+       int     $0x10
 
        DATA32  call    real_to_prot
        .code32
@@ -1531,7 +1531,7 @@ FUNCTION(grub_console_setcursor)
        popl    %ebx
        popl    %ebp
        ret
-               
+
 /*
  * grub_getrtsecs()
  *     if a seconds value can be read, read it and return it (BCD),
@@ -1572,7 +1572,7 @@ gottime:
        popl    %ebp
        ret
 
-       
+
 /*
  * grub_get_rtc()
  *     return the real time in ticks, of which there are about
@@ -1669,7 +1669,7 @@ FUNCTION(grub_vbe_bios_get_controller_info)
        xorw    %ax, %ax
        shrl    $4, %eax
        mov     %eax, %edx      /* prot_to_real destroys %eax.  */
-       
+
        call    prot_to_real
        .code16
 
@@ -1688,7 +1688,7 @@ FUNCTION(grub_vbe_bios_get_controller_info)
 
        movl    %edx, %eax
        andl    $0x0FFFF, %eax  /* Return value in %eax.  */
-       
+
        pop     %edx
        popl    %edi
        popl    %ebp
@@ -1770,7 +1770,7 @@ FUNCTION(grub_vbe_bios_set_mode)
 
        DATA32 call     real_to_prot
        .code32
-       
+
        movw    %dx, %ax
        andl    $0xFFFF, %eax   /* Return value in %eax.  */
 
@@ -1841,7 +1841,7 @@ FUNCTION(grub_vbe_bios_set_memory_window)
 
        DATA32 call     real_to_prot
        .code32
-       
+
        movw    %dx, %ax
        andl    $0xFFFF, %eax   /* Return value in %eax.  */
 
@@ -1914,7 +1914,7 @@ FUNCTION(grub_vbe_bios_set_scanline_length)
 
        DATA32 call     real_to_prot
        .code32
-       
+
        movw    %dx, %ax
        andl    $0xFFFF, %eax   /* Return value in %eax.  */
 
@@ -1977,7 +1977,7 @@ FUNCTION(grub_vbe_bios_set_display_start)
        .code16
 
        movw    $0x4f07, %ax
-       movw    $0x0080, %bx    /* BL = 80h, Set Display Start 
+       movw    $0x0080, %bx    /* BL = 80h, Set Display Start
                                   during Vertical Retrace.  */
        int     $0x10
 
@@ -1985,7 +1985,7 @@ FUNCTION(grub_vbe_bios_set_display_start)
 
        DATA32 call     real_to_prot
        .code32
-       
+
        movw    %dx, %ax
        andl    $0xFFFF, %eax   /* Return value in %eax.  */
 
@@ -2075,7 +2075,7 @@ FUNCTION(grub_vbe_bios_set_palette_data)
 
        DATA32 call     real_to_prot
        .code32
-       
+
        movw    %dx, %ax
        andl    $0xFFFF, %eax   /* Return value in %eax.  */
 
index 680353e58131692bc3c7b7016bc51a59814797ac..d28c5ca56ca495a0c4f92c63da59c0d4be680fec 100644 (file)
@@ -21,7 +21,7 @@
  * Note: These functions defined in this file may be called from C.
  *       Be careful of that you must not modify some registers. Quote
  *       from gcc-2.95.2/gcc/config/i386/i386.h:
-       
+
    1 for registers not available across function calls.
    These must include the FIXED_REGISTERS and also any
    registers that can be used without being saved.
@@ -84,7 +84,7 @@ gdt:
 
        /* -- data segment --
         * base = 0x00000000, limit 0xFFFFF (4 KiB Granularity), present
-        * type = 32 bit data read/write, DPL = 0 
+        * type = 32 bit data read/write, DPL = 0
         */
        .word   0xFFFF, 0
        .byte   0, 0x92, 0xCF, 0
index 4d3f05a26b6de84180815c95ae77893215f50f3b..36b35e27f796e7607ec1e3b6034991f9bc97fe0b 100644 (file)
@@ -1,6 +1,6 @@
 /* kern/i386/tsc.c - x86 TSC time source implementation
  * Requires Pentium or better x86 CPU that supports the RDTSC instruction.
- * This module uses the RTC (via grub_get_rtc()) to calibrate the TSC to 
+ * This module uses the RTC (via grub_get_rtc()) to calibrate the TSC to
  * real time.
  *
  *  GRUB  --  GRand Unified Bootloader
index f537b11ff3fe8e86863b32731ed26eee9db91ce9..37a98071cb24819026459cbb4e08ee19da3b0728 100644 (file)
@@ -125,7 +125,7 @@ grub_ieee1275_next_property (grub_ieee1275_phandle_t phandle, char *prev_prop,
 }
 
 int
-grub_ieee1275_get_property_length (grub_ieee1275_phandle_t phandle, 
+grub_ieee1275_get_property_length (grub_ieee1275_phandle_t phandle,
                                   const char *prop, grub_ssize_t *length)
 {
   struct get_property_args
@@ -164,7 +164,7 @@ grub_ieee1275_instance_to_package (grub_ieee1275_ihandle_t ihandle,
 
   INIT_IEEE1275_COMMON (&args.common, "instance-to-package", 1, 1);
   args.ihandle = ihandle;
-  
+
   if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
     return -1;
   *phandlep = args.phandle;
@@ -192,7 +192,7 @@ grub_ieee1275_package_to_path (grub_ieee1275_phandle_t phandle,
   args.phandle = phandle;
   args.buf = (grub_ieee1275_cell_t) path;
   args.buflen = (grub_ieee1275_cell_t) len;
-  
+
   if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
     return -1;
   if (actual)
@@ -221,7 +221,7 @@ grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle,
   args.ihandle = ihandle;
   args.buf = (grub_ieee1275_cell_t) path;
   args.buflen = (grub_ieee1275_cell_t) len;
-  
+
   if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
     return -1;
   if (actual)
@@ -232,7 +232,7 @@ grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle,
 }
 
 int
-grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, void *buffer, 
+grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, void *buffer,
                     grub_size_t len, grub_ssize_t *actualp)
 {
   struct write_args
@@ -517,7 +517,7 @@ grub_ieee1275_release (grub_addr_t addr, grub_size_t size)
   INIT_IEEE1275_COMMON (&args.common, "release", 2, 0);
   args.addr = addr;
   args.size = size;
-  
+
   if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
     return -1;
   return 0;
index 1082aad0f70d652bac55138e5e574b73fbc41d4c..9215d55e767f18238252c48126428303a7cf9ecd 100644 (file)
@@ -39,7 +39,7 @@ grub_module_iterate (int (*hook) (struct grub_module_header *header))
 
   modbase = grub_arch_modules_addr ();
   modinfo = (struct grub_module_info *) modbase;
-  
+
   /* Check if there are any modules.  */
   if ((modinfo == 0) || modinfo->magic != GRUB_MODULE_MAGIC)
     return;
@@ -100,7 +100,7 @@ grub_env_write_root (struct grub_env_var *var __attribute__ ((unused)),
 {
   /* XXX Is it better to check the existence of the device?  */
   grub_size_t len = grub_strlen (val);
-  
+
   if (val[0] == '(' && val[len - 1] == ')')
     return grub_strndup (val + 1, len - 2);
 
@@ -115,9 +115,9 @@ grub_set_root_dev (void)
 
   grub_register_variable_hook ("root", 0, grub_env_write_root);
   grub_env_export ("root");
-  
+
   prefix = grub_env_get ("prefix");
-  
+
   if (prefix)
     {
       char *dev;
@@ -137,7 +137,7 @@ grub_load_normal_mode (void)
 {
   /* Load the module.  */
   grub_dl_load ("normal");
-  
+
   /* Something went wrong.  Print errors here to let user know why we're entering rescue mode.  */
   grub_print_error ();
   grub_errno = 0;
@@ -170,7 +170,7 @@ grub_main (void)
   grub_register_core_commands ();
   grub_register_rescue_parser ();
   grub_register_rescue_reader ();
-  
+
   grub_load_config ();
   grub_load_normal_mode ();
   grub_reader_loop (0);
index 4b46c67627ab9c8dccbfe4bc435c623fc4cefdee..d8eff68837ce8773191adaddee7c590a8ac55b75 100644 (file)
@@ -37,11 +37,11 @@ grub_memmove (void *dest, const void *src, grub_size_t n)
     {
       d += n;
       s += n;
-      
+
       while (n--)
        *--d = *--s;
     }
-  
+
   return dest;
 }
 
@@ -77,7 +77,7 @@ char *
 grub_strncpy (char *dest, const char *src, int c)
 {
   char *p = dest;
-  
+
   while ((*p++ = *src++) != '\0' && --c)
     ;
 
@@ -138,13 +138,13 @@ grub_printf (const char *fmt, ...)
 {
   va_list ap;
   int ret;
-  
+
   va_start (ap, fmt);
   ret = grub_vprintf (fmt, ap);
   va_end (ap);
 
   return ret;
-}  
+}
 
 #if defined (APPLE_CC) && ! defined (GRUB_UTIL)
 int
@@ -152,13 +152,13 @@ grub_err_printf (const char *fmt, ...)
 {
        va_list ap;
        int ret;
-       
+
        va_start (ap, fmt);
        ret = grub_vprintf (fmt, ap);
        va_end (ap);
-       
+
        return ret;
-}  
+}
 #endif
 
 #if ! defined (APPLE_CC) && ! defined (GRUB_UTIL)
@@ -172,10 +172,10 @@ grub_real_dprintf (const char *file, const int line, const char *condition,
 {
   va_list args;
   const char *debug = grub_env_get ("debug");
-  
+
   if (! debug)
     return;
-  
+
   if (grub_strword (debug, "all") || grub_strword (debug, condition))
     {
       grub_printf ("%s:%d: ", file, line);
@@ -200,7 +200,7 @@ grub_memcmp (const void *s1, const void *s2, grub_size_t n)
 {
   const char *t1 = s1;
   const char *t2 = s2;
-  
+
   while (n--)
     {
       if (*t1 != *t2)
@@ -224,7 +224,7 @@ grub_strcmp (const char *s1, const char *s2)
     {
       if (*s1 != *s2)
        break;
-      
+
       s1++;
       s2++;
     }
@@ -237,12 +237,12 @@ grub_strncmp (const char *s1, const char *s2, grub_size_t n)
 {
   if (n == 0)
     return 0;
-  
+
   while (*s1 && *s2 && --n)
     {
       if (*s1 != *s2)
        break;
-      
+
       s1++;
       s2++;
     }
@@ -275,7 +275,7 @@ grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
     {
       if (grub_tolower (*s1) != grub_tolower (*s2))
        break;
-      
+
       s1++;
       s2++;
     }
@@ -326,7 +326,7 @@ grub_strstr (const char *haystack, const char *needle)
       /* Speed up the following searches of needle by caching its first
         character.  */
       char b = *needle++;
-      
+
       for (;; haystack++)
        {
          if (*haystack == '\0')
@@ -460,11 +460,11 @@ grub_strtoull (const char *str, char **end, int base)
 {
   unsigned long long num = 0;
   int found = 0;
-  
+
   /* Skip white spaces.  */
   while (*str && grub_isspace (*str))
     str++;
-  
+
   /* Guess the base, if not specified. The prefix `0x' means 16, and
      the prefix `0' means 8.  */
   if (str[0] == '0')
@@ -480,7 +480,7 @@ grub_strtoull (const char *str, char **end, int base)
       else if (base == 0 && str[1] >= '0' && str[1] <= '7')
        base = 8;
     }
-  
+
   if (base == 0)
     base = 10;
 
@@ -514,7 +514,7 @@ grub_strtoull (const char *str, char **end, int base)
       grub_error (GRUB_ERR_BAD_NUMBER, "unrecognized number");
       return 0;
     }
-  
+
   if (end)
     *end = (char *) str;
 
@@ -526,7 +526,7 @@ grub_strdup (const char *s)
 {
   grub_size_t len;
   char *p;
-  
+
   len = grub_strlen (s) + 1;
   p = (char *) grub_malloc (len);
   if (! p)
@@ -540,14 +540,14 @@ grub_strndup (const char *s, grub_size_t n)
 {
   grub_size_t len;
   char *p;
-  
+
   len = grub_strlen (s);
   if (len > n)
     len = n;
   p = (char *) grub_malloc (len + 1);
   if (! p)
     return 0;
-  
+
   grub_memcpy (p, s, len);
   p[len] = '\0';
   return p;
@@ -616,17 +616,17 @@ grub_divmod64 (grub_uint64_t n, grub_uint32_t d, grub_uint32_t *r)
 
       return ((grub_uint32_t) n) / d;
     }
-  
+
   while (bits--)
     {
       m <<= 1;
-      
+
       if (n & (1ULL << 63))
        m |= 1;
-      
+
       q <<= 1;
       n <<= 1;
-      
+
       if (m >= d)
        {
          q |= 1;
@@ -636,7 +636,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint32_t d, grub_uint32_t *r)
 
   if (r)
     *r = m;
-  
+
   return q;
 }
 
@@ -647,7 +647,7 @@ grub_lltoa (char *str, int c, unsigned long long n)
 {
   unsigned base = (c == 'x') ? 16 : 10;
   char *p;
-  
+
   if ((long long) n < 0 && c == 'd')
     {
       n = (unsigned long long) (-((long long) n));
@@ -668,12 +668,12 @@ grub_lltoa (char *str, int c, unsigned long long n)
     do
       {
        unsigned m;
-       
+
        n = grub_divmod64 (n, 10, &m);
        *p++ = m + '0';
       }
     while (n);
-  
+
   *p = 0;
 
   grub_reverse (str);
@@ -688,7 +688,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args)
   auto void write_char (unsigned char ch);
   auto void write_str (const char *s);
   auto void write_fill (const char ch, int n);
-  
+
   void write_char (unsigned char ch)
     {
       if (str)
@@ -711,7 +711,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args)
       for (i = 0; i < n; i++)
        write_char (ch);
     }
-  
+
   while ((c = *fmt++) != 0)
     {
       if (c != '%')
@@ -825,7 +825,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args)
              if (rightfill && grub_strlen (tmp) < format1)
                write_fill (zerofill, format1 - grub_strlen (tmp));
              break;
-             
+
            case 'c':
              n = va_arg (args, int);
              write_char (n & 0xff);
@@ -836,7 +836,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args)
                grub_uint32_t code = va_arg (args, grub_uint32_t);
                int shift;
                unsigned mask;
-               
+
                if (code <= 0x7f)
                  {
                    shift = 0;
@@ -875,7 +875,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args)
                  }
 
                write_char (mask | (code >> shift));
-               
+
                for (shift -= 6; shift >= 0; shift -= 6)
                  write_char (0x80 | (0x3f & (code >> shift)));
              }
@@ -901,7 +901,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args)
                }
              else
                write_str ("(null)");
-             
+
              break;
 
            default:
@@ -916,7 +916,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args)
 
   if (count && !str)
     grub_refresh ();
-  
+
   return count;
 }
 
@@ -925,7 +925,7 @@ grub_sprintf (char *str, const char *fmt, ...)
 {
   va_list ap;
   int ret;
-  
+
   va_start (ap, fmt);
   ret = grub_vsprintf (str, fmt, ap);
   va_end (ap);
@@ -950,7 +950,7 @@ grub_utf16_to_utf8 (grub_uint8_t *dest, grub_uint16_t *src,
            {
              /* Surrogate pair.  */
              code = ((code_high - 0xD800) << 12) + (code - 0xDC00) + 0x10000;
-             
+
              *dest++ = (code >> 18) | 0xF0;
              *dest++ = ((code >> 12) & 0x3F) | 0x80;
              *dest++ = ((code >> 6) & 0x3F) | 0x80;
@@ -1009,7 +1009,7 @@ grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
   grub_uint32_t *p = dest;
   int count = 0;
   grub_uint32_t code = 0;
-  
+
   if (srcend)
     *srcend = src;
 
@@ -1036,7 +1036,7 @@ grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
        {
          if (c == 0)
            break;
-         
+
          if ((c & 0x80) == 0x00)
            code = c;
          else if ((c & 0xe0) == 0xc0)
index ee6b169da60799520d6a7edc7175cfa2f52c59df..5e56ede91d7778f165859a03c2e55aa6e94361b8 100644 (file)
@@ -74,7 +74,7 @@ grub_parser_cmdline_state (grub_parser_state_t state, char c, char *result)
       if (transition->input == c)
        break;
 
-      if (transition->input == ' ' && ! grub_isalpha (c) 
+      if (transition->input == ' ' && ! grub_isalpha (c)
          && ! grub_isdigit (c) && c != '_')
        break;
 
@@ -136,7 +136,7 @@ grub_parser_split_cmdline (const char *cmdline, grub_reader_getline_t getline,
       vp = varname;
       if (! val)
        return;
-      
+
       /* Insert the contents of the variable in the buffer.  */
       for (; *val; val++)
        *(bp++) = *val;
@@ -156,7 +156,7 @@ grub_parser_split_cmdline (const char *cmdline, grub_reader_getline_t getline,
        {
          grub_parser_state_t newstate;
          char use;
-         
+
          newstate = grub_parser_cmdline_state (state, *rd, &use);
 
          /* If a variable was being processed and this character does
@@ -193,14 +193,14 @@ grub_parser_split_cmdline (const char *cmdline, grub_reader_getline_t getline,
   /* A special case for when the last character was part of a
      variable.  */
   add_var (GRUB_PARSER_STATE_TEXT);
-  
+
 
   /* Reserve memory for the return values.  */
   args = grub_malloc (bp - buffer);
   if (! args)
     return grub_errno;
   grub_memcpy (args, buffer, bp - buffer);
-  
+
   *argv = grub_malloc (sizeof (char *) * (*argc + 1));
   if (! *argv)
     {
index cb0e4f7b8fef6cf7848d8b2ccb91ac7c5fa401f4..4d5c63a95cbceb0afb90b39a68d028675bf8f0c1 100644 (file)
@@ -33,7 +33,7 @@ void
 grub_partition_map_unregister (grub_partition_map_t partmap)
 {
   grub_partition_map_t *p, q;
-  
+
   for (p = &grub_partition_map_list, q = *p; q; p = &(q->next), q = q->next)
     if (q == partmap)
       {
@@ -90,7 +90,7 @@ grub_partition_iterate (struct grub_disk *disk,
 {
   grub_partition_map_t partmap = 0;
   int ret = 0;
-  
+
   auto int part_map_iterate (const grub_partition_map_t p);
   auto int part_map_iterate_hook (grub_disk_t d,
                                  const grub_partition_t partition);
@@ -100,7 +100,7 @@ grub_partition_iterate (struct grub_disk *disk,
     {
       return 1;
     }
-  
+
   int part_map_iterate (const grub_partition_map_t p)
     {
       grub_dprintf ("partition", "Detecting %s...\n", p->name);
@@ -122,7 +122,7 @@ grub_partition_iterate (struct grub_disk *disk,
   grub_partition_map_iterate (part_map_iterate);
   if (partmap)
     ret = partmap->iterate (disk, hook);
-  
+
   return ret;
 }
 
index 0663a9634d5606c77b8f3d22791dd92b211361b7..ae987c0878281073e9d77866fe2cd7569b3b6845 100644 (file)
@@ -47,7 +47,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
   Elf32_Sym *symtab;
   Elf32_Word entsize;
   unsigned i;
-  
+
   /* Find a symbol table.  */
   for (i = 0, s = (Elf32_Shdr *) ((char *) e + e->e_shoff);
        i < e->e_shnum;
@@ -57,10 +57,10 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
 
   if (i == e->e_shnum)
     return grub_error (GRUB_ERR_BAD_MODULE, "no symtab found");
-  
+
   symtab = (Elf32_Sym *) ((char *) e + s->sh_offset);
   entsize = s->sh_entsize;
-  
+
   for (i = 0, s = (Elf32_Shdr *) ((char *) e + e->e_shoff);
        i < e->e_shnum;
        i++, s = (Elf32_Shdr *) ((char *) s + e->e_shentsize))
@@ -76,7 +76,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
        if (seg)
          {
            Elf32_Rela *rel, *max;
-           
+
            for (rel = (Elf32_Rela *) ((char *) e + s->sh_offset),
                   max = rel + s->sh_size / s->sh_entsize;
                 rel < max;
@@ -85,15 +85,15 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
                Elf32_Word *addr;
                Elf32_Sym *sym;
                grub_uint32_t value;
-               
+
                if (seg->size < rel->r_offset)
                  return grub_error (GRUB_ERR_BAD_MODULE,
                                     "reloc offset is out of the segment");
-               
+
                addr = (Elf32_Word *) ((char *) seg->addr + rel->r_offset);
                sym = (Elf32_Sym *) ((char *) symtab
                                     + entsize * ELF32_R_SYM (rel->r_info));
-               
+
                /* On the PPC the value does not have an explicit
                   addend, add it.  */
                value = sym->st_value + rel->r_addend;
@@ -102,29 +102,29 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
                  case R_PPC_ADDR16_LO:
                    *(Elf32_Half *) addr = value;
                    break;
-                   
+
                  case R_PPC_REL24:
                    {
                      Elf32_Sword delta = value - (Elf32_Word) addr;
-                     
+
                      if (delta << 6 >> 6 != delta)
                        return grub_error (GRUB_ERR_BAD_MODULE, "Relocation overflow");
                      *addr = (*addr & 0xfc000003) | (delta & 0x3fffffc);
                      break;
                    }
-                   
+
                  case R_PPC_ADDR16_HA:
                    *(Elf32_Half *) addr = (value + 0x8000) >> 16;
                    break;
-                   
+
                  case R_PPC_ADDR32:
                    *addr = value;
                    break;
-                   
+
                  case R_PPC_REL32:
                    *addr = value - (Elf32_Word) addr;
                    break;
-                   
+
                  default:
                    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
                                       "This relocation (%d) is not implemented yet",
@@ -133,6 +133,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
              }
          }
       }
-  
+
   return GRUB_ERR_NONE;
 }
index 29b8c8a9a0530aa31279ec5745251d66f36ff67d..d998dafe8b30f4594d47e660d0cb837a925c149d 100644 (file)
@@ -47,7 +47,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
   Elf64_Sym *symtab;
   Elf64_Word entsize;
   unsigned i;
-  
+
   /* Find a symbol table.  */
   for (i = 0, s = (Elf64_Shdr *) ((char *) e + e->e_shoff);
        i < e->e_shnum;
@@ -57,10 +57,10 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
 
   if (i == e->e_shnum)
     return grub_error (GRUB_ERR_BAD_MODULE, "no symtab found");
-  
+
   symtab = (Elf64_Sym *) ((char *) e + s->sh_offset);
   entsize = s->sh_entsize;
-  
+
   for (i = 0, s = (Elf64_Shdr *) ((char *) e + e->e_shoff);
        i < e->e_shnum;
        i++, s = (Elf64_Shdr *) ((char *) s + e->e_shentsize))
@@ -76,7 +76,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
        if (seg)
          {
            Elf64_Rela *rel, *max;
-           
+
            for (rel = (Elf64_Rela *) ((char *) e + s->sh_offset),
                   max = rel + s->sh_size / s->sh_entsize;
                 rel < max;
@@ -85,11 +85,11 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
                Elf64_Word *addr;
                Elf64_Sym *sym;
                Elf64_Addr value;
-               
+
                if (seg->size < rel->r_offset)
                  return grub_error (GRUB_ERR_BAD_MODULE,
                                     "reloc offset is out of the segment");
-               
+
                addr = (Elf64_Word *) ((char *) seg->addr + rel->r_offset);
                sym = (Elf64_Sym *) ((char *) symtab
                                     + entsize * ELF64_R_SYM (rel->r_info));
@@ -139,6 +139,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
              }
          }
       }
-  
+
   return GRUB_ERR_NONE;
 }
index c7c46cf9463efffda651b17960dc676498a0ae44..3583a301d2468d5d4620827436e8ee24e497aa26 100644 (file)
@@ -35,12 +35,12 @@ struct grub_handler_class grub_term_input_class =
       {
     .name = "terminal_input"
   };
-  
+
 struct grub_handler_class grub_term_output_class =
       {
     .name = "terminal_output"
   };
-  
+
 #define grub_cur_term_input    grub_term_get_current_input ()
 #define grub_cur_term_output   grub_term_get_current_output ()
 
@@ -53,16 +53,16 @@ grub_putcode (grub_uint32_t code)
   if (code == '\t' && grub_cur_term_output->getxy)
     {
       int n;
-      
+
       n = 8 - ((grub_getxy () >> 8) & 7);
       while (n--)
        grub_putcode (' ');
 
       return;
     }
-  
+
   (grub_cur_term_output->putchar) (code);
-  
+
   if (code == '\n')
     {
       grub_putcode ('\r');
@@ -81,12 +81,12 @@ grub_putcode (grub_uint32_t code)
          grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
 
          key = grub_getkey ();
-         
+
          /* Remove the message.  */
          grub_gotoxy (1, height - 1);
          grub_printf ("        ");
          grub_gotoxy (pos >> 8, pos & 0xFF);
-         
+
          /* Scroll one lines or an entire page, depending on the key.  */
          if (key == '\r' || key =='\n')
            grub_more_lines--;
@@ -108,7 +108,7 @@ grub_putchar (int c)
 
   buf[size++] = c;
   ret = grub_utf8_to_ucs4 (&code, 1, buf, size, 0);
-  
+
   if (ret > 0)
     {
       size = 0;
@@ -201,7 +201,7 @@ grub_setcursor (int on)
       (grub_cur_term_output->setcursor) (on);
       cursor_state = on;
     }
-  
+
   return ret;
 }
 
index f15c9e1e4bc832f15224522cd8eb64b0b1538ab2..311927bd83364bf4ceb035262c6d103817b0199c 100644 (file)
@@ -35,14 +35,14 @@ grub_envblk_open (char *buf, grub_size_t size)
       grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid environment block");
       return 0;
     }
-  
+
   envblk = grub_malloc (sizeof (*envblk));
   if (envblk)
     {
       envblk->buf = buf;
       envblk->size = size;
     }
-  
+
   return envblk;
 }
 
@@ -58,7 +58,7 @@ escaped_value_len (const char *value)
 {
   int n = 0;
   char *p;
-  
+
   for (p = (char *) value; *p; p++)
     {
       if (*p == '\\' || *p == '\n')
@@ -66,7 +66,7 @@ escaped_value_len (const char *value)
       else
         n++;
     }
-  
+
   return n;
 }
 
@@ -82,7 +82,7 @@ find_next_line (char *p, const char *pend)
       else
         p++;
     }
-  
+
   return p + 1;
 }
 
@@ -100,7 +100,7 @@ grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value)
   vl = escaped_value_len (value);
   p = envblk->buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1;
   pend = envblk->buf + envblk->size;
-  
+
   /* First, look at free space.  */
   for (space = pend - 1; *space == '#'; space--)
     ;
@@ -116,10 +116,10 @@ grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value)
       if (grub_memcmp (p, name, nl) == 0 && p[nl] == '=')
         {
           int len;
-          
+
           /* Found the same name.  */
           p += nl + 1;
-          
+
           /* Check the length of the current value.  */
           len = 0;
           while (p + len < pend && p[len] != '\n')
@@ -159,7 +159,7 @@ grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value)
   if (! found)
     {
       /* Append a new variable.  */
-      
+
       if (pend - space < nl + 1 + vl + 1)
         /* No space.  */
         return 0;
@@ -174,7 +174,7 @@ grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value)
     {
       if (value[i] == '\\' || value[i] == '\n')
         *p++ = '\\';
-      
+
       *p++ = value[i];
     }
 
@@ -220,7 +220,7 @@ grub_envblk_delete (grub_envblk_t envblk, const char *name)
         }
 
       p = find_next_line (p, pend);
-    }      
+    }
 }
 
 void
@@ -261,7 +261,7 @@ grub_envblk_iterate (grub_envblk_t envblk,
               else
                 p++;
             }
-          
+
           if (p >= pend)
             /* Broken.  */
             return;
@@ -272,10 +272,10 @@ grub_envblk_iterate (grub_envblk_t envblk,
             return;
 
           value = name + (value_start - name_start);
-          
+
           grub_memcpy (name, name_start, name_end - name_start);
           name[name_end - name_start] = '\0';
-          
+
           for (p = value_start, q = value; *p != '\n'; ++p)
             {
               if (*p == '\\')
@@ -284,13 +284,13 @@ grub_envblk_iterate (grub_envblk_t envblk,
                 *q++ = *p;
             }
           *q = '\0';
-          
+
           ret = hook (name, value);
           grub_free (name);
           if (ret)
             return;
         }
-      
+
       p = find_next_line (p, pend);
     }
 }
index ba38bd2a8814de35413a87f6b6d63b900b6db640..a2002ae3d49c9d043a283bfdfa8961d4b33efb91 100644 (file)
@@ -19,9 +19,9 @@
 #include <grub/symbol.h>
 
        .file   "setjmp.S"
-       
+
        .text
-       
+
 /*
  * int grub_setjmp (grub_jmp_buf env)
  */
@@ -36,7 +36,7 @@ FUNCTION(grub_setjmp)
        xorl    %eax, %eax
        jmp     *%ecx
 
-               
+
 /*
  * int grub_longjmp (grub_jmp_buf env, int val)
  */
@@ -53,4 +53,4 @@ FUNCTION(grub_longjmp)
        jnz     1f
        incl    %eax
 1:     jmp     *%ecx
-       
+
index a467ea325abdd9720c71e512814e06391e43412f..01acc41352a7e2860cc019f3ca56b6eb46b895a6 100644 (file)
@@ -45,7 +45,7 @@ static grub_err_t
 grub_chainloader_unload (void)
 {
   grub_efi_boot_services_t *b;
-  
+
   b = grub_efi_system_table->boot_services;
   efi_call_1 (b->unload_image, image_handle);
   efi_call_2 (b->free_pages, address, pages);
@@ -53,7 +53,7 @@ grub_chainloader_unload (void)
   grub_free (file_path);
   grub_free (cmdline);
   cmdline = 0;
-  
+
   grub_dl_unref (my_mod);
   return GRUB_ERR_NONE;
 }
@@ -65,7 +65,7 @@ grub_chainloader_boot (void)
   grub_efi_status_t status;
   grub_efi_uintn_t exit_data_size;
   grub_efi_char16_t *exit_data;
-  
+
   b = grub_efi_system_table->boot_services;
   status = efi_call_3 (b->start_image, image_handle, &exit_data_size, &exit_data);
   if (status != GRUB_EFI_SUCCESS)
@@ -73,13 +73,13 @@ grub_chainloader_boot (void)
       if (exit_data)
        {
          char *buf;
-         
+
          buf = grub_malloc (exit_data_size * 4 + 1);
          if (buf)
            {
              *grub_utf16_to_utf8 ((grub_uint8_t *) buf,
                                   exit_data, exit_data_size) = 0;
-             
+
              grub_error (GRUB_ERR_BAD_OS, buf);
              grub_free (buf);
            }
@@ -92,7 +92,7 @@ grub_chainloader_boot (void)
     efi_call_1 (b->free_pool, exit_data);
 
   grub_chainloader_unload ();
-  
+
   return grub_errno;
 }
 
@@ -102,7 +102,7 @@ copy_file_path (grub_efi_file_path_device_path_t *fp,
 {
   grub_efi_char16_t *p;
   grub_efi_uint16_t size;
-  
+
   fp->header.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE;
   fp->header.subtype = GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE;
   size = len * sizeof (grub_efi_char16_t) + sizeof (*fp);
@@ -135,7 +135,7 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename)
       grub_error (GRUB_ERR_BAD_FILENAME, "invalid EFI file path");
       return 0;
     }
-  
+
   size = 0;
   d = dp;
   while (1)
@@ -145,7 +145,7 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename)
        break;
       d = GRUB_EFI_NEXT_DEVICE_PATH (d);
     }
-  
+
   file_path = grub_malloc (size
                           + ((grub_strlen (dir_start) + 1)
                              * sizeof (grub_efi_char16_t))
@@ -154,7 +154,7 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename)
     return 0;
 
   grub_memcpy (file_path, dp, size);
-  
+
   /* Fill the file path for the directory.  */
   d = (grub_efi_device_path_t *) ((char *) file_path
                                  + ((char *) d - (char *) dp));
@@ -194,14 +194,14 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
   if (argc == 0)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified");
   filename = argv[0];
-  
+
   grub_dl_ref (my_mod);
 
   /* Initialize some global variables.  */
   address = 0;
   image_handle = 0;
   file_path = 0;
-  
+
   b = grub_efi_system_table->boot_services;
 
   file = grub_file_open (filename);
@@ -219,7 +219,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
       if (dev_handle)
        dp = grub_efi_get_device_path (dev_handle);
     }
-  
+
   if (! dev->disk || ! dev_handle || ! dp)
     {
       grub_error (GRUB_ERR_BAD_DEVICE, "not a valid root device");
@@ -232,10 +232,10 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
 
   grub_printf ("file path: ");
   grub_efi_print_device_path (file_path);
-  
+
   size = grub_file_size (file);
   pages = (((grub_efi_uintn_t) size + ((1 << 12) - 1)) >> 12);
-  
+
   status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ANY_PAGES,
                              GRUB_EFI_LOADER_CODE,
                              pages, &address);
@@ -262,7 +262,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
        grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of resources");
       else
        grub_error (GRUB_ERR_BAD_OS, "cannot load image");
-      
+
       goto fail;
     }
 
@@ -276,7 +276,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
       goto fail;
     }
   loaded_image->device_handle = dev_handle;
-  
+
   grub_file_close (file);
 
   if (argc > 1)
@@ -310,21 +310,21 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
 
   grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0);
   return 0;
-  
+
  fail:
 
   if (dev)
     grub_device_close (dev);
-  
+
   if (file)
     grub_file_close (file);
 
   if (file_path)
     grub_free (file_path);
-  
+
   if (address)
     efi_call_2 (b->free_pages, address, pages);
-  
+
   grub_dl_unref (my_mod);
 
   return grub_errno;
index ab3a6353ce192a7d86b101aa1523b63b13b9eba8..729cc880a86072bf595ed9212e7e737a061b36e9 100644 (file)
@@ -168,7 +168,7 @@ grub_freebsd_add_mmap (void)
   int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size,
                             grub_uint32_t type)
     {
-      /* FreeBSD assumes that first 64KiB are available. 
+      /* FreeBSD assumes that first 64KiB are available.
         Not always true but try to prevent panic somehow. */
       if (isfirstrun && addr != 0)
        {
@@ -180,7 +180,7 @@ grub_freebsd_add_mmap (void)
              mmap++;
            }
          else
-           len += sizeof (struct grub_e820_mmap);        
+           len += sizeof (struct grub_e820_mmap);
        }
       isfirstrun = 0;
       if (mmap)
@@ -242,9 +242,9 @@ grub_freebsd_add_mmap (void)
   for (i = 0; i < mmap - mmap_buf; i++)
     grub_dprintf ("bsd", "smap %d, %d:%llx - %llx\n", i,
                  mmap_buf[i].type,
-                 (unsigned long long) mmap_buf[i].addr, 
+                 (unsigned long long) mmap_buf[i].addr,
                  (unsigned long long) mmap_buf[i].size);
-       
+
   grub_dprintf ("bsd", "%d entries in smap\n", mmap - mmap_buf);
   grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA |
                         FREEBSD_MODINFOMD_SMAP, mmap_buf, len);
@@ -286,12 +286,12 @@ grub_freebsd_add_meta_module (int is_kern, int argc, char **argv,
 
   if (is_64bit)
     {
-      grub_uint64_t addr64 = addr, size64 = size; 
+      grub_uint64_t addr64 = addr, size64 = size;
       if ((grub_freebsd_add_meta (FREEBSD_MODINFO_TYPE, type,
                              grub_strlen (type) + 1)) ||
-         (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr64, 
+         (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr64,
                                  sizeof (addr64))) ||
-         (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size64, 
+         (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size64,
                                  sizeof (size64))))
        return grub_errno;
     }
@@ -299,9 +299,9 @@ grub_freebsd_add_meta_module (int is_kern, int argc, char **argv,
     {
       if ((grub_freebsd_add_meta (FREEBSD_MODINFO_TYPE, type,
                                  grub_strlen (type) + 1)) ||
-         (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr, 
+         (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr,
                                  sizeof (addr))) ||
-         (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size, 
+         (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size,
                                  sizeof (size))))
        return grub_errno;
     }
@@ -502,22 +502,22 @@ grub_freebsd_boot (void)
       gdtdesc->base = gdt;
 
       /* Prepare trampoline. */
-      trampoline = (grub_uint8_t *) (kern_end - 4096 + 24 
+      trampoline = (grub_uint8_t *) (kern_end - 4096 + 24
                                     + sizeof (struct gdt_descriptor));
-      launch_trampoline = (void  __attribute__ ((cdecl, regparm (0))) 
+      launch_trampoline = (void  __attribute__ ((cdecl, regparm (0)))
                           (*) (grub_addr_t entry, ...)) trampoline;
       grub_bsd64_trampoline_gdt = (grub_uint32_t) gdtdesc;
-      grub_bsd64_trampoline_selfjump 
+      grub_bsd64_trampoline_selfjump
        = (grub_uint32_t) (trampoline + 6
-                          + ((grub_uint8_t *) &grub_bsd64_trampoline_selfjump 
+                          + ((grub_uint8_t *) &grub_bsd64_trampoline_selfjump
                              - &grub_bsd64_trampoline_start));
 
       /* Copy trampoline. */
-      grub_memcpy (trampoline, &grub_bsd64_trampoline_start, 
+      grub_memcpy (trampoline, &grub_bsd64_trampoline_start,
                   &grub_bsd64_trampoline_end - &grub_bsd64_trampoline_start);
 
       /* Launch trampoline. */
-      launch_trampoline (entry, entry_hi, pagetable, bi.bi_modulep, 
+      launch_trampoline (entry, entry_hi, pagetable, bi.bi_modulep,
                         kern_end);
     }
   else
@@ -547,7 +547,7 @@ grub_openbsd_boot (void)
         case GRUB_MACHINE_MEMORY_AVAILABLE:
          pm->type = OPENBSD_MMAP_AVAILABLE;
          break;
-         
+
        default:
          pm->type = OPENBSD_MMAP_RESERVED;
          break;
@@ -574,7 +574,7 @@ grub_openbsd_boot (void)
             (part << OPENBSD_B_PARTSHIFT));
 
   grub_unix_real_boot (entry, bootflags, bootdev, OPENBSD_BOOTARG_APIVER,
-                      0, grub_mmap_get_upper () >> 10, 
+                      0, grub_mmap_get_upper () >> 10,
                       grub_mmap_get_lower () >> 10,
                       (char *) pa - buf, buf);
 
@@ -603,7 +603,7 @@ grub_netbsd_boot (void)
   bootinfo->bi_data[0] = rootdev;
 
   grub_unix_real_boot (entry, bootflags, 0, bootinfo,
-                      0, grub_mmap_get_upper () >> 10, 
+                      0, grub_mmap_get_upper () >> 10,
                       grub_mmap_get_lower () >> 10);
 
   /* Not reached.  */
index 23c86109c0b93aa80be3fc8d982ec7d5584573f9..25aee3a8051be06101e64ff611fab3ab3a99fdaf 100644 (file)
@@ -17,9 +17,9 @@
  */
 
 #include <grub/symbol.h>
-       
+
        .p2align        2
-       
+
 
        .code32
 
index 754f6f072ca5e6b77ca558dfd6184d89813e924b..0fd393707ac49b61618a6f94de8de517826472bc 100644 (file)
@@ -17,7 +17,7 @@
  *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/* Based on the code from FreeBSD originally distributed under the 
+/* Based on the code from FreeBSD originally distributed under the
    following terms: */
 
 /*-
@@ -63,12 +63,12 @@ fill_bsd64_pagetable (grub_uint8_t *target)
   pt4 = (grub_uint64_t *) target;
   pt3 = (grub_uint64_t *) (target + 4096);
   pt2 = (grub_uint64_t *) (target + 8192);
-  
+
   grub_memset ((char *) target, 0, 4096 * 3);
 
   /*
    * This is kinda brutal, but every single 1GB VM memory segment points to
-   * the same first 1GB of physical memory.  But it is how BSD expects 
+   * the same first 1GB of physical memory.  But it is how BSD expects
    * it to be.
    */
   for (i = 0; i < 512; i++)
@@ -80,7 +80,7 @@ fill_bsd64_pagetable (grub_uint8_t *target)
       /* Each slot of the level 3 pages points to the same level 2 page */
       pt3[i] = (grub_addr_t) &pt2[0];
       pt3[i] |= PG_V | PG_RW | PG_U;
-      
+
       /* The level 2 page slots are mapped with 2MB pages for 1GB. */
       pt2[i] = i * (2 * 1024 * 1024);
       pt2[i] |= PG_V | PG_RW | PG_PS | PG_U;
index 577ddb8295fceeafd08dba9771f4cfcd4a4383fe..a568fff4d25fbd292aac64b1d7aa48668d90021d 100644 (file)
@@ -17,7 +17,7 @@
  *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/* Based on the code from FreeBSD originally distributed under the 
+/* Based on the code from FreeBSD originally distributed under the
    following terms: */
 
 /*-
@@ -48,7 +48,7 @@
  * $FreeBSD$
  */
 
-       
+
 #define MSR_EFER       0xc0000080
 #define EFER_LME       0x00000100
 #define CR4_PAE                0x00000020
 #include <grub/symbol.h>
 
        .p2align        2
-       
-       .code32 
 
-       
+       .code32
+
+
 VARIABLE(grub_bsd64_trampoline_start)
 
        /* Discard `grub_unix_real_boot' return address.  */
@@ -105,7 +105,7 @@ VARIABLE(grub_bsd64_trampoline_start)
        .byte 0x15
 VARIABLE (grub_bsd64_trampoline_gdt)
        .long 0x0
-       
+
        /* ljmp */
        .byte 0xea
 VARIABLE (grub_bsd64_trampoline_selfjump)
index dae0f6dcdf4a0edbd1dbe77d0e4c523d8fa858f2..97a693e96384cd07d5399d2ce8aeaeb2e019abaa 100644 (file)
@@ -103,21 +103,21 @@ find_mmap_size (void)
 
   if (mmap_size != 0)
     return mmap_size;
-  
+
   mmap_size = (1 << 12);
   while (1)
     {
       int ret;
       grub_efi_memory_descriptor_t *mmap;
       grub_efi_uintn_t desc_size;
-      
+
       mmap = grub_malloc (mmap_size);
       if (! mmap)
        return 0;
 
       ret = grub_efi_get_memory_map (&mmap_size, mmap, 0, &desc_size, 0);
       grub_free (mmap);
-      
+
       if (ret < 0)
        grub_fatal ("cannot get memory map");
       else if (ret > 0)
@@ -147,7 +147,7 @@ free_pages (void)
       grub_efi_free_pages ((grub_addr_t) prot_mode_mem, prot_mode_pages);
       prot_mode_mem = 0;
     }
-  
+
   if (initrd_mem)
     {
       grub_efi_free_pages ((grub_addr_t) initrd_mem, initrd_pages);
@@ -165,7 +165,7 @@ allocate_pages (grub_size_t prot_size)
   grub_efi_uintn_t mmap_size, tmp_mmap_size;
   grub_efi_memory_descriptor_t *desc;
   grub_size_t real_size;
-  
+
   /* Make sure that each size is aligned to a page boundary.  */
   real_size = GRUB_LINUX_CL_END_OFFSET;
   prot_size = page_align (prot_size);
@@ -173,16 +173,16 @@ allocate_pages (grub_size_t prot_size)
 
   grub_dprintf ("linux", "real_size = %x, prot_size = %x, mmap_size = %x\n",
                (unsigned) real_size, (unsigned) prot_size, (unsigned) mmap_size);
-  
+
   /* Calculate the number of pages; Combine the real mode code with
      the memory map buffer for simplicity.  */
   real_mode_pages = ((real_size + mmap_size) >> 12);
   prot_mode_pages = (prot_size >> 12);
-  
+
   /* Initialize the memory pointers with NULL for convenience.  */
   real_mode_mem = 0;
   prot_mode_mem = 0;
-  
+
   /* Read the memory map temporarily, to find free space.  */
   mmap = grub_malloc (mmap_size);
   if (! mmap)
@@ -193,7 +193,7 @@ allocate_pages (grub_size_t prot_size)
     grub_fatal ("cannot get memory map");
 
   mmap_end = NEXT_MEMORY_DESCRIPTOR (mmap, tmp_mmap_size);
-  
+
   /* First, find free pages for the real mode code
      and the memory map buffer.  */
   for (desc = mmap;
@@ -208,7 +208,7 @@ allocate_pages (grub_size_t prot_size)
        {
          grub_efi_physical_address_t physical_end;
          grub_efi_physical_address_t addr;
-         
+
          physical_end = desc->physical_start + (desc->num_pages << 12);
          if (physical_end > 0x90000)
            physical_end = 0x90000;
@@ -225,7 +225,7 @@ allocate_pages (grub_size_t prot_size)
          real_mode_mem = grub_efi_allocate_pages (addr, real_mode_pages);
          if (! real_mode_mem)
            grub_fatal ("cannot allocate pages");
-         
+
          desc->num_pages -= real_mode_pages;
          break;
        }
@@ -238,7 +238,7 @@ allocate_pages (grub_size_t prot_size)
     }
 
   mmap_buf = (void *) ((char *) real_mode_mem + real_size);
-             
+
   /* Next, find free pages for the protected mode code.  */
   /* XXX what happens if anything is using this address?  */
   prot_mode_mem = grub_efi_allocate_pages (0x100000, prot_mode_pages + 1);
@@ -299,7 +299,7 @@ grub_linux_boot (void)
   grub_efi_uintn_t desc_size;
   grub_efi_uint32_t desc_version;
   int e820_num;
-  
+
   params = real_mode_mem;
 
   grub_dprintf ("linux", "code32_start = %x, idt_desc = %lx, gdt_desc = %lx\n",
@@ -382,12 +382,12 @@ grub_linux_boot (void)
     }
 
 #ifdef __x86_64__
-  
-  grub_memcpy ((char *) prot_mode_mem + (prot_mode_pages << 12), 
-              grub_linux_trampoline_start, 
+
+  grub_memcpy ((char *) prot_mode_mem + (prot_mode_pages << 12),
+              grub_linux_trampoline_start,
               grub_linux_trampoline_end - grub_linux_trampoline_start);
-  
-  ((void (*) (unsigned long, void *)) ((char *) prot_mode_mem 
+
+  ((void (*) (unsigned long, void *)) ((char *) prot_mode_mem
                                      + (prot_mode_pages << 12)))
     (params->code32_start, real_mode_mem);
 
@@ -395,7 +395,7 @@ grub_linux_boot (void)
 
   /* Hardware interrupts are not safe any longer.  */
   asm volatile ("cli" : : );
-  
+
   /* Load the IDT and the GDT for the bootstrap.  */
   asm volatile ("lidt %0" : : "m" (idt_desc));
   asm volatile ("lgdt %0" : : "m" (gdt_desc));
@@ -408,7 +408,7 @@ grub_linux_boot (void)
 
   /* Enter Linux.  */
   asm volatile ("jmp *%%ecx" : : );
-  
+
 #endif
 
   /* Never reach here.  */
@@ -605,7 +605,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
   char *dest;
 
   grub_dl_ref (my_mod);
-  
+
   if (argc == 0)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified");
@@ -650,17 +650,17 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
     }
 
   setup_sects = lh.setup_sects;
-  
+
   /* If SETUP_SECTS is not set, set it to the default (4).  */
   if (! setup_sects)
     setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS;
 
   real_size = setup_sects << GRUB_DISK_SECTOR_BITS;
   prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE;
-  
+
   if (! allocate_pages (prot_size))
     goto fail;
-  
+
   params = (struct linux_kernel_params *) real_mode_mem;
   grub_memset (params, 0, GRUB_LINUX_CL_END_OFFSET);
   grub_memcpy (&params->setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1);
@@ -691,7 +691,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
      space.  */
   params->ext_mem = ((32 * 0x100000) >> 10);
   params->alt_mem = ((32 * 0x100000) >> 10);
-  
+
   params->video_cursor_x = grub_getxy () >> 8;
   params->video_cursor_y = grub_getxy () & 0xff;
   params->video_page = 0; /* ??? */
@@ -778,7 +778,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
   grub_memset (params->padding7, 0, sizeof (params->padding7));
   grub_memset (params->padding8, 0, sizeof (params->padding8));
   grub_memset (params->padding9, 0, sizeof (params->padding9));
-  
+
 #endif
 
   /* The other EFI parameters are filled when booting.  */
@@ -797,9 +797,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
     if (grub_memcmp (argv[i], "mem=", 4) == 0)
       {
        char *val = argv[i] + 4;
-         
+
        linux_mem_size = grub_strtoul (val, &val, 0);
-       
+
        if (grub_errno)
          {
            grub_errno = GRUB_ERR_NONE;
@@ -808,7 +808,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
        else
          {
            int shift = 0;
-           
+
            switch (grub_tolower (val[0]))
              {
              case 'g':
@@ -838,7 +838,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
   dest = grub_stpcpy ((char *) real_mode_mem + GRUB_LINUX_CL_OFFSET,
                      "BOOT_IMAGE=");
   dest = grub_stpcpy (dest, argv[0]);
-  
+
   /* Copy kernel parameters.  */
   for (i = 1;
        i < argc
@@ -861,7 +861,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
     }
 
  fail:
-  
+
   if (file)
     grub_file_close (file);
 
@@ -886,13 +886,13 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
   grub_efi_memory_descriptor_t *desc;
   grub_efi_uintn_t desc_size;
   struct linux_kernel_header *lh;
-  
+
   if (argc == 0)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified");
       goto fail;
     }
-  
+
   if (! loaded)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first.");
@@ -907,11 +907,11 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
   initrd_pages = (page_align (size) >> 12);
 
   lh = (struct linux_kernel_header *) real_mode_mem;
-  
+
   addr_max = (grub_cpu_to_le32 (lh->initrd_addr_max) << 10);
   if (linux_mem_size != 0 && linux_mem_size < addr_max)
     addr_max = linux_mem_size;
-  
+
   /* Linux 2.3.xx has a bug in the memory range check, so avoid
      the last page.
      Linux 2.2.xx has a bug in the memory range check, which is
@@ -921,7 +921,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
   /* Usually, the compression ratio is about 50%.  */
   addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12)
             + page_align (size);
-  
+
   /* Find the highest address to put the initrd.  */
   mmap_size = find_mmap_size ();
   if (grub_efi_get_memory_map (&mmap_size, mmap_buf, 0, &desc_size, 0) <= 0)
@@ -936,7 +936,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
          && desc->num_pages >= initrd_pages)
        {
          grub_efi_physical_address_t physical_end;
-         
+
          physical_end = desc->physical_start + (desc->num_pages << 12);
          if (physical_end > addr_max)
            physical_end = addr_max;
@@ -958,11 +958,11 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
       grub_error (GRUB_ERR_OUT_OF_MEMORY, "no free pages available");
       goto fail;
     }
-  
+
   initrd_mem = grub_efi_allocate_pages (addr, initrd_pages);
   if (! initrd_mem)
     grub_fatal ("cannot allocate pages");
-  
+
   if (grub_file_read (file, initrd_mem, size) != size)
     {
       grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
@@ -971,11 +971,11 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
 
   grub_printf ("   [Initrd, addr=0x%x, size=0x%x]\n",
               (unsigned) addr, (unsigned) size);
-  
+
   lh->ramdisk_image = addr;
   lh->ramdisk_size = size;
   lh->root_dev = 0x0100; /* XXX */
-  
+
  fail:
   if (file)
     grub_file_close (file);
index 3b1f2f08d220ec794968b6461e71169e4d2b15c2..4ef88cb8fea4f8ec405940db8ee578cf40b77157 100644 (file)
@@ -285,15 +285,15 @@ find_mmap_size (void)
       count++;
       return 0;
     }
-  
+
   grub_mmap_iterate (hook);
-  
+
   mmap_size = count * sizeof (struct grub_e820_mmap);
 
   /* Increase the size a bit for safety, because GRUB allocates more on
      later.  */
   mmap_size += (1 << 12);
-  
+
   return page_align (mmap_size);
 }
 
@@ -317,15 +317,15 @@ allocate_pages (grub_size_t prot_size)
 
   grub_dprintf ("linux", "real_size = %x, prot_size = %x, mmap_size = %x\n",
                (unsigned) real_size, (unsigned) prot_size, (unsigned) mmap_size);
-  
+
   /* Calculate the number of pages; Combine the real mode code with
      the memory map buffer for simplicity.  */
   real_mode_pages = ((real_size + mmap_size) >> 12);
   prot_mode_pages = (prot_size >> 12);
-  
+
   /* Initialize the memory pointers with NULL for convenience.  */
   free_pages ();
-  
+
   /* FIXME: Should request low memory from the heap when this feature is
      implemented.  */
 
@@ -451,11 +451,11 @@ grub_linux_boot (void)
 
   modevar = grub_env_get ("gfxpayload");
 
-  /* Now all graphical modes are acceptable. 
+  /* Now all graphical modes are acceptable.
      May change in future if we have modes without framebuffer.  */
   if (modevar && *modevar != 0)
     {
-      tmp = grub_malloc (grub_strlen (modevar) 
+      tmp = grub_malloc (grub_strlen (modevar)
                         + sizeof (DEFAULT_VIDEO_MODE) + 1);
       if (! tmp)
        return grub_errno;
@@ -485,7 +485,7 @@ grub_linux_boot (void)
       params->video_width = 80;
       params->video_height = 25;
     }
-  
+
   grub_dprintf ("linux", "code32_start = %x, idt_desc = %lx, gdt_desc = %lx\n",
                (unsigned) params->code32_start,
                 (unsigned long) &(idt_desc.limit),
@@ -538,18 +538,18 @@ grub_linux_boot (void)
 
 #ifdef __x86_64__
 
-  grub_memcpy ((char *) prot_mode_mem + (prot_mode_pages << 12), 
-              grub_linux_trampoline_start, 
+  grub_memcpy ((char *) prot_mode_mem + (prot_mode_pages << 12),
+              grub_linux_trampoline_start,
               grub_linux_trampoline_end - grub_linux_trampoline_start);
-  
-  ((void (*) (unsigned long, void *)) ((char *) prot_mode_mem 
+
+  ((void (*) (unsigned long, void *)) ((char *) prot_mode_mem
                                       + (prot_mode_pages << 12)))
     (params->code32_start, real_mode_mem);
 #else
 
   /* Hardware interrupts are not safe any longer.  */
   asm volatile ("cli" : : );
-  
+
   /* Load the IDT and the GDT for the bootstrap.  */
   asm volatile ("lidt %0" : : "m" (idt_desc));
   asm volatile ("lgdt %0" : : "m" (gdt_desc));
@@ -562,7 +562,7 @@ grub_linux_boot (void)
 
   /* Enter Linux.  */
   asm volatile ("jmp *%%ecx" : : );
-  
+
 #endif
 
   /* Never reach here.  */
@@ -591,7 +591,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
   char *dest;
 
   grub_dl_ref (my_mod);
-  
+
   if (argc == 0)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified");
@@ -644,17 +644,17 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
     }
 
   setup_sects = lh.setup_sects;
-  
+
   /* If SETUP_SECTS is not set, set it to the default (4).  */
   if (! setup_sects)
     setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS;
 
   real_size = setup_sects << GRUB_DISK_SECTOR_BITS;
   prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE;
-  
+
   if (! allocate_pages (prot_size))
     goto fail;
-  
+
   params = (struct linux_kernel_params *) real_mode_mem;
   grub_memset (params, 0, GRUB_LINUX_CL_END_OFFSET);
   grub_memcpy (&params->setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1);
@@ -684,7 +684,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
      space.  */
   params->ext_mem = ((32 * 0x100000) >> 10);
   params->alt_mem = ((32 * 0x100000) >> 10);
-  
+
   params->video_page = 0; /* ??? */
   params->video_mode = 0;
   params->video_ega_bx = 0;
@@ -734,8 +734,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
            grub_env_set ("gfxpayload", "text");
            grub_printf ("%s is deprecated. "
                         "Use set gfxpayload=text before "
-                        "linux command instead.\n", 
-                        argv[i]);      
+                        "linux command instead.\n",
+                        argv[i]);
            break;
 
          case 1:
@@ -744,8 +744,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
            grub_env_set ("gfxpayload", "text");
            grub_printf ("%s is deprecated. "
                         "Use set gfxpayload=text before "
-                        "linux command instead.\n", 
-                        argv[i]);      
+                        "linux command instead.\n",
+                        argv[i]);
            break;
          default:
            /* Ignore invalid values.  */
@@ -756,19 +756,19 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
                grub_env_set ("gfxpayload", "text");
                grub_printf ("%s is deprecated. Mode %d isn't recognized. "
                             "Use set gfxpayload=WIDTHxHEIGHT[xDEPTH] before "
-                            "linux command instead.\n", 
-                            argv[i], vid_mode);        
+                            "linux command instead.\n",
+                            argv[i], vid_mode);
                break;
              }
 
            buf = grub_malloc (sizeof ("WWWWxHHHHxDD;WWWWxHHHH"));
            if (! buf)
              goto fail;
-           
-           linux_mode 
+
+           linux_mode
              = &linux_vesafb_modes[vid_mode - GRUB_LINUX_VID_MODE_VESA_START];
-           
-           grub_sprintf (buf, "%ux%ux%u;%ux%u", 
+
+           grub_sprintf (buf, "%ux%ux%u;%ux%u",
                          linux_vesafb_res[linux_mode->res_index].width,
                          linux_vesafb_res[linux_mode->res_index].height,
                          linux_mode->depth,
@@ -776,8 +776,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
                          linux_vesafb_res[linux_mode->res_index].height);
            grub_printf ("%s is deprecated. "
                         "Use set gfxpayload=%s before "
-                        "linux command instead.\n", 
-                        argv[i], buf); 
+                        "linux command instead.\n",
+                        argv[i], buf);
            err = grub_env_set ("gfxpayload", buf);
            grub_free (buf);
            if (err)
@@ -789,9 +789,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
     if (grub_memcmp (argv[i], "mem=", 4) == 0)
       {
        char *val = argv[i] + 4;
-         
+
        linux_mem_size = grub_strtoul (val, &val, 0);
-       
+
        if (grub_errno)
          {
            grub_errno = GRUB_ERR_NONE;
@@ -800,7 +800,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
        else
          {
            int shift = 0;
-           
+
            switch (grub_tolower (val[0]))
              {
              case 'g':
@@ -820,12 +820,12 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
              linux_mem_size <<= shift;
          }
       }
-  
+
   /* Specify the boot file.  */
   dest = grub_stpcpy ((char *) real_mode_mem + GRUB_LINUX_CL_OFFSET,
                      "BOOT_IMAGE=");
   dest = grub_stpcpy (dest, argv[0]);
-  
+
   /* Copy kernel parameters.  */
   for (i = 1;
        i < argc
@@ -849,7 +849,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
     }
 
  fail:
-  
+
   if (file)
     grub_file_close (file);
 
@@ -871,13 +871,13 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
   grub_addr_t addr_min, addr_max;
   grub_addr_t addr;
   struct linux_kernel_header *lh;
-  
+
   if (argc == 0)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified");
       goto fail;
     }
-  
+
   if (! loaded)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first.");
@@ -906,10 +906,10 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
     }
   else
     addr_max = GRUB_LINUX_INITRD_MAX_ADDRESS;
-  
+
   if (linux_mem_size != 0 && linux_mem_size < addr_max)
     addr_max = linux_mem_size;
-  
+
   /* Linux 2.3.xx has a bug in the memory range check, so avoid
      the last page.
      Linux 2.2.xx has a bug in the memory range check, which is
@@ -919,7 +919,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
   /* Usually, the compression ratio is about 50%.  */
   addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12)
              + page_align (size);
-  
+
   if (addr_max > grub_os_area_addr + grub_os_area_size)
     addr_max = grub_os_area_addr + grub_os_area_size;
 
@@ -931,9 +931,9 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
       grub_error (GRUB_ERR_OUT_OF_RANGE, "The initrd is too big");
       goto fail;
     }
-  
+
   initrd_mem = (void *) addr;
-  
+
   if (grub_file_read (file, initrd_mem, size) != size)
     {
       grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
@@ -942,11 +942,11 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
 
   grub_printf ("   [Initrd, addr=0x%x, size=0x%x]\n",
               (unsigned) addr, (unsigned) size);
-  
+
   lh->ramdisk_image = addr;
   lh->ramdisk_size = size;
   lh->root_dev = 0x0100; /* XXX */
-  
+
  fail:
   if (file)
     grub_file_close (file);
index e2cd6ec274684d1a9927c1145593d2d0e0585e63..4acea7b1161a2cd415e976760f6815ef307f249a 100644 (file)
@@ -17,7 +17,7 @@
  */
 
 #include <grub/symbol.h>
-       
+
 
        .p2align        4       /* force 16-byte alignment */
 VARIABLE(grub_linux_trampoline_start)
@@ -26,23 +26,23 @@ VARIABLE(grub_linux_trampoline_start)
        contains real memory start. */
 
        mov %rsi, %rbx
-       
+
        call base
-base:  
+base:
        pop %rsi
 
-#ifdef APPLE_CC        
+#ifdef APPLE_CC
        lea (cont1 - base) (%esi, 1), %rax
        mov %eax, (jump_vector - base) (%esi, 1)
 
        lea (gdt - base) (%esi, 1), %rax
        mov %rax, (gdtaddr - base) (%esi, 1)
-       
+
        /* Switch to compatibility mode. */
 
        lidt (idtdesc - base) (%esi, 1)
        lgdt (gdtdesc - base) (%esi, 1)
-       
+
        /* Update %cs. Thanks to David Miller for pointing this mistake out. */
        ljmp *(jump_vector - base) (%esi, 1)
 #else
@@ -51,22 +51,22 @@ base:
 
        lea (gdt - base) (%rsi, 1), %rax
        mov %rax, (gdtaddr - base) (%rsi, 1)
-       
+
        /* Switch to compatibility mode. */
 
        lidt (idtdesc - base) (%rsi, 1)
        lgdt (gdtdesc - base) (%rsi, 1)
-       
+
        /* Update %cs. Thanks to David Miller for pointing this mistake out. */
        ljmp *(jump_vector - base) (%rsi, 1)
 #endif
-       
+
 cont1:
        .code32
 
        /* Update other registers. */
        mov $0x18, %eax
-       mov %eax, %ds 
+       mov %eax, %ds
        mov %eax, %es
        mov %eax, %fs
        mov %eax, %gs
@@ -89,41 +89,41 @@ cont1:
        mov %eax, %cr4
 
        jmp cont2
-cont2: 
+cont2:
        .code32
-       
+
        mov %ebx, %esi
 
        jmp *%edi
 
        /* GDT. */
        .p2align 4
-gdt:   
+gdt:
        /* NULL.  */
        .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-       
+
        /* Reserved.  */
        .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-       
+
        /* Code segment.  */
        .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9A, 0xCF, 0x00
-       
+
        /* Data segment.  */
        .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00
 
-gdtdesc:       
+gdtdesc:
        .word 31
-gdtaddr:       
+gdtaddr:
        .quad gdt
 
-idtdesc:       
+idtdesc:
        .word 0
-idtaddr:       
+idtaddr:
        .quad 0
 
        .p2align 4
 jump_vector:
        /* Jump location. Is filled by the code */
        .long 0
-       .long 0x10      
+       .long 0x10
 VARIABLE(grub_linux_trampoline_end)
index a59085c544ed898be82a7c6f52a8070827de0146..cc45a4e9718cdeb3f7c3b8cd0732a93943984888 100644 (file)
@@ -76,7 +76,7 @@ grub_multiboot_unload (void)
       grub_free ((void *) mbi->cmdline);
       grub_free (mbi);
     }
-  
+
   mbi = 0;
   grub_dl_unref (my_mod);
 
@@ -98,9 +98,9 @@ grub_get_multiboot_mmap_len (void)
       count++;
       return 0;
     }
-  
+
   grub_mmap_iterate (hook);
-  
+
   return count * sizeof (struct grub_multiboot_mmap_entry);
 }
 
@@ -297,11 +297,11 @@ grub_multiboot (int argc, char *argv[])
       grub_file_read (file, (void *) grub_multiboot_payload_orig, load_size);
       if (grub_errno)
        goto fail;
-      
+
       if (header->bss_end_addr)
        grub_memset ((void *) (grub_multiboot_payload_orig + load_size), 0,
                     header->bss_end_addr - header->load_addr - load_size);
-      
+
       grub_multiboot_payload_entry_offset = header->entry_addr - header->load_addr;
 
     }
@@ -315,7 +315,7 @@ grub_multiboot (int argc, char *argv[])
   mbi_dest = mbi_addr (grub_multiboot_payload_dest);
   grub_memset (mbi, 0, sizeof (struct grub_multiboot_info));
   mbi->mmap_length = mmap_length;
-  
+
   grub_fill_multiboot_mmap (mmap_addr (grub_multiboot_payload_orig));
 
   /* FIXME: grub_uint32_t will break for addresses above 4 GiB, but is mandated
@@ -334,7 +334,7 @@ grub_multiboot (int argc, char *argv[])
                    &grub_multiboot_backward_relocator, RELOCATOR_SIZEOF(backward));
       entry = (grub_addr_t) grub_multiboot_payload_orig + grub_multiboot_payload_size;
     }
-  
+
   grub_dprintf ("multiboot_loader", "dest=%p, size=0x%x, entry_offset=0x%x\n",
                (void *) grub_multiboot_payload_dest,
                grub_multiboot_payload_size,
@@ -360,8 +360,8 @@ grub_multiboot (int argc, char *argv[])
 
   mbi->flags |= MULTIBOOT_INFO_CMDLINE;
   mbi->cmdline = (grub_uint32_t) cmdline_addr (grub_multiboot_payload_dest);
-  
-  
+
+
   grub_strcpy (boot_loader_name_addr (grub_multiboot_payload_orig), PACKAGE_STRING);
   mbi->flags |= MULTIBOOT_INFO_BOOT_LOADER_NAME;
   mbi->boot_loader_name = (grub_uint32_t) boot_loader_name_addr (grub_multiboot_payload_dest);
index ce9e4fe113b9955ef1af78f0eabdd5c1c3b2b851..77c47118cb15556f317c3cc7f0f0e6c7de49197c 100644 (file)
@@ -63,10 +63,10 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer)
       || ehdr->e_ident[EI_DATA] != ELFDATA2LSB
       || ehdr->e_machine != E_MACHINE)
     return grub_error(GRUB_ERR_UNKNOWN_OS, "no valid ELF header found");
-  
+
   if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN)
     return grub_error (GRUB_ERR_UNKNOWN_OS, "invalid ELF file type");
-  
+
   /* FIXME: Should we support program headers at strange locations?  */
   if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH)
     return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset");
@@ -84,7 +84,7 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer)
     if (phdr(i)->p_type == PT_LOAD && phdr(i)->p_filesz != 0)
       {
        /* Beware that segment 0 isn't necessarily loadable */
-       if (lowest_segment == -1 
+       if (lowest_segment == -1
            || phdr(i)->p_paddr < phdr(lowest_segment)->p_paddr)
          lowest_segment = i;
        if (highest_segment == -1
@@ -132,7 +132,7 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer)
     }
 
   for (i = 0; i < ehdr->e_phnum; i++)
-    if (phdr(i)->p_vaddr <= ehdr->e_entry 
+    if (phdr(i)->p_vaddr <= ehdr->e_entry
        && phdr(i)->p_vaddr + phdr(i)->p_memsz > ehdr->e_entry)
       {
        grub_multiboot_payload_entry_offset = (ehdr->e_entry - phdr(i)->p_vaddr)
index c496ba054b1c68e74be086dfc2bfc53d3e633f48..d7539f193bda0bfae8b92f84b0757f27c3469702 100644 (file)
@@ -19,7 +19,7 @@
 #include <grub/symbol.h>
 #include <multiboot.h>
 #include <multiboot2.h>
-       
+
        .p2align        2       /* force 4-byte alignment */
 
 /*
@@ -91,7 +91,7 @@ FUNCTION(grub_multiboot_real_boot)
 
        /* Move the magic value into eax.  */
        movl    $MULTIBOOT_MAGIC2, %eax
-                               
+
        /* Jump to the relocator.  */
        popl    %ebp
        jmp     *%ebp
index 304886b09cf0f8353ead9b800cae4e64a0ac30cd..1b96ca8aa58f44baa5c0edecbb624ba41cd1ca6e 100644 (file)
@@ -62,7 +62,7 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags)
   void *part_addr = 0;
 
   grub_dl_ref (my_mod);
-  
+
   file = grub_file_open (filename);
   if (! file)
     goto fail;
@@ -93,11 +93,11 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags)
   if (dev)
     {
       grub_disk_t disk = dev->disk;
-      
+
       if (disk)
        {
          grub_partition_t p = disk->partition;
-         
+
          /* In i386-pc, the id is equal to the BIOS drive number.  */
          drive = (int) disk->id;
 
@@ -112,21 +112,21 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags)
 
       grub_device_close (dev);
     }
-  
+
   /* Ignore errors. Perhaps it's not fatal.  */
   grub_errno = GRUB_ERR_NONE;
 
   boot_drive = drive;
   boot_part_addr = part_addr;
-  
+
   grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 1);
   return;
-  
+
  fail:
 
   if (file)
     grub_file_close (file);
-  
+
   grub_dl_unref (my_mod);
 }
 
@@ -142,7 +142,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
       argc--;
       argv++;
     }
-  
+
   if (argc == 0)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified");
   else
index 34a4ebcfa9f1c71a4426ba6bcbfa08f3a1c4fd57..148cb7777a861b799ebbda1415786fbaf37aa863 100644 (file)
@@ -60,7 +60,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
   char *dest;
 
   grub_dl_ref (my_mod);
-  
+
   if (argc == 0)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified");
@@ -100,27 +100,27 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
   grub_linux_is_bzimage = 0;
   setup_sects = lh.setup_sects;
   linux_mem_size = 0;
-  
+
   if (lh.header == grub_cpu_to_le32 (GRUB_LINUX_MAGIC_SIGNATURE)
       && grub_le_to_cpu16 (lh.version) >= 0x0200)
     {
       grub_linux_is_bzimage = (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL);
       lh.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE;
-      
+
       /* Put the real mode part at as a high location as possible.  */
-      grub_linux_real_addr 
+      grub_linux_real_addr
        = (char *) UINT_TO_PTR (grub_mmap_get_lower ()
                                - GRUB_LINUX_SETUP_MOVE_SIZE);
       /* But it must not exceed the traditional area.  */
       if (grub_linux_real_addr > (char *) GRUB_LINUX_OLD_REAL_MODE_ADDR)
        grub_linux_real_addr = (char *) GRUB_LINUX_OLD_REAL_MODE_ADDR;
-      
+
       if (grub_le_to_cpu16 (lh.version) >= 0x0201)
        {
          lh.heap_end_ptr = grub_cpu_to_le16 (GRUB_LINUX_HEAP_END_OFFSET);
          lh.loadflags |= GRUB_LINUX_FLAG_CAN_USE_HEAP;
        }
-      
+
       if (grub_le_to_cpu16 (lh.version) >= 0x0202)
        lh.cmd_line_ptr = grub_linux_real_addr + GRUB_LINUX_CL_OFFSET;
       else
@@ -135,19 +135,19 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
       /* Your kernel is quite old...  */
       lh.cl_magic = grub_cpu_to_le16 (GRUB_LINUX_CL_MAGIC);
       lh.cl_offset = grub_cpu_to_le16 (GRUB_LINUX_CL_OFFSET);
-      
+
       setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS;
-      
+
       grub_linux_real_addr = (char *) GRUB_LINUX_OLD_REAL_MODE_ADDR;
     }
-  
+
   /* If SETUP_SECTS is not set, set it to the default (4).  */
   if (! setup_sects)
     setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS;
-  
+
   real_size = setup_sects << GRUB_DISK_SECTOR_BITS;
   prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE;
-  
+
   grub_linux_tmp_addr = (char *) GRUB_LINUX_BZIMAGE_ADDR + prot_size;
 
   if (! grub_linux_is_bzimage
@@ -158,7 +158,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
                  (grub_size_t) grub_linux_real_addr);
       goto fail;
     }
-  
+
   if (grub_linux_real_addr + GRUB_LINUX_SETUP_MOVE_SIZE
       > (char *) UINT_TO_PTR (grub_mmap_get_lower ()))
     {
@@ -196,9 +196,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
     else if (grub_memcmp (argv[i], "mem=", 4) == 0)
       {
        char *val = argv[i] + 4;
-         
+
        linux_mem_size = grub_strtoul (val, &val, 0);
-       
+
        if (grub_errno)
          {
            grub_errno = GRUB_ERR_NONE;
@@ -207,7 +207,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
        else
          {
            int shift = 0;
-           
+
            switch (grub_tolower (val[0]))
              {
              case 'g':
@@ -251,7 +251,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
   dest = grub_stpcpy (grub_linux_tmp_addr + GRUB_LINUX_CL_OFFSET,
                      "BOOT_IMAGE=");
   dest = grub_stpcpy (dest, argv[0]);
-  
+
   /* Copy kernel parameters.  */
   for (i = 1;
        i < argc
@@ -266,7 +266,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
   len = prot_size;
   if (grub_file_read (file, (char *) GRUB_LINUX_BZIMAGE_ADDR, len) != len)
     grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
+
   if (grub_errno == GRUB_ERR_NONE)
     {
       grub_linux_prot_size = prot_size;
@@ -275,7 +275,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
     }
 
  fail:
-  
+
   if (file)
     grub_file_close (file);
 
@@ -302,7 +302,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
       grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified");
       goto fail;
     }
-  
+
   if (!loaded)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first.");
@@ -369,7 +369,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
 
   lh->ramdisk_image = addr;
   lh->ramdisk_size = size;
-  
+
  fail:
   if (file)
     grub_file_close (file);
index 7d7c685ee98d4389f08d0a3bcf81d5d23dd876c0..dadbccd356fda58264a01484292e98643cd4ae9b 100644 (file)
@@ -33,7 +33,7 @@ grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr)
 
   if ((paddr < grub_os_area_addr)
       || (paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size))
-    return grub_error(GRUB_ERR_OUT_OF_RANGE,"Address 0x%x is out of range", 
+    return grub_error(GRUB_ERR_OUT_OF_RANGE,"Address 0x%x is out of range",
                       paddr);
 
   return GRUB_ERR_NONE;
@@ -82,7 +82,7 @@ void
 grub_mb2_arch_unload (struct multiboot_tag_header *tags)
 {
    struct multiboot_tag_header *tag;
-   
+
    /* Free all module memory in the tag list.  */
    for_each_tag (tag, tags)
      {
index d32f6793b82817580d13cbbeb53475d4cd35732b..037a7134f04a907029cfb72d73e96a4d04235767 100644 (file)
@@ -54,10 +54,10 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params)
     err = grub_video_set_mode (DEFAULT_VIDEO_MODE, video_hook);
   else
     {
-      tmp = grub_malloc (grub_strlen (modevar) 
+      tmp = grub_malloc (grub_strlen (modevar)
                         + sizeof (DEFAULT_VIDEO_MODE) + 1);
       if (! tmp)
-       return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+       return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                           "couldn't allocate temporary storag");
       grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar);
       err = grub_video_set_mode (tmp, video_hook);
@@ -86,9 +86,9 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params)
                                y > 0 ? y : 0,
                                x < 0 ? -x : 0,
                                y < 0 ? -y : 0,
-                               min (grub_xnu_bitmap->mode_info.width, 
-                                    mode_info.width), 
-                               min (grub_xnu_bitmap->mode_info.height, 
+                               min (grub_xnu_bitmap->mode_info.width,
+                                    mode_info.width),
+                               min (grub_xnu_bitmap->mode_info.height,
                                     mode_info.height));
   if (err)
     {
@@ -103,8 +103,8 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params)
   params->lfb_line_len = mode_info.pitch;
 
   params->lfb_base = PTR_TO_UINT32 (render_target->data);
-  params->lfb_mode = grub_xnu_bitmap 
-    ? GRUB_XNU_VIDEO_SPLASH : GRUB_XNU_VIDEO_TEXT_IN_VIDEO; 
+  params->lfb_mode = grub_xnu_bitmap
+    ? GRUB_XNU_VIDEO_SPLASH : GRUB_XNU_VIDEO_TEXT_IN_VIDEO;
 
   return GRUB_ERR_NONE;
 }
index c0e731c090069a79b7540ebccee8d3400e0c44f9..06e375c69ccf193ff2f7038f6320b474baa87829 100644 (file)
@@ -44,10 +44,10 @@ struct tbl_alias table_aliases[] =
     {GRUB_EFI_ACPI_TABLE_GUID, "ACPI"},
   };
 
-/* The following function is used to be able to debug xnu loader 
+/* The following function is used to be able to debug xnu loader
    with grub-emu. */
 #ifdef GRUB_UTIL
-static grub_err_t 
+static grub_err_t
 grub_xnu_launch (void)
 {
   grub_printf ("Fake launch %x:%p:%p", grub_xnu_entry_point, grub_xnu_arg1,
@@ -78,7 +78,7 @@ readfrequency (const char *str)
   while (*str)
     {
       unsigned long digit;
-      
+
       digit = grub_tolower (*str) - '0';
       if (digit > 9)
        break;
@@ -95,7 +95,7 @@ readfrequency (const char *str)
       while (*str)
        {
          unsigned long digit;
-         
+
          digit = grub_tolower (*str) - '0';
          if (digit > 9)
            break;
@@ -125,7 +125,7 @@ guessfsb (void)
 
   if (! grub_cpu_is_cpuid_supported ())
     return sane_value;
-       
+
 #ifdef APPLE_CC
   asm volatile ("movl $0, %%eax\n"
 #ifdef __x86_64__
@@ -138,18 +138,18 @@ guessfsb (void)
                "pop %%rbx\n"
 #else
                "pop %%ebx\n"
-#endif                           
-               : "=a" (max_cpuid), 
+#endif
+               : "=a" (max_cpuid),
                  "=d" (manufacturer[1]), "=c" (manufacturer[2]));
-  
+
   /* Only Intel for now is done. */
   if (grub_memcmp (manufacturer + 1, "ineIntel", 12) != 0)
     return sane_value;
-  
+
 #else
   asm volatile ("movl $0, %%eax\n"
                "cpuid"
-               : "=a" (max_cpuid), "=b" (manufacturer[0]), 
+               : "=a" (max_cpuid), "=b" (manufacturer[0]),
                  "=d" (manufacturer[1]), "=c" (manufacturer[2]));
 
   /* Only Intel for now is done. */
@@ -167,7 +167,7 @@ guessfsb (void)
                "push %%rbx\n"
 #else
                "push %%ebx\n"
-#endif                           
+#endif
                "cpuid\n"
 #ifdef __x86_64__
                "pop %%rbx\n"
@@ -175,7 +175,7 @@ guessfsb (void)
                "pop %%ebx\n"
 #endif
                : "=c" (capabilities):
-               : "%rax", "%rdx");      
+               : "%rax", "%rdx");
 #else
   asm volatile ("movl $1, %%eax\n"
                "cpuid"
@@ -201,7 +201,7 @@ guessfsb (void)
                :
                : "%ecx", "%eax");
 
-  return grub_divmod64 (2000 * tsc_ticks_per_ms, 
+  return grub_divmod64 (2000 * tsc_ticks_per_ms,
                        ((msrlow >> 7) & 0x3e) + ((msrlow >> 14) & 1), 0);
 }
 
@@ -254,7 +254,7 @@ grub_cpu_xnu_fill_devicetree (void)
   curval = grub_xnu_create_value (&(efikey->first_child), "firmware-vendor");
   if (! curval)
     return grub_errno;
-  curval->datasize = 
+  curval->datasize =
     2 * (utf16_strlen (SYSTEM_TABLE_PTR (firmware_vendor)) + 1);
   curval->data = grub_malloc (curval->datasize);
   if (! curval->data)
@@ -275,7 +275,7 @@ grub_cpu_xnu_fill_devicetree (void)
     grub_memcpy (curval->data, "EFI64", curval->datasize);
 
   /* The key "platform". */
-  platformkey = grub_xnu_create_key (&(efikey->first_child), 
+  platformkey = grub_xnu_create_key (&(efikey->first_child),
                                     "platform");
   if (! platformkey)
     return grub_errno;
@@ -292,16 +292,16 @@ grub_cpu_xnu_fill_devicetree (void)
   /* First see if user supplies the value. */
   char *fsbvar = grub_env_get ("fsb");
   if (! fsbvar)
-    *((grub_uint64_t *) curval->data) = 0; 
+    *((grub_uint64_t *) curval->data) = 0;
   else
     *((grub_uint64_t *) curval->data) = readfrequency (fsbvar);
   /* Try autodetect. */
   if (! *((grub_uint64_t *) curval->data))
-    *((grub_uint64_t *) curval->data) = guessfsb (); 
-  grub_dprintf ("xnu", "fsb autodetected as %llu\n", 
+    *((grub_uint64_t *) curval->data) = guessfsb ();
+  grub_dprintf ("xnu", "fsb autodetected as %llu\n",
                (unsigned long long) *((grub_uint64_t *) curval->data));
 
-  cfgtablekey = grub_xnu_create_key (&(efikey->first_child), 
+  cfgtablekey = grub_xnu_create_key (&(efikey->first_child),
                                     "configuration-table");
   if (!cfgtablekey)
     return grub_errno;
@@ -317,11 +317,11 @@ grub_cpu_xnu_fill_devicetree (void)
       /* Retrieve current key. */
 #ifdef GRUB_MACHINE_EFI
       {
-       ptr = (void *) 
+       ptr = (void *)
          grub_efi_system_table->configuration_table[i].vendor_table;
        guid = grub_efi_system_table->configuration_table[i].vendor_guid;
       }
-#else 
+#else
       if (SIZEOF_OF_UINTN == 4)
        {
          ptr = UINT_TO_PTR (((grub_efiemu_configuration_table32_t *)
@@ -336,7 +336,7 @@ grub_cpu_xnu_fill_devicetree (void)
          ptr = UINT_TO_PTR (((grub_efiemu_configuration_table64_t *)
                              SYSTEM_TABLE_PTR (configuration_table))[i]
                             .vendor_table);
-         guid = 
+         guid =
            ((grub_efiemu_configuration_table64_t *)
             SYSTEM_TABLE_PTR (configuration_table))[i].vendor_guid;
        }
@@ -362,7 +362,7 @@ grub_cpu_xnu_fill_devicetree (void)
       curval->datasize = sizeof (guid);
       curval->data = grub_malloc (curval->datasize);
       if (! curval->data)
-       return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+       return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                           "couldn't create device tree");
       grub_memcpy (curval->data, &guid, curval->datasize);
 
@@ -373,7 +373,7 @@ grub_cpu_xnu_fill_devicetree (void)
       curval->datasize = SIZEOF_OF_UINTN;
       curval->data = grub_malloc (curval->datasize);
       if (! curval->data)
-       return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+       return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                           "couldn't create device tree");
       if (SIZEOF_OF_UINTN == 4)
        *((grub_uint32_t *)curval->data) = PTR_TO_UINT32 (ptr);
@@ -392,14 +392,14 @@ grub_cpu_xnu_fill_devicetree (void)
          curval->datasize = grub_strlen (table_aliases[j].name) + 1;
          curval->data = grub_malloc (curval->datasize);
          if (!curval->data)
-           return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+           return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                               "couldn't create device tree");
          grub_memcpy (curval->data, table_aliases[j].name, curval->datasize);
        }
     }
-  
+
   /* Create and fill "runtime-services" key. */
-  runtimesrvkey = grub_xnu_create_key (&(efikey->first_child), 
+  runtimesrvkey = grub_xnu_create_key (&(efikey->first_child),
                                       "runtime-services");
   if (! runtimesrvkey)
     return grub_errno;
@@ -409,20 +409,20 @@ grub_cpu_xnu_fill_devicetree (void)
   curval->datasize = SIZEOF_OF_UINTN;
   curval->data = grub_malloc (curval->datasize);
   if (! curval->data)
-    return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+    return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                       "couldn't create device tree");
   if (SIZEOF_OF_UINTN == 4)
-    *((grub_uint32_t *) curval->data) 
+    *((grub_uint32_t *) curval->data)
       = PTR_TO_UINT32 (SYSTEM_TABLE_PTR (runtime_services));
   else
-    *((grub_uint64_t *) curval->data) 
+    *((grub_uint64_t *) curval->data)
       = PTR_TO_UINT64 (SYSTEM_TABLE_PTR (runtime_services));
-  
+
   return GRUB_ERR_NONE;
 }
 
 /* Boot xnu. */
-grub_err_t 
+grub_err_t
 grub_xnu_boot (void)
 {
   struct grub_xnu_boot_params *bootparams_relloc;
@@ -464,17 +464,17 @@ grub_xnu_boot (void)
                                   &map_key, &descriptor_size,
                                   &descriptor_version) <= 0)
     return grub_errno;
-  mmap_relloc_off = (grub_uint8_t *) memory_map 
+  mmap_relloc_off = (grub_uint8_t *) memory_map
     - (grub_uint8_t *) grub_xnu_heap_start;
 
-  firstruntimeaddr = (grub_uint64_t) (-1); 
+  firstruntimeaddr = (grub_uint64_t) (-1);
   lastruntimeaddr = 0;
   for (i = 0; (unsigned) i < memory_map_size / descriptor_size; i++)
     {
-      grub_efi_memory_descriptor_t *curdesc = (grub_efi_memory_descriptor_t *) 
+      grub_efi_memory_descriptor_t *curdesc = (grub_efi_memory_descriptor_t *)
        ((char *) memory_map + descriptor_size * i);
 
-      /* Some EFI implementations set physical_start to 0 which 
+      /* Some EFI implementations set physical_start to 0 which
         causes XNU crash. */
       curdesc->virtual_start = curdesc->physical_start;
 
@@ -494,7 +494,7 @@ grub_xnu_boot (void)
   bootparams_relloc = grub_xnu_heap_malloc (sizeof (*bootparams_relloc));
   if (! bootparams_relloc)
     return grub_errno;
-  bootparams_relloc_off = (grub_uint8_t *) bootparams_relloc 
+  bootparams_relloc_off = (grub_uint8_t *) bootparams_relloc
     - (grub_uint8_t *) grub_xnu_heap_start;
   err = grub_xnu_writetree_toheap (&devtree, &devtreelen);
   if (err)
@@ -502,10 +502,10 @@ grub_xnu_boot (void)
   bootparams_relloc = (struct grub_xnu_boot_params *)
     (bootparams_relloc_off + (grub_uint8_t *) grub_xnu_heap_start);
 
-  grub_memcpy (bootparams_relloc->cmdline, grub_xnu_cmdline, 
+  grub_memcpy (bootparams_relloc->cmdline, grub_xnu_cmdline,
               sizeof (bootparams_relloc->cmdline));
 
-  bootparams_relloc->devtree = ((char *) devtree - grub_xnu_heap_start) 
+  bootparams_relloc->devtree = ((char *) devtree - grub_xnu_heap_start)
     + grub_xnu_heap_will_be_at;
   bootparams_relloc->devtreelen = devtreelen;
 
@@ -513,41 +513,41 @@ grub_xnu_boot (void)
   bootparams_relloc->heap_size = grub_xnu_heap_size;
 
   bootparams_relloc->efi_mmap = grub_xnu_heap_will_be_at + mmap_relloc_off;
-  bootparams_relloc->efi_mmap_size = memory_map_size;          
-  bootparams_relloc->efi_mem_desc_size = descriptor_size;      
-  bootparams_relloc->efi_mem_desc_version = descriptor_version;   
+  bootparams_relloc->efi_mmap_size = memory_map_size;
+  bootparams_relloc->efi_mem_desc_size = descriptor_size;
+  bootparams_relloc->efi_mem_desc_version = descriptor_version;
 
-  bootparams_relloc->efi_runtime_first_page = firstruntimeaddr 
+  bootparams_relloc->efi_runtime_first_page = firstruntimeaddr
     / GRUB_XNU_PAGESIZE;
-  bootparams_relloc->efi_runtime_npages 
-    = ((lastruntimeaddr + GRUB_XNU_PAGESIZE - 1) / GRUB_XNU_PAGESIZE) 
+  bootparams_relloc->efi_runtime_npages
+    = ((lastruntimeaddr + GRUB_XNU_PAGESIZE - 1) / GRUB_XNU_PAGESIZE)
     - (firstruntimeaddr / GRUB_XNU_PAGESIZE);
   bootparams_relloc->efi_uintnbits = SIZEOF_OF_UINTN * 8;
-  bootparams_relloc->efi_system_table 
+  bootparams_relloc->efi_system_table
     = PTR_TO_UINT32 (grub_autoefi_system_table);
 
-  bootparams_relloc->verminor = GRUB_XNU_BOOTARGS_VERMINOR;  
+  bootparams_relloc->verminor = GRUB_XNU_BOOTARGS_VERMINOR;
   bootparams_relloc->vermajor = GRUB_XNU_BOOTARGS_VERMAJOR;
 
   /* Parameters for asm helper. */
-  grub_xnu_stack = bootparams_relloc->heap_start 
+  grub_xnu_stack = bootparams_relloc->heap_start
     + bootparams_relloc->heap_size + GRUB_XNU_PAGESIZE;
   grub_xnu_arg1 = bootparams_relloc_off + grub_xnu_heap_will_be_at;
 #ifndef GRUB_UTIL
-  grub_xnu_launch = (void (*) (void)) 
+  grub_xnu_launch = (void (*) (void))
     (grub_xnu_heap_start + grub_xnu_heap_size);
 #endif
   grub_dprintf ("xnu", "eip=%x\n", grub_xnu_entry_point);
   grub_dprintf ("xnu", "launch=%p\n", grub_xnu_launch);
 
   const char *debug = grub_env_get ("debug");
-    
+
   if (debug && (grub_strword (debug, "all") || grub_strword (debug, "xnu")))
     {
       grub_printf ("Press any key to launch xnu\n");
       grub_getkey ();
     }
-  
+
   /* Set video. */
   err = grub_xnu_set_video (bootparams_relloc);
   if (err != GRUB_ERR_NONE)
@@ -564,8 +564,8 @@ grub_xnu_boot (void)
       bootparams_relloc->lfb_base = 0;
     }
 
-  grub_memcpy (grub_xnu_heap_start + grub_xnu_heap_size, 
-              grub_xnu_launcher_start, 
+  grub_memcpy (grub_xnu_heap_start + grub_xnu_heap_size,
+              grub_xnu_launcher_start,
               grub_xnu_launcher_end - grub_xnu_launcher_start);
 
 
index 229c8fe435124501076a8df6577c39cc5e1f5cae..4250c58ad3563285918341e0b3bda31e3222234a 100644 (file)
  */
 
 #include <grub/symbol.h>
-       
+
 
        .p2align        4       /* force 16-byte alignment */
 
 VARIABLE(grub_xnu_launcher_start)
-base:  
+base:
        cli
-       
+
 #ifndef __x86_64__
        /* mov imm32, %eax */
        .byte   0xb8
 VARIABLE(grub_xnu_heap_will_be_at)
        .long 0
        mov %eax, %edi
-       
+
        /* mov imm32, %eax */
        .byte   0xb8
 VARIABLE(grub_xnu_heap_start)
        .long 0
        mov %eax, %esi
-       
+
        /* mov imm32, %ecx */
        .byte   0xb9
 VARIABLE(grub_xnu_heap_size)
@@ -57,16 +57,16 @@ VARIABLE(grub_xnu_heap_size)
        mov %eax, %esi
        add $(cont0-base), %eax
        jmp *%eax
-cont0: 
+cont0:
 #else
        xorq %rax, %rax
-       
+
        /* mov imm32, %eax */
        .byte   0xb8
 VARIABLE(grub_xnu_heap_will_be_at)
        .long 0
        mov %rax, %rdi
-       
+
        /* mov imm32, %rax */
        .byte   0x48
        .byte   0xb8
@@ -74,7 +74,7 @@ VARIABLE(grub_xnu_heap_start)
        .long 0
        .long 0
        mov %rax, %rsi
-       
+
        /* mov imm32, %rcx */
        .byte   0x48
        .byte   0xb9
@@ -101,18 +101,18 @@ VARIABLE(grub_xnu_heap_size)
 #endif
        jmp *%rax
 
-cont0: 
+cont0:
 #ifdef APPLE_CC
        lea (cont1 - base) (%esi, 1), %eax
        mov %eax, (jump_vector - base) (%esi, 1)
 
        lea (gdt - base) (%esi, 1), %eax
        mov %eax, (gdt_addr - base) (%esi, 1)
-       
+
        /* Switch to compatibility mode. */
 
        lgdt (gdtdesc - base) (%esi, 1)
-       
+
        /* Update %cs. Thanks to David Miller for pointing this mistake out. */
        ljmp *(jump_vector - base) (%esi,1)
 #else
@@ -121,21 +121,21 @@ cont0:
 
        lea (gdt - base) (%rsi, 1), %rax
        mov %rax, (gdt_addr - base) (%rsi, 1)
-       
+
        /* Switch to compatibility mode. */
 
        lgdt (gdtdesc - base) (%rsi, 1)
-       
+
        /* Update %cs. Thanks to David Miller for pointing this mistake out. */
        ljmp *(jump_vector - base) (%rsi, 1)
 #endif
-       
+
 cont1:
        .code32
 
        /* Update other registers. */
        mov $0x18, %eax
-       mov %eax, %ds 
+       mov %eax, %ds
        mov %eax, %es
        mov %eax, %fs
        mov %eax, %gs
@@ -158,10 +158,10 @@ cont1:
        mov %eax, %cr4
 
        jmp cont2
-cont2: 
+cont2:
 #endif
        .code32
-       
+
        /* Registers on XNU boot: eip, esp and eax. */
        /* mov imm32, %ecx */
        .byte   0xb9
@@ -183,29 +183,29 @@ VARIABLE (grub_xnu_stack)
 #ifdef __x86_64__
        /* GDT. Copied from loader/i386/linux.c. */
        .p2align 4
-gdt:   
+gdt:
        /* NULL.  */
        .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-       
+
        /* Reserved.  */
        .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-       
+
        /* Code segment.  */
        .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9A, 0xCF, 0x00
-       
+
        /* Data segment.  */
        .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00
 
-gdtdesc:       
+gdtdesc:
        .word 31
-gdt_addr:      
+gdt_addr:
        /* Filled by the code. */
        .quad 0
-       
+
        .p2align 4
 jump_vector:
        /* Jump location. Is filled by the code */
        .long 0
-       .long 0x10      
+       .long 0x10
 #endif
 VARIABLE(grub_xnu_launcher_end)
index ed70caa335332ecf1aa445eed49720180ddd61a1..3a5144e7ca469064f2f98703cd72a26db7ea717e 100644 (file)
@@ -51,16 +51,16 @@ grub_macho_parse32 (grub_macho_t macho)
 
   /* Read header and check magic*/
   if (grub_file_seek (macho->file, macho->offset32) == (grub_off_t) -1
-      || grub_file_read (macho->file, (char *) &head, sizeof (head)) 
+      || grub_file_read (macho->file, (char *) &head, sizeof (head))
       != sizeof(head))
     {
-      grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header.");  
+      grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header.");
       macho->offset32 = -1;
       return;
     }
   if (head.magic != GRUB_MACHO_MAGIC32)
     {
-      grub_error (GRUB_ERR_BAD_OS, "Invalid Mach-O 32-bit header.");  
+      grub_error (GRUB_ERR_BAD_OS, "Invalid Mach-O 32-bit header.");
       macho->offset32 = -1;
       return;
     }
@@ -74,17 +74,17 @@ grub_macho_parse32 (grub_macho_t macho)
       grub_error (GRUB_ERR_OUT_OF_MEMORY, "not enough memory to read commands");
       return;
     }
-  if (grub_file_read (macho->file, (char *) macho->cmds32, 
-                     (grub_size_t) macho->cmdsize32) 
+  if (grub_file_read (macho->file, (char *) macho->cmds32,
+                     (grub_size_t) macho->cmdsize32)
       != (grub_ssize_t) macho->cmdsize32)
     {
-      grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header.");  
+      grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header.");
       macho->offset32 = -1;
     }
 }
 
 typedef int NESTED_FUNC_ATTR (*grub_macho_iter_hook_t)
-(grub_macho_t , struct grub_macho_cmd *, 
+(grub_macho_t , struct grub_macho_cmd *,
               void *);
 
 static grub_err_t
@@ -120,7 +120,7 @@ grub_macho32_readfile (grub_macho_t macho, void *dest)
 {
   grub_ssize_t read;
   if (! grub_macho_contains_macho32 (macho))
-    return grub_error (GRUB_ERR_BAD_OS, 
+    return grub_error (GRUB_ERR_BAD_OS,
                       "Couldn't read architecture-specific part");
 
   if (grub_file_seek (macho->file, macho->offset32) == (grub_off_t) -1)
@@ -130,12 +130,12 @@ grub_macho32_readfile (grub_macho_t macho, void *dest)
                         "Invalid offset in program header.");
     }
 
-  read = grub_file_read (macho->file, dest, 
+  read = grub_file_read (macho->file, dest,
                         macho->end32 - macho->offset32);
   if (read != (grub_ssize_t) (macho->end32 - macho->offset32))
     {
       grub_error_push ();
-      return grub_error (GRUB_ERR_BAD_OS, 
+      return grub_error (GRUB_ERR_BAD_OS,
                         "Couldn't read architecture-specific part");
     }
   return GRUB_ERR_NONE;
@@ -150,9 +150,9 @@ grub_macho32_size (grub_macho_t macho, grub_addr_t *segments_start,
 
   /* Run through the program headers to calculate the total memory size we
      should claim.  */
-  auto int NESTED_FUNC_ATTR calcsize (grub_macho_t _macho, 
+  auto int NESTED_FUNC_ATTR calcsize (grub_macho_t _macho,
                                      struct grub_macho_cmd *phdr, void *_arg);
-  int NESTED_FUNC_ATTR calcsize (grub_macho_t UNUSED _macho, 
+  int NESTED_FUNC_ATTR calcsize (grub_macho_t UNUSED _macho,
                                 struct grub_macho_cmd *hdr0, void UNUSED *_arg)
     {
       struct grub_macho_segment32 *hdr = (struct grub_macho_segment32 *) hdr0;
@@ -189,24 +189,24 @@ grub_err_t
 grub_macho32_load (grub_macho_t macho, char *offset, int flags)
 {
   grub_err_t err = 0;
-  auto int NESTED_FUNC_ATTR do_load(grub_macho_t _macho, 
-                              struct grub_macho_cmd *hdr0, 
+  auto int NESTED_FUNC_ATTR do_load(grub_macho_t _macho,
+                              struct grub_macho_cmd *hdr0,
                               void UNUSED *_arg);
-  int NESTED_FUNC_ATTR do_load(grub_macho_t _macho, 
-                              struct grub_macho_cmd *hdr0, 
+  int NESTED_FUNC_ATTR do_load(grub_macho_t _macho,
+                              struct grub_macho_cmd *hdr0,
                               void UNUSED *_arg)
   {
     struct grub_macho_segment32 *hdr = (struct grub_macho_segment32 *) hdr0;
 
     if (hdr->cmd != GRUB_MACHO_CMD_SEGMENT32)
       return 0;
-    
+
     if (! hdr->filesize && (flags & GRUB_MACHO_NOBSS))
       return 0;
     if (! hdr->vmsize)
       return 0;
-    
-    if (grub_file_seek (_macho->file, hdr->fileoff 
+
+    if (grub_file_seek (_macho->file, hdr->fileoff
                        + _macho->offset32) == (grub_off_t) -1)
       {
        grub_error_push ();
@@ -214,11 +214,11 @@ grub_macho32_load (grub_macho_t macho, char *offset, int flags)
                    "Invalid offset in program header.");
        return 1;
       }
-    
+
     if (hdr->filesize)
       {
        grub_ssize_t read;
-       read = grub_file_read (_macho->file, offset + hdr->vmaddr, 
+       read = grub_file_read (_macho->file, offset + hdr->vmaddr,
                                   min (hdr->filesize, hdr->vmsize));
        if (read != (grub_ssize_t) min (hdr->filesize, hdr->vmsize))
          {
@@ -231,7 +231,7 @@ grub_macho32_load (grub_macho_t macho, char *offset, int flags)
            return 1;
          }
       }
-    
+
     if (hdr->filesize < hdr->vmsize)
       grub_memset (offset + hdr->vmaddr + hdr->filesize,
                   0, hdr->vmsize - hdr->filesize);
@@ -247,11 +247,11 @@ grub_uint32_t
 grub_macho32_get_entry_point (grub_macho_t macho)
 {
   grub_uint32_t entry_point = 0;
-  auto int NESTED_FUNC_ATTR hook(grub_macho_t _macho, 
-                              struct grub_macho_cmd *hdr, 
+  auto int NESTED_FUNC_ATTR hook(grub_macho_t _macho,
+                              struct grub_macho_cmd *hdr,
                               void UNUSED *_arg);
-  int NESTED_FUNC_ATTR hook(grub_macho_t UNUSED _macho, 
-                              struct grub_macho_cmd *hdr, 
+  int NESTED_FUNC_ATTR hook(grub_macho_t UNUSED _macho,
+                              struct grub_macho_cmd *hdr,
                               void UNUSED *_arg)
   {
     if (hdr->cmd == GRUB_MACHO_CMD_THREAD)
@@ -316,13 +316,13 @@ grub_macho_file (grub_file_t file)
 
       /* Load architecture description. */
       narchs = grub_be_to_cpu32 (filestart.fat.nfat_arch);
-      if (grub_file_seek (macho->file, sizeof (struct grub_macho_fat_header)) 
+      if (grub_file_seek (macho->file, sizeof (struct grub_macho_fat_header))
          == (grub_off_t) -1)
        goto fail;
       archs = grub_malloc (sizeof (struct grub_macho_fat_arch) * narchs);
       if (!archs)
        goto fail;
-      if (grub_file_read (macho->file, (char *) archs, 
+      if (grub_file_read (macho->file, (char *) archs,
                          sizeof (struct grub_macho_fat_arch) * narchs)
          != (grub_ssize_t)sizeof(struct grub_macho_fat_arch) * narchs)
        {
@@ -334,18 +334,18 @@ grub_macho_file (grub_file_t file)
 
       for (i = 0; i < narchs; i++)
        {
-         if (GRUB_MACHO_CPUTYPE_IS_HOST32 
+         if (GRUB_MACHO_CPUTYPE_IS_HOST32
              (grub_be_to_cpu32 (archs[i].cputype)))
            {
              macho->offset32 = grub_be_to_cpu32 (archs[i].offset);
-             macho->end32 = grub_be_to_cpu32 (archs[i].offset) 
+             macho->end32 = grub_be_to_cpu32 (archs[i].offset)
                + grub_be_to_cpu32 (archs[i].size);
            }
          if (GRUB_MACHO_CPUTYPE_IS_HOST64
              (grub_be_to_cpu32 (archs[i].cputype)))
            {
              macho->offset64 = grub_be_to_cpu32 (archs[i].offset);
-             macho->end64 = grub_be_to_cpu32 (archs[i].offset) 
+             macho->end64 = grub_be_to_cpu32 (archs[i].offset)
                + grub_be_to_cpu32 (archs[i].size);
            }
        }
@@ -369,7 +369,7 @@ grub_macho_file (grub_file_t file)
   grub_macho_parse32 (macho);
   /* FIXME: implement 64-bit.*/
   /*  grub_macho_parse64 (macho); */
-  
+
   return macho;
 
 fail:
index 707f55e34ef68838081cad08c88e3ed22f8cb7b2..29c34d9f83f46cb0a7e16ac10e33a613a37d202d 100644 (file)
@@ -35,11 +35,11 @@ grub_dl_t my_mod;
 /* This tracks which version of multiboot to use when using
  * the module command. By default use multiboot version 1.
  * values:
- *      1 - Multiboot version 1 
+ *      1 - Multiboot version 1
  *      2 - Multiboot version 2
  */
 
-static unsigned int module_version_status = 1; 
+static unsigned int module_version_status = 1;
 
 static int
 find_multi_boot1_header (grub_file_t file)
@@ -48,7 +48,7 @@ find_multi_boot1_header (grub_file_t file)
   char buffer[MULTIBOOT_SEARCH];
   int found_status = 0;
   grub_ssize_t len;
+
   len = grub_file_read (file, buffer, MULTIBOOT_SEARCH);
   if (len < 32)
     return found_status;
@@ -77,7 +77,7 @@ find_multi_boot2_header (grub_file_t file)
   char buffer[MULTIBOOT_SEARCH];
   int found_status = 0;
   grub_ssize_t len;
+
   len = grub_file_read (file, buffer, MULTIBOOT_SEARCH);
   if (len < 32)
     return found_status;
@@ -137,7 +137,7 @@ grub_cmd_multiboot_loader (grub_command_t cmd __attribute__ ((unused)),
 
   /* Launch multi boot with header */
 
-  /* XXX Find a better way to identify this. 
+  /* XXX Find a better way to identify this.
      This is for i386-pc */
 #if defined(GRUB_MACHINE_PCBIOS) || defined(GRUB_MACHINE_LINUXBIOS)
   if (header_multi_ver_found == 1)
index 80d8b033f3e45f5d784ce5cf1a2c4115a8c7bea4..04c9b01971c76c5ef69986bce22175ed30be5f7e 100644 (file)
@@ -238,7 +238,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
   /* Specify the boot file.  */
   dest = grub_stpcpy (linux_args, "BOOT_IMAGE=");
   dest = grub_stpcpy (dest, argv[0]);
-  
+
   for (i = 1; i < argc; i++)
     {
       *dest++ = ' ';
@@ -297,9 +297,9 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
 
   /* Attempt to claim at a series of addresses until successful in
      the same way that grub_rescue_cmd_linux does.  */
-  for (addr = first_addr; addr < first_addr + 200 * 0x100000; addr += 0x100000) 
+  for (addr = first_addr; addr < first_addr + 200 * 0x100000; addr += 0x100000)
     {
-      grub_dprintf ("loader", "Attempting to claim at 0x%x, size 0x%x.\n", 
+      grub_dprintf ("loader", "Attempting to claim at 0x%x, size 0x%x.\n",
                    addr, size);
       found_addr = grub_claimmap (addr, size);
       if (found_addr != -1)
index 18264bcf08e9c1c18fb83e3a21cbdb534989a281..5b5f77e8ebae6798e335c9dd65ae08985c413022 100644 (file)
@@ -1,4 +1,4 @@
-/* xnu.c - load xnu kernel. Thanks to Florian Idelberger for all the 
+/* xnu.c - load xnu kernel. Thanks to Florian Idelberger for all the
    time he spent testing this
  */
 /*
@@ -40,7 +40,7 @@ static int driversnum = 0;
 #define GRUB_XNU_HEAP_ALLOC_BLOCK 0x2000000
 
 static grub_err_t
-grub_xnu_register_memory (char *prefix, int *suffix, 
+grub_xnu_register_memory (char *prefix, int *suffix,
                          void *addr, grub_size_t size);
 void *
 grub_xnu_heap_malloc (int size)
@@ -48,7 +48,7 @@ grub_xnu_heap_malloc (int size)
   void *val;
 
 #if 0
-  /* This way booting is faster but less reliable. 
+  /* This way booting is faster but less reliable.
      Once we have advanced mm second way will be as fast as this one. */
   val = grub_xnu_heap_start = (char *) 0x100000;
 #else
@@ -56,22 +56,22 @@ grub_xnu_heap_malloc (int size)
 
   /* The page after the heap is used for stack. Ensure it's usable. */
   if (grub_xnu_heap_size)
-    oldblknum = (grub_xnu_heap_size + GRUB_XNU_PAGESIZE 
+    oldblknum = (grub_xnu_heap_size + GRUB_XNU_PAGESIZE
                 + GRUB_XNU_HEAP_ALLOC_BLOCK - 1) / GRUB_XNU_HEAP_ALLOC_BLOCK;
   else
     oldblknum = 0;
-  newblknum = (grub_xnu_heap_size + size + GRUB_XNU_PAGESIZE 
+  newblknum = (grub_xnu_heap_size + size + GRUB_XNU_PAGESIZE
               + GRUB_XNU_HEAP_ALLOC_BLOCK - 1) / GRUB_XNU_HEAP_ALLOC_BLOCK;
   if (oldblknum != newblknum)
-    /* FIXME: instruct realloc to allocate at 1MB if possible once 
+    /* FIXME: instruct realloc to allocate at 1MB if possible once
        advanced mm is ready. */
-    val = grub_realloc (grub_xnu_heap_start, 
+    val = grub_realloc (grub_xnu_heap_start,
                        newblknum * GRUB_XNU_HEAP_ALLOC_BLOCK);
   else
     val = grub_xnu_heap_start;
   if (! val)
     {
-      grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+      grub_error (GRUB_ERR_OUT_OF_MEMORY,
                  "not enough space on xnu memory heap");
       return 0;
     }
@@ -84,8 +84,8 @@ grub_xnu_heap_malloc (int size)
   return (char *) val;
 }
 
-/* Make sure next block of the heap will be aligned. 
-   Please notice: aligned are pointers AFTER relocation 
+/* Make sure next block of the heap will be aligned.
+   Please notice: aligned are pointers AFTER relocation
    and not the current ones. */
 grub_err_t
 grub_xnu_align_heap (int align)
@@ -111,9 +111,9 @@ grub_xnu_free_devtree (struct grub_xnu_devtree_key *cur)
       else if (cur->data)
        grub_free (cur->data);
       d = cur->next;
-      grub_free (cur);      
+      grub_free (cur);
       cur = d;
-    }  
+    }
 }
 
 /* Compute the size of device tree in xnu format. */
@@ -122,20 +122,20 @@ grub_xnu_writetree_get_size (struct grub_xnu_devtree_key *start, char *name)
 {
   grub_size_t ret;
   struct grub_xnu_devtree_key *cur;
-  
+
   /* Key header. */
   ret = 2 * sizeof (grub_uint32_t);
 
   /* "name" value. */
   ret += 32 + sizeof (grub_uint32_t)
-    + grub_strlen (name) + 4 
+    + grub_strlen (name) + 4
     - (grub_strlen (name) % 4);
 
   for (cur = start; cur; cur = cur->next)
     if (cur->datasize != -1)
       {
        int align_overhead;
-       
+
        align_overhead = 4 - (cur->datasize % 4);
        if (align_overhead == 4)
          align_overhead = 0;
@@ -148,7 +148,7 @@ grub_xnu_writetree_get_size (struct grub_xnu_devtree_key *start, char *name)
 
 /* Write devtree in XNU format at curptr assuming the head is named NAME.*/
 static void *
-grub_xnu_writetree_toheap_real (void *curptr, 
+grub_xnu_writetree_toheap_real (void *curptr,
                                struct grub_xnu_devtree_key *start, char *name)
 {
   struct grub_xnu_devtree_key *cur;
@@ -161,8 +161,8 @@ grub_xnu_writetree_toheap_real (void *curptr,
        nvals++;
     }
   /* For the name. */
-  nvals++; 
-  
+  nvals++;
+
   *((grub_uint32_t *) curptr) = nvals;
   curptr = ((grub_uint32_t *) curptr) + 1;
   *((grub_uint32_t *) curptr) = nkeys;
@@ -184,7 +184,7 @@ grub_xnu_writetree_toheap_real (void *curptr,
     if (cur->datasize != -1)
       {
        int align_overhead;
-       
+
        align_overhead = 4 - (cur->datasize % 4);
        if (align_overhead == 4)
          align_overhead = 0;
@@ -198,12 +198,12 @@ grub_xnu_writetree_toheap_real (void *curptr,
        grub_memset (curptr, 0, align_overhead);
        curptr = ((grub_uint8_t *) curptr) + align_overhead;
       }
-  
+
   /* And then the keys. Recursively use this function. */
   for (cur = start; cur; cur = cur->next)
     if (cur->datasize == -1)
       if (!(curptr = grub_xnu_writetree_toheap_real (curptr,
-                                                    cur->first_child, 
+                                                    cur->first_child,
                                                     cur->name)))
        return 0;
   return curptr;
@@ -217,11 +217,11 @@ grub_xnu_writetree_toheap (void **start, grub_size_t *size)
   struct grub_xnu_devtree_key *driverkey;
   struct grub_xnu_extdesc *extdesc;
   grub_err_t err;
-  
+
   err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE);
   if (err)
     return err;
-  
+
   /* Device tree itself is in the memory map of device tree. */
   /* Create a dummy value in memory-map. */
   chosen = grub_xnu_create_key (&grub_xnu_devtree_root, "chosen");
@@ -240,18 +240,18 @@ grub_xnu_writetree_toheap (void **start, grub_size_t *size)
   driverkey->datasize = sizeof (*extdesc);
   driverkey->next = memorymap->first_child;
   memorymap->first_child = driverkey;
-  driverkey->data = extdesc 
+  driverkey->data = extdesc
     = (struct grub_xnu_extdesc *) grub_malloc (sizeof (*extdesc));
   if (! driverkey->data)
     return grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't write device tree");
 
   /* Allocate the space based on the size with dummy value. */
   *size = grub_xnu_writetree_get_size (grub_xnu_devtree_root, "/");
-  *start = grub_xnu_heap_malloc (*size + GRUB_XNU_PAGESIZE 
+  *start = grub_xnu_heap_malloc (*size + GRUB_XNU_PAGESIZE
                                 - *size % GRUB_XNU_PAGESIZE);
 
   /* Put real data in the dummy. */
-  extdesc->addr = (char *) *start - grub_xnu_heap_start 
+  extdesc->addr = (char *) *start - grub_xnu_heap_start
     + grub_xnu_heap_will_be_at;
   extdesc->size = (grub_uint32_t) *size;
 
@@ -370,7 +370,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)),
   if (! grub_macho_contains_macho32 (macho))
     {
       grub_macho_close (macho);
-      return grub_error (GRUB_ERR_BAD_OS, 
+      return grub_error (GRUB_ERR_BAD_OS,
                         "Kernel doesn't contain suitable architecture");
     }
 
@@ -382,7 +382,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)),
       return err;
     }
 
-  grub_dprintf ("xnu", "endcode = %lx, startcode = %lx\n", 
+  grub_dprintf ("xnu", "endcode = %lx, startcode = %lx\n",
                (unsigned long) endcode, (unsigned long) startcode);
 
   loadaddr = grub_xnu_heap_malloc (endcode - startcode);
@@ -392,7 +392,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)),
     {
       grub_macho_close (macho);
       grub_xnu_unload ();
-      return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+      return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                         "not enough memory to load kernel");
     }
 
@@ -426,7 +426,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)),
   ptr = grub_xnu_cmdline;
   for (i = 1; i < argc; i++)
     {
-      if (ptr + grub_strlen (args[i]) + 1 
+      if (ptr + grub_strlen (args[i]) + 1
          >= grub_xnu_cmdline + sizeof (grub_xnu_cmdline))
        break;
       grub_memcpy (ptr, args[i], grub_strlen (args[i]));
@@ -437,22 +437,22 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)),
 
   /* Replace last space by '\0'. */
   if (ptr != grub_xnu_cmdline)
-    *(ptr - 1) = 0;  
+    *(ptr - 1) = 0;
 
   err = grub_cpu_xnu_fill_devicetree ();
   if (err)
     return err;
 
-  grub_loader_set (grub_xnu_boot, grub_xnu_unload, 0);    
+  grub_loader_set (grub_xnu_boot, grub_xnu_unload, 0);
 
   grub_xnu_lock ();
   return 0;
 }
 
-/* Register a memory in a memory map under name PREFIXSUFFIX 
+/* Register a memory in a memory map under name PREFIXSUFFIX
    and increment SUFFIX. */
 static grub_err_t
-grub_xnu_register_memory (char *prefix, int *suffix, 
+grub_xnu_register_memory (char *prefix, int *suffix,
                          void *addr, grub_size_t size)
 {
   struct grub_xnu_devtree_key *chosen;
@@ -487,11 +487,11 @@ grub_xnu_register_memory (char *prefix, int *suffix,
   driverkey->datasize = sizeof (*extdesc);
   driverkey->next = memorymap->first_child;
   memorymap->first_child = driverkey;
-  driverkey->data = extdesc 
+  driverkey->data = extdesc
     = (struct grub_xnu_extdesc *) grub_malloc (sizeof (*extdesc));
   if (! driverkey->data)
     return grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't register extension");
-  extdesc->addr = grub_xnu_heap_will_be_at + 
+  extdesc->addr = grub_xnu_heap_will_be_at +
     ((grub_uint8_t *) addr - (grub_uint8_t *) grub_xnu_heap_start);
   extdesc->size = (grub_uint32_t) size;
   return GRUB_ERR_NONE;
@@ -511,7 +511,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile)
 
   if (! grub_xnu_heap_size)
     return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded");
-  
+
   /* Compute the needed space. */
   if (binaryfile)
     {
@@ -520,7 +520,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile)
        {
          if (macho)
            grub_macho_close (macho);
-         return grub_error (GRUB_ERR_BAD_OS, 
+         return grub_error (GRUB_ERR_BAD_OS,
                             "Extension doesn't contain suitable architecture");
        }
       machosize = grub_macho32_filesize (macho);
@@ -571,7 +571,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile)
   /* Load the plist. */
   if (infoplist)
     {
-      exthead->infoplistaddr = (buf - grub_xnu_heap_start) 
+      exthead->infoplistaddr = (buf - grub_xnu_heap_start)
        + grub_xnu_heap_will_be_at;
       exthead->infoplistsize = infoplistsize + 1;
       if (grub_file_read (infoplist, buf, infoplistsize)
@@ -589,7 +589,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile)
 
   /* Announce to kernel */
   return grub_xnu_register_memory ("Driver-", &driversnum, exthead,
-                                  neededspace);  
+                                  neededspace);
 }
 
 /* Load mkext. */
@@ -614,14 +614,14 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)),
 
   file = grub_gzfile_open (args[0], 1);
   if (! file)
-    return grub_error (GRUB_ERR_FILE_NOT_FOUND, 
+    return grub_error (GRUB_ERR_FILE_NOT_FOUND,
                       "Couldn't load driver package");
 
   /* Sometimes caches are fat binary. Errgh. */
   if (grub_file_read (file, (char *) &head, sizeof (head))
       != (grub_ssize_t) (sizeof (head)))
     {
-      /* I don't know the internal structure of package but 
+      /* I don't know the internal structure of package but
         can hardly imagine a valid package shorter than 20 bytes. */
       grub_file_close (file);
       grub_error_push ();
@@ -637,11 +637,11 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)),
        {
          grub_file_close (file);
          grub_error_push ();
-         return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+         return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                             "Couldn't read file %s", args[0]);
-      
+
        }
-      if (grub_file_read (file, (char *) archs, 
+      if (grub_file_read (file, (char *) archs,
                          sizeof (struct grub_macho_fat_arch) * narchs)
          != (grub_ssize_t) sizeof(struct grub_macho_fat_arch) * narchs)
        {
@@ -651,7 +651,7 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)),
        }
       for (i = 0; i < narchs; i++)
        {
-         if (GRUB_MACHO_CPUTYPE_IS_HOST32 
+         if (GRUB_MACHO_CPUTYPE_IS_HOST32
              (grub_be_to_cpu32 (archs[i].cputype)))
            {
              readoff = grub_be_to_cpu32 (archs[i].offset);
@@ -700,7 +700,7 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)),
 
   /* Pass it to kernel. */
   return grub_xnu_register_memory ("DriversPackage-", &driverspackagenum,
-                                  loadto, readlen);  
+                                  loadto, readlen);
 }
 
 static grub_err_t
@@ -720,7 +720,7 @@ grub_cmd_xnu_ramdisk (grub_command_t cmd __attribute__ ((unused)),
 
   file = grub_gzfile_open (args[0], 1);
   if (! file)
-    return grub_error (GRUB_ERR_FILE_NOT_FOUND, 
+    return grub_error (GRUB_ERR_FILE_NOT_FOUND,
                       "Couldn't load ramdisk");
 
   err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE);
@@ -728,7 +728,7 @@ grub_cmd_xnu_ramdisk (grub_command_t cmd __attribute__ ((unused)),
     return err;
 
   size = grub_file_size (file);
-  
+
   loadto = grub_xnu_heap_malloc (size);
   if (! loadto)
     return grub_errno;
@@ -739,10 +739,10 @@ grub_cmd_xnu_ramdisk (grub_command_t cmd __attribute__ ((unused)),
       grub_error_push ();
       return grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", args[0]);
     }
-  return grub_xnu_register_memory ("RAMDisk", 0, loadto, size);  
+  return grub_xnu_register_memory ("RAMDisk", 0, loadto, size);
 }
 
-/* Parse a devtree file. It uses the following format: 
+/* Parse a devtree file. It uses the following format:
    valuename:valuedata;
    keyname{
      contents
@@ -766,12 +766,12 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent,
       if (*ptr == '}')
        return ptr + 1;
       namelen = 0;
-      
+
       /* Parse the name. */
-      for (ptr2 = ptr; ptr2 < end && (grub_isspace (*ptr2) 
+      for (ptr2 = ptr; ptr2 < end && (grub_isspace (*ptr2)
                                      || (*ptr2 >= '0' && *ptr2 <= '9')
                                      || (*ptr2 >= 'a' && *ptr2 <= 'f')
-                                     || (*ptr2 >= 'A' && *ptr2 <= 'F')); 
+                                     || (*ptr2 >= 'A' && *ptr2 <= 'F'));
           ptr2++)
        if (! grub_isspace (*ptr2))
          namelen++;
@@ -792,7 +792,7 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent,
            hex = *ptr - 'a' + 10;
          if (*ptr >= 'A' && *ptr <= 'F')
            hex = *ptr - 'A' + 10;
-         
+
          if (i % 2 == 0)
            name[i / 2] = hex << 4;
          else
@@ -806,7 +806,7 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent,
       /* If it describes a key recursively invoke the function. */
       if (*ptr == '{')
        {
-         struct grub_xnu_devtree_key *newkey 
+         struct grub_xnu_devtree_key *newkey
            = grub_xnu_create_key (parent, name);
          grub_free (name);
          if (! newkey)
@@ -820,10 +820,10 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent,
        return 0;
       ptr++;
       datalen = 0;
-      for (ptr2 = ptr; ptr2 < end && (grub_isspace (*ptr2) 
+      for (ptr2 = ptr; ptr2 < end && (grub_isspace (*ptr2)
                                      || (*ptr2 >= '0' && *ptr2 <= '9')
                                      || (*ptr2 >= 'a' && *ptr2 <= 'f')
-                                     || (*ptr2 >= 'A' && *ptr2 <= 'F')); 
+                                     || (*ptr2 >= 'A' && *ptr2 <= 'F'));
           ptr2++)
        if (! grub_isspace (*ptr2))
          datalen++;
@@ -844,7 +844,7 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent,
            hex = *ptr - 'a' + 10;
          if (*ptr >= 'A' && *ptr <= 'F')
            hex = *ptr - 'A' + 10;
-         
+
          if (i % 2 == 0)
            data[i / 2] = hex << 4;
          else
@@ -854,7 +854,7 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent,
       while (ptr < end && grub_isspace (*ptr))
        ptr++;
       {
-       struct grub_xnu_devtree_key *newkey 
+       struct grub_xnu_devtree_key *newkey
          = grub_xnu_create_value (parent, name);
        grub_free (name);
        if (! newkey)
@@ -871,7 +871,7 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent,
   return ptr;
 }
 
-/* Returns true if the kext should be loaded according to plist 
+/* Returns true if the kext should be loaded according to plist
    and osbundlereq. Also fill BINNAME. */
 static int
 grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq,
@@ -890,7 +890,7 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq,
   file = grub_gzfile_open (plistname, 1);
   if (! file)
     {
-      grub_file_close (file); 
+      grub_file_close (file);
       grub_error_push ();
       grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", plistname);
       return 0;
@@ -900,26 +900,26 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq,
   buf = grub_malloc (size);
   if (! buf)
     {
-      grub_file_close (file); 
+      grub_file_close (file);
       grub_error_push ();
       grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't read file %s", plistname);
       return 0;
     }
   if (grub_file_read (file, buf, size) != (grub_ssize_t) (size))
     {
-      grub_file_close (file); 
+      grub_file_close (file);
       grub_error_push ();
       grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", plistname);
       return 0;
     }
-  grub_file_close (file); 
+  grub_file_close (file);
 
   /* Set the return value for the case when no OSBundleRequired tag is found. */
   if (osbundlereq)
     ret = grub_strword (osbundlereq, "all") || grub_strword (osbundlereq, "-");
   else
     ret = 1;
-  
+
   /* Parse plist. It's quite dirty and inextensible but does its job. */
   for (ptr1 = buf; ptr1 < buf + size; ptr1++)
     switch (*ptr1)
@@ -927,17 +927,17 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq,
       case '<':
        tagstart = ptr1;
        *ptr1 = 0;
-       if (keyptr && depth == 4 
+       if (keyptr && depth == 4
            && grub_strcmp (keyptr, "OSBundleRequired") == 0)
          osbundlekeyfound = 1;
-       if (keyptr && depth == 4 && 
+       if (keyptr && depth == 4 &&
            grub_strcmp (keyptr, "CFBundleExecutable") == 0)
          binnamekeyfound = 1;
        if (stringptr && osbundlekeyfound && osbundlereq && depth == 4)
          {
            for (ptr2 = stringptr; *ptr2; ptr2++)
              *ptr2 = grub_tolower (*ptr2);
-           ret = grub_strword (osbundlereq, stringptr) 
+           ret = grub_strword (osbundlereq, stringptr)
              || grub_strword (osbundlereq, "all");
          }
        if (stringptr && binnamekeyfound && binname && depth == 4)
@@ -968,14 +968,14 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq,
        if (depth == 3 && grub_strcmp (tagstart + 1, "key") == 0)
          keyptr = ptr1 + 1;
        if (depth == 3 && grub_strcmp (tagstart + 1, "string") == 0)
-         stringptr = ptr1 + 1; 
+         stringptr = ptr1 + 1;
        else if (grub_strcmp (tagstart + 1, "/key") != 0)
          {
            osbundlekeyfound = 0;
            binnamekeyfound = 0;
          }
        *ptr1 = '>';
-       
+
        if (tagstart[1] == '/')
          depth--;
        else
@@ -984,12 +984,12 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq,
       }
   grub_free (buf);
 
-  return ret; 
+  return ret;
 }
 
 /* Load all loadable kexts placed under DIRNAME and matching OSBUNDLEREQUIRED */
 grub_err_t
-grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired, 
+grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired,
                             int maxrecursion)
 {
   grub_device_t dev;
@@ -997,7 +997,7 @@ grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired,
   grub_fs_t fs;
   const char *path;
 
-  auto int load_hook (const char *filename, 
+  auto int load_hook (const char *filename,
                      const struct grub_dirhook_info *info);
   int load_hook (const char *filename, const struct grub_dirhook_info *info)
   {
@@ -1011,7 +1011,7 @@ grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired,
        grub_memcmp (filename + grub_strlen (filename) - 5, ".kext", 5) != 0)
       return 0;
 
-    newdirname 
+    newdirname
       = grub_malloc (grub_strlen (dirname) + grub_strlen (filename) + 2);
 
     /* It's a .kext. Try to load it. */
@@ -1021,7 +1021,7 @@ grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired,
        newdirname[grub_strlen (newdirname) + 1] = 0;
        newdirname[grub_strlen (newdirname)] = '/';
        grub_strcpy (newdirname + grub_strlen (newdirname), filename);
-       grub_xnu_load_kext_from_dir (newdirname, osbundlerequired, 
+       grub_xnu_load_kext_from_dir (newdirname, osbundlerequired,
                                     maxrecursion);
        if (grub_errno == GRUB_ERR_BAD_OS)
          grub_errno = GRUB_ERR_NONE;
@@ -1055,7 +1055,7 @@ grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired,
 
 /* Load extension DIRNAME. (extensions are directories in xnu) */
 grub_err_t
-grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, 
+grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
                             int maxrecursion)
 {
   grub_device_t dev;
@@ -1069,16 +1069,16 @@ grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
   int usemacos = 0;
   grub_file_t binfile;
 
-  auto int load_hook (const char *filename, 
+  auto int load_hook (const char *filename,
                      const struct grub_dirhook_info *info);
 
   int load_hook (const char *filename, const struct grub_dirhook_info *info)
   {
     if (grub_strlen (filename) > 15)
       return 0;
-    grub_strcpy (newdirname + grub_strlen (dirname) + 1, filename); 
+    grub_strcpy (newdirname + grub_strlen (dirname) + 1, filename);
 
-    /* If the kext contains directory "Contents" all real stuff is in 
+    /* If the kext contains directory "Contents" all real stuff is in
        this directory. */
     if (info->dir && grub_strcasecmp (filename, "Contents") == 0)
       grub_xnu_load_kext_from_dir (newdirname, osbundlerequired,
@@ -1086,16 +1086,16 @@ grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
 
     /* Directory "Plugins" contains nested kexts. */
     if (info->dir && grub_strcasecmp (filename, "Plugins") == 0)
-      grub_xnu_scan_dir_for_kexts (newdirname, osbundlerequired, 
+      grub_xnu_scan_dir_for_kexts (newdirname, osbundlerequired,
                                   maxrecursion - 1);
 
-    /* Directory "MacOS" contains executable, otherwise executable is 
+    /* Directory "MacOS" contains executable, otherwise executable is
        on the top. */
     if (info->dir && grub_strcasecmp (filename, "MacOS") == 0)
       usemacos = 1;
-    
+
     /* Info.plist is the file which governs our future actions. */
-    if (! info->dir && grub_strcasecmp (filename, "Info.plist") == 0 
+    if (! info->dir && grub_strcasecmp (filename, "Info.plist") == 0
        && ! plistname)
       plistname = grub_strdup (newdirname);
     return 0;
@@ -1106,7 +1106,7 @@ grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
     return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't allocate buffer");
   grub_strcpy (newdirname, dirname);
   newdirname[grub_strlen (dirname)] = '/';
-  newdirname[grub_strlen (dirname) + 1] = 0;  
+  newdirname[grub_strlen (dirname) + 1] = 0;
   device_name = grub_file_get_device_name (dirname);
   dev = grub_device_open (device_name);
   if (dev)
@@ -1123,19 +1123,19 @@ grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
        newpath = newdirname;
       else
        newpath++;
-      
+
       /* Look at the directory. */
       if (fs)
        (fs->dir) (dev, path, load_hook);
 
-      if (plistname && grub_xnu_check_os_bundle_required 
+      if (plistname && grub_xnu_check_os_bundle_required
          (plistname, osbundlerequired, &binsuffix))
        {
          if (binsuffix)
            {
              /* Open the binary. */
-             char *binname = grub_malloc (grub_strlen (dirname) 
-                                          + grub_strlen (binsuffix) 
+             char *binname = grub_malloc (grub_strlen (dirname)
+                                          + grub_strlen (binsuffix)
                                           + sizeof ("/MacOS/"));
              grub_strcpy (binname, dirname);
              if (usemacos)
@@ -1145,10 +1145,10 @@ grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
              grub_strcpy (binname + grub_strlen (binname), binsuffix);
              grub_dprintf ("xnu", "%s:%s\n", plistname, binname);
              binfile = grub_gzfile_open (binname, 1);
-             if (! binfile) 
+             if (! binfile)
                grub_errno = GRUB_ERR_NONE;
 
-             /* Load the extension. */       
+             /* Load the extension. */
              grub_xnu_load_driver (plistname, binfile);
              grub_free (binname);
              grub_free (binsuffix);
@@ -1191,12 +1191,12 @@ grub_cmd_xnu_devtree (grub_command_t cmd __attribute__ ((unused)),
   if (! data)
     {
       grub_file_close (file);
-      return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+      return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                         "Could load device tree into memory");
     }
   if (grub_file_read (file, data, datalen) != (grub_ssize_t) datalen)
     {
-      grub_file_close (file); 
+      grub_file_close (file);
       grub_free (data);
       grub_error_push ();
       return grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", args[0]);
@@ -1237,7 +1237,7 @@ grub_cmd_xnu_kext (grub_command_t cmd __attribute__ ((unused)),
            }
        }
       return grub_xnu_load_driver (grub_strcmp (args[0], "-") ? args[0] : 0,
-                                  binfile);    
+                                  binfile);
     }
 
   /* load kext normally. */
@@ -1256,7 +1256,7 @@ grub_cmd_xnu_kextdir (grub_command_t cmd __attribute__ ((unused)),
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "directory name required");
 
   if (argc == 1)
-    return grub_xnu_scan_dir_for_kexts (args[0], 
+    return grub_xnu_scan_dir_for_kexts (args[0],
                                        "console,root,local-root,network-root",
                                        10);
   else
@@ -1264,7 +1264,7 @@ grub_cmd_xnu_kextdir (grub_command_t cmd __attribute__ ((unused)),
       char *osbundlerequired = grub_strdup (args[1]), *ptr;
       grub_err_t err;
       if (! osbundlerequired)
-       return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+       return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                           "couldn't allocate string temporary space");
       for (ptr = osbundlerequired; *ptr; ptr++)
        *ptr = grub_tolower (*ptr);
@@ -1282,8 +1282,8 @@ grub_cmd_xnu_splash (grub_command_t cmd __attribute__ ((unused)),
 {
   grub_err_t err;
   if (argc != 1)
-    return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");  
-  
+    return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
+
   err = grub_video_bitmap_load (&grub_xnu_bitmap, args[0]);
   if (err)
     grub_xnu_bitmap = 0;
@@ -1298,7 +1298,7 @@ grub_cmd_xnu_resume (grub_command_t cmd __attribute__ ((unused)),
 {
   if (argc != 1)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
-  
+
   return grub_xnu_resume (args[0]);
 }
 #endif
@@ -1319,7 +1319,7 @@ grub_xnu_unlock ()
   locked = 0;
 }
 
-static grub_command_t cmd_kernel, cmd_mkext, cmd_kext, cmd_kextdir, 
+static grub_command_t cmd_kernel, cmd_mkext, cmd_kext, cmd_kextdir,
   cmd_ramdisk, cmd_devtree, cmd_resume, cmd_splash;
 
 GRUB_MOD_INIT(xnu)
@@ -1330,7 +1330,7 @@ GRUB_MOD_INIT(xnu)
                                     "Load XNU extension package.");
   cmd_kext = grub_register_command ("xnu_kext", grub_cmd_xnu_kext, 0,
                                    "Load XNU extension.");
-  cmd_kextdir = grub_register_command ("xnu_kextdir", grub_cmd_xnu_kextdir, 
+  cmd_kextdir = grub_register_command ("xnu_kextdir", grub_cmd_xnu_kextdir,
                                       "xnu_kextdir DIRECTORY [OSBundleRequired]",
                                       "Load XNU extension directory");
   cmd_ramdisk = grub_register_command ("xnu_ramdisk", grub_cmd_xnu_ramdisk, 0,
@@ -1342,7 +1342,7 @@ GRUB_MOD_INIT(xnu)
                                      "Load a splash image for XNU");
 
 #ifndef GRUB_UTIL
-  cmd_resume = grub_register_command ("xnu_resume", grub_cmd_xnu_resume, 
+  cmd_resume = grub_register_command ("xnu_resume", grub_cmd_xnu_resume,
                                      0, "Load XNU hibernate image.");
 #endif
   my_mod=mod;
index b501e150b56b114d11c2ed3440b023ca7ff001d0..69453eab0b1c51ec7a4952dfe6ad73e0558f7b66 100644 (file)
@@ -53,13 +53,13 @@ grub_xnu_resume (char *imagename)
   file = grub_file_open (imagename);
   if (! file)
     return 0;
-  
+
   /* Read the header. */
   if (grub_file_read (file, (char *) &hibhead, sizeof (hibhead))
       !=sizeof (hibhead))
     {
       grub_file_close (file);
-      return grub_error (GRUB_ERR_READ_ERROR, 
+      return grub_error (GRUB_ERR_READ_ERROR,
                         "cannot read the hibernate header");
     }
 
@@ -67,13 +67,13 @@ grub_xnu_resume (char *imagename)
   if (hibhead.magic != GRUB_XNU_HIBERNATE_MAGIC)
     {
       grub_file_close (file);
-      return grub_error (GRUB_ERR_BAD_OS, 
+      return grub_error (GRUB_ERR_BAD_OS,
                         "hibernate header has incorrect magic number");
     }
   if (hibhead.encoffset)
     {
       grub_file_close (file);
-      return grub_error (GRUB_ERR_BAD_OS, 
+      return grub_error (GRUB_ERR_BAD_OS,
                         "encrypted images aren't supported yet");
     }
 
@@ -91,19 +91,19 @@ grub_xnu_resume (char *imagename)
   if (grub_xnu_hibernate_image)
     grub_free (grub_xnu_hibernate_image);
 
-  /* Try to allocate necessary space. 
+  /* Try to allocate necessary space.
      FIXME: mm isn't good enough yet to handle huge allocations.
    */
   grub_xnu_hibernate_image = buf = grub_malloc (hibhead.image_size);
   if (! buf)
     {
       grub_file_close (file);
-      return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+      return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                         "not enough memory to load image");
     }
 
   /* Read image. */
-  if (grub_file_seek (file, 0) == (grub_off_t)-1 
+  if (grub_file_seek (file, 0) == (grub_off_t)-1
       || grub_file_read (file, buf, hibhead.image_size)
       != (grub_ssize_t) hibhead.image_size)
     {
@@ -123,11 +123,11 @@ grub_xnu_resume (char *imagename)
 
   /* Prepare asm helper. */
   grub_memcpy (codetmp, ((grub_uint8_t *) buf) + total_header_size, codesize);
-  grub_memcpy (codetmp + codesize, grub_xnu_launcher_start, 
-              grub_xnu_launcher_end - grub_xnu_launcher_start);  
+  grub_memcpy (codetmp + codesize, grub_xnu_launcher_start,
+              grub_xnu_launcher_end - grub_xnu_launcher_start);
 
   /* We're ready now. */
-  grub_loader_set ((grub_err_t (*) (void)) (codetmp + codesize), 
+  grub_loader_set ((grub_err_t (*) (void)) (codetmp + codesize),
                   grub_xnu_resume_unload, 0);
 
   /* Prevent module from unloading. */
index d0dbc6a97e46a33d81972b7c1f6d5888eb522bde..316c997c7849e16f2361c359ee51c5aed95979ba 100644 (file)
@@ -29,8 +29,8 @@
   ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size)))
 
 grub_err_t
-grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, 
-                                                        grub_uint64_t, 
+grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
+                                                        grub_uint64_t,
                                                         grub_uint32_t))
 {
   grub_efi_uintn_t mmap_size = 0;
@@ -62,13 +62,13 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
        desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
     {
       grub_dprintf ("mmap", "EFI memory region 0x%llx-0x%llx: %d\n",
-                   (unsigned long long) desc->physical_start, 
+                   (unsigned long long) desc->physical_start,
                    (unsigned long long) desc->physical_start
                    + desc->num_pages * 4096, desc->type);
       switch (desc->type)
        {
        case GRUB_EFI_RUNTIME_SERVICES_CODE:
-         hook (desc->physical_start, desc->num_pages * 4096, 
+         hook (desc->physical_start, desc->num_pages * 4096,
                GRUB_MACHINE_MEMORY_CODE);
          break;
 
@@ -82,7 +82,7 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
        case GRUB_EFI_MEMORY_MAPPED_IO:
        case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE:
        case GRUB_EFI_PAL_CODE:
-         hook (desc->physical_start, desc->num_pages * 4096, 
+         hook (desc->physical_start, desc->num_pages * 4096,
                GRUB_MACHINE_MEMORY_RESERVED);
          break;
 
@@ -91,17 +91,17 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
        case GRUB_EFI_BOOT_SERVICES_CODE:
        case GRUB_EFI_BOOT_SERVICES_DATA:
        case GRUB_EFI_CONVENTIONAL_MEMORY:
-         hook (desc->physical_start, desc->num_pages * 4096, 
+         hook (desc->physical_start, desc->num_pages * 4096,
                GRUB_MACHINE_MEMORY_AVAILABLE);
          break;
 
        case GRUB_EFI_ACPI_RECLAIM_MEMORY:
-         hook (desc->physical_start, desc->num_pages * 4096, 
+         hook (desc->physical_start, desc->num_pages * 4096,
                GRUB_MACHINE_MEMORY_ACPI);
          break;
 
        case GRUB_EFI_ACPI_MEMORY_NVS:
-         hook (desc->physical_start, desc->num_pages * 4096, 
+         hook (desc->physical_start, desc->num_pages * 4096,
                GRUB_MACHINE_MEMORY_NVS);
          break;
        }
@@ -110,7 +110,7 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
   return GRUB_ERR_NONE;
 }
 
-static inline grub_efi_memory_type_t 
+static inline grub_efi_memory_type_t
 make_efi_memtype (int type)
 {
   switch (type)
@@ -118,10 +118,10 @@ make_efi_memtype (int type)
     case GRUB_MACHINE_MEMORY_CODE:
       return GRUB_EFI_RUNTIME_SERVICES_CODE;
 
-      /* No way to remove a chunk of memory from EFI mmap. 
+      /* No way to remove a chunk of memory from EFI mmap.
         So mark it as unusable. */
     case GRUB_MACHINE_MEMORY_HOLE:
-      
+
     default:
 
     case GRUB_MACHINE_MEMORY_RESERVED:
@@ -135,7 +135,7 @@ make_efi_memtype (int type)
 
     case GRUB_MACHINE_MEMORY_NVS:
       return GRUB_EFI_ACPI_RECLAIM_MEMORY;
-      
+
     }
 
 }
@@ -164,7 +164,7 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type)
   curover = (struct overlay *) grub_malloc (sizeof (struct overlay));
   if (! curover)
     return 0;
-      
+
   b = grub_efi_system_table->boot_services;
   address = start & (~0x3ffULL);
   pages = (end - address  + 0x3ff) >> 12;
@@ -174,7 +174,7 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type)
       grub_free (curover);
       return 0;
     }
-  status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ADDRESS, 
+  status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ADDRESS,
                       make_efi_memtype (type), pages, &address);
   if (status != GRUB_EFI_SUCCESS)
     {
@@ -190,7 +190,7 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type)
   return curover->handle;
 }
 
-grub_err_t 
+grub_err_t
 grub_mmap_unregister (int handle)
 {
   struct overlay *curover, *prevover;
@@ -199,8 +199,8 @@ grub_mmap_unregister (int handle)
 
   b = grub_efi_system_table->boot_services;
 
-  
-  for (curover = overlays, prevover = 0; curover; 
+
+  for (curover = overlays, prevover = 0; curover;
        prevover = curover, curover = curover->next)
     {
       if (curover->handle == handle)
@@ -219,9 +219,9 @@ grub_mmap_unregister (int handle)
 
 /* Result is always page-aligned. */
 void *
-grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)), 
+grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)),
                               grub_uint64_t size,
-                              int *handle, int type, 
+                              int *handle, int type,
                               int flags __attribute__ ((unused)))
 {
   grub_efi_physical_address_t address;
@@ -234,7 +234,7 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)),
   curover = (struct overlay *) grub_malloc (sizeof (struct overlay));
   if (! curover)
     return 0;
-      
+
   b = grub_efi_system_table->boot_services;
 
   address = 0xffffffff;
@@ -247,7 +247,7 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)),
 #endif
 
   pages = (size + 0x3ff) >> 12;
-  status = efi_call_4 (b->allocate_pages, atype, 
+  status = efi_call_4 (b->allocate_pages, atype,
                       make_efi_memtype (type), pages, &address);
   if (status != GRUB_EFI_SUCCESS)
     {
@@ -260,13 +260,13 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)),
       /* Uggh, the address 0 was allocated... This is too annoying,
         so reallocate another one.  */
       address = 0xffffffff;
-      status = efi_call_4 (b->allocate_pages, atype, 
+      status = efi_call_4 (b->allocate_pages, atype,
                           make_efi_memtype (type), pages, &address);
       grub_efi_free_pages (0, pages);
       if (status != GRUB_EFI_SUCCESS)
        return 0;
     }
-  
+
   curover->next = overlays;
   curover->handle = curhandle++;
   curover->address = address;
@@ -277,7 +277,7 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)),
   return UINT_TO_PTR (curover->address);
 }
 
-void 
+void
 grub_mmap_free_and_unregister (int handle)
 {
   grub_mmap_unregister (handle);
index 9f751d0ac03819d3a6482064981bf3b6762bbcb5..f6e16129e3915ceee688039924ac3b31e018b9ff 100644 (file)
@@ -32,9 +32,9 @@ grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size,
 {
   grub_uint64_t highestlow = 0;
 
-  auto int NESTED_FUNC_ATTR find_hook (grub_uint64_t, grub_uint64_t, 
+  auto int NESTED_FUNC_ATTR find_hook (grub_uint64_t, grub_uint64_t,
                                       grub_uint32_t);
-  int NESTED_FUNC_ATTR find_hook (grub_uint64_t start, grub_uint64_t rangesize, 
+  int NESTED_FUNC_ATTR find_hook (grub_uint64_t start, grub_uint64_t rangesize,
                                  grub_uint32_t memtype)
   {
     grub_uint64_t end = start + rangesize;
@@ -69,7 +69,7 @@ grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size,
     {
       grub_free (ret);
       return 0;
-    }    
+    }
 
   return ret;
 }
@@ -88,7 +88,7 @@ grub_mmap_free_and_unregister (int handle)
     return;
 
   addr = cur->start;
-    
+
   grub_mmap_unregister (handle);
 
   if (addr >= 0x100000)
index ec517275e34e69e3c209b33a19a2ece89de3379b..0e2dfe6a614575e26a4ba6dcb7d914778643f013 100644 (file)
@@ -50,13 +50,13 @@ struct grub_e820_mmap_entry
 } __attribute__((packed));
 
 
-static grub_err_t 
+static grub_err_t
 preboot (int noreturn __attribute__ ((unused)))
 {
   struct grub_e820_mmap_entry *hookmmap, *hookmmapcur;
-  auto int NESTED_FUNC_ATTR fill_hook (grub_uint64_t, grub_uint64_t, 
+  auto int NESTED_FUNC_ATTR fill_hook (grub_uint64_t, grub_uint64_t,
                                       grub_uint32_t);
-  int NESTED_FUNC_ATTR fill_hook (grub_uint64_t addr, grub_uint64_t size, 
+  int NESTED_FUNC_ATTR fill_hook (grub_uint64_t addr, grub_uint64_t size,
                                  grub_uint32_t type)
   {
     grub_dprintf ("mmap", "mmap chunk %llx-%llx:%x\n", addr, addr + size, type);
@@ -68,22 +68,22 @@ preboot (int noreturn __attribute__ ((unused)))
   }
 
   if (! hooktarget)
-    return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+    return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                       "no space is allocated for memory hook");
 
   grub_dprintf ("mmap", "installing preboot handlers\n");
 
-  hookmmapcur = hookmmap = (struct grub_e820_mmap_entry *) 
-    ((grub_uint8_t *) hooktarget + (&grub_machine_mmaphook_end 
+  hookmmapcur = hookmmap = (struct grub_e820_mmap_entry *)
+    ((grub_uint8_t *) hooktarget + (&grub_machine_mmaphook_end
                                    - &grub_machine_mmaphook_start));
 
-  grub_mmap_iterate (fill_hook);  
+  grub_mmap_iterate (fill_hook);
   grub_machine_mmaphook_mmap_num = hookmmapcur - hookmmap;
 
   grub_machine_mmaphook_kblow = grub_mmap_get_lower () >> 10;
-  grub_machine_mmaphook_kbin16mb 
+  grub_machine_mmaphook_kbin16mb
     = min (grub_mmap_get_upper (),0x3f00000ULL) >> 10;
-  grub_machine_mmaphook_64kbin4gb 
+  grub_machine_mmaphook_64kbin4gb
     = min (grub_mmap_get_post64 (), 0xfc000000ULL) >> 16;
 
   /* Correct BDA. */
@@ -103,7 +103,7 @@ preboot (int noreturn __attribute__ ((unused)))
 
   *((grub_uint16_t *) 0x4a) = PTR_TO_UINT32 (hooktarget) >> 4;
   *((grub_uint16_t *) 0x56) = PTR_TO_UINT32 (hooktarget) >> 4;
-  *((grub_uint16_t *) 0x48) = &grub_machine_mmaphook_int12 
+  *((grub_uint16_t *) 0x48) = &grub_machine_mmaphook_int12
     - &grub_machine_mmaphook_start;
   *((grub_uint16_t *) 0x54) = &grub_machine_mmaphook_int15
     - &grub_machine_mmaphook_start;
@@ -123,7 +123,7 @@ preboot_rest (void)
   return GRUB_ERR_NONE;
 }
 
-static grub_err_t 
+static grub_err_t
 malloc_hook (void)
 {
   static int reentry = 0;
@@ -131,10 +131,10 @@ malloc_hook (void)
   static int slots_available = 0;
   int hooksize;
   int regcount = 0;
-  auto int NESTED_FUNC_ATTR count_hook (grub_uint64_t, grub_uint64_t, 
+  auto int NESTED_FUNC_ATTR count_hook (grub_uint64_t, grub_uint64_t,
                                        grub_uint32_t);
-  int NESTED_FUNC_ATTR count_hook (grub_uint64_t addr __attribute__ ((unused)), 
-                                  grub_uint64_t size __attribute__ ((unused)), 
+  int NESTED_FUNC_ATTR count_hook (grub_uint64_t addr __attribute__ ((unused)),
+                                  grub_uint64_t size __attribute__ ((unused)),
                                   grub_uint32_t type __attribute__ ((unused)))
   {
     regcount++;
@@ -165,13 +165,13 @@ malloc_hook (void)
     + regcount * sizeof (struct grub_e820_mmap_entry);
   /* Allocate an integer number of KiB. */
   hooksize = ((hooksize - 1) | 0x3ff) + 1;
-  slots_available = (hooksize - (&grub_machine_mmaphook_end 
+  slots_available = (hooksize - (&grub_machine_mmaphook_end
                                 - &grub_machine_mmaphook_start))
     / sizeof (struct grub_e820_mmap_entry);
 
   reentry = 1;
-  hooktarget 
-    = grub_mmap_malign_and_register (16, hooksize, &mmapregion, 
+  hooktarget
+    = grub_mmap_malign_and_register (16, hooksize, &mmapregion,
                                     GRUB_MACHINE_MEMORY_RESERVED,
                                     GRUB_MMAP_MALLOC_LOW);
   reentry = 0;
@@ -185,8 +185,8 @@ malloc_hook (void)
 }
 
 grub_err_t
-grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), 
-                           grub_uint64_t size __attribute__ ((unused)), 
+grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)),
+                           grub_uint64_t size __attribute__ ((unused)),
                            int type __attribute__ ((unused)),
                            int handle  __attribute__ ((unused)))
 {
@@ -200,8 +200,8 @@ grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)),
   if (! preb_handle)
     {
       grub_dprintf ("mmap", "adding preboot\n");
-      preb_handle 
-       = grub_loader_register_preboot_hook (preboot, preboot_rest, 
+      preb_handle
+       = grub_loader_register_preboot_hook (preboot, preboot_rest,
                                             GRUB_LOADER_PREBOOT_HOOK_PRIO_MEMORY);
       if (! preb_handle)
        return grub_errno;
index f153f1c981e6a41fabf47caa7b50eb77dde0e24a..c6d12fd6c3e62c6da65c485562df971032c7ad84 100644 (file)
@@ -21,7 +21,7 @@
 
 #define DS(x) ((x) - segstart)
 
-segstart:      
+segstart:
 VARIABLE(grub_machine_mmaphook_start)
        .code16
 VARIABLE(grub_machine_mmaphook_int12)
@@ -52,7 +52,7 @@ VARIABLE (grub_machine_mmaphook_int15offset)
        .word   0
 VARIABLE (grub_machine_mmaphook_int15segment)
        .word   0
-       
+
 e801:
        popf
        push %ds
@@ -128,8 +128,8 @@ e820:
        cmpw DS(EXT_C(grub_machine_mmaphook_mmap_num)), %bx
 #endif
        jb noclean
-       xor %bx, %bx    
-noclean:       
+       xor %bx, %bx
+noclean:
        mov $0x534d4150, %eax
        pop %ds
        clc
@@ -139,8 +139,8 @@ errexit:
        pop %ds
        stc
        xor %bx, %bx
-       iret    
-       
+       iret
+
 VARIABLE(grub_machine_mmaphook_mmap_num)
        .word 0
 VARIABLE(grub_machine_mmaphook_kblow)
index 5f6eece0e57cda92a8a00ea3dff36bf27cb6ccf4..cd1a452393ccb21c7c34e525110eba9f574c22b5 100644 (file)
@@ -21,7 +21,7 @@
 #include <grub/mm.h>
 #include <grub/misc.h>
 
-grub_uint64_t 
+grub_uint64_t
 grub_mmap_get_lower (void)
 {
   grub_uint64_t lower = 0;
@@ -43,7 +43,7 @@ grub_mmap_get_lower (void)
   return lower;
 }
 
-grub_uint64_t 
+grub_uint64_t
 grub_mmap_get_upper (void)
 {
   grub_uint64_t upper = 0;
@@ -64,7 +64,7 @@ grub_mmap_get_upper (void)
 }
 
 /* Count the continuous bytes after 64 MiB. */
-grub_uint64_t 
+grub_uint64_t
 grub_mmap_get_post64 (void)
 {
   grub_uint64_t post64 = 0;
index 67f7c7b0bfa548b4da1f5f5b6ed0a269cd1a7f56..f2407c0bd012ee6915a9192e8dabdb001103a202 100644 (file)
@@ -33,14 +33,14 @@ static int curhandle = 1;
 #endif
 
 grub_err_t
-grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, 
+grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
                                                 grub_uint64_t, grub_uint32_t))
 {
 
   /* This function resolves overlapping regions and sorts the memory map.
      It uses scanline (sweeping) algorithm.
   */
-  /* If same page is used by multiple types it's resolved 
+  /* If same page is used by multiple types it's resolved
      according to priority:
      1 - free memory
      2 - memory usable by firmware-aware code
@@ -92,11 +92,11 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
   /* Number of mmap chunks. */
   int mmap_num;
 
-#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE     
+#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE
   struct grub_mmap_region *cur;
 #endif
-  
-  auto int NESTED_FUNC_ATTR count_hook (grub_uint64_t, grub_uint64_t, 
+
+  auto int NESTED_FUNC_ATTR count_hook (grub_uint64_t, grub_uint64_t,
                                        grub_uint32_t);
   int NESTED_FUNC_ATTR count_hook (grub_uint64_t addr __attribute__ ((unused)),
                                   grub_uint64_t size __attribute__ ((unused)),
@@ -106,7 +106,7 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
     return 0;
   }
 
-  auto int NESTED_FUNC_ATTR fill_hook (grub_uint64_t, grub_uint64_t, 
+  auto int NESTED_FUNC_ATTR fill_hook (grub_uint64_t, grub_uint64_t,
                                        grub_uint32_t);
   int NESTED_FUNC_ATTR fill_hook (grub_uint64_t addr,
                                  grub_uint64_t size,
@@ -131,35 +131,35 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
 
     return 0;
   }
-  
+
   mmap_num = 0;
 
-#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE   
+#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE
   for (cur = grub_mmap_overlays; cur; cur = cur->next)
     mmap_num++;
 #endif
 
   grub_machine_mmap_iterate (count_hook);
-  
+
   /* Initialize variables. */
   grub_memset (present, 0, sizeof (present));
-  scanline_events = (struct grub_mmap_scan *) 
+  scanline_events = (struct grub_mmap_scan *)
     grub_malloc (sizeof (struct grub_mmap_scan) * 2 * mmap_num);
-  
+
   if (! scanline_events)
     {
-      return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+      return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                         "couldn't allocate space for new memory map");
     }
 
   i = 0;
-#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE   
+#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE
   /* Register scanline events. */
   for (cur = grub_mmap_overlays; cur; cur = cur->next)
     {
       scanline_events[i].pos = cur->start;
       scanline_events[i].type = 0;
-      if (cur->type == GRUB_MACHINE_MEMORY_HOLE 
+      if (cur->type == GRUB_MACHINE_MEMORY_HOLE
          || (cur->type >= 0 && cur->type <= GRUB_MACHINE_MEMORY_MAX_TYPE
              && priority[cur->type]))
        scanline_events[i].memtype = cur->type;
@@ -176,8 +176,8 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
 
   grub_machine_mmap_iterate (fill_hook);
 
-  /* Primitive bubble sort. It has complexity O(n^2) but since we're 
-     unlikely to have more than 100 chunks it's probably one of the 
+  /* Primitive bubble sort. It has complexity O(n^2) but since we're
+     unlikely to have more than 100 chunks it's probably one of the
      fastest for one purpose. */
   done = 1;
   while (done)
@@ -186,7 +186,7 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
       for (i = 0; i < 2 * mmap_num - 1; i++)
        if (scanline_events[i + 1].pos < scanline_events[i].pos
            || (scanline_events[i + 1].pos == scanline_events[i].pos
-               && scanline_events[i + 1].type == 0 
+               && scanline_events[i + 1].type == 0
                && scanline_events[i].type == 1))
          {
            t = scanline_events[i + 1];
@@ -213,7 +213,7 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
          curtype = k;
 
       /* Announce region to the hook if necessary. */
-      if ((curtype == -1 || curtype != lasttype) 
+      if ((curtype == -1 || curtype != lasttype)
          && lastaddr != scanline_events[i].pos
          && lasttype != -1
          && lasttype != GRUB_MACHINE_MEMORY_HOLE
@@ -224,7 +224,7 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
        }
 
       /* Update last values if necessary. */
-      if (curtype == -1 || curtype != lasttype) 
+      if (curtype == -1 || curtype != lasttype)
        {
          lasttype = curtype;
          lastaddr = scanline_events[i].pos;
@@ -235,7 +235,7 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
   return GRUB_ERR_NONE;
 }
 
-#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE   
+#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE
 int
 grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type)
 {
@@ -243,11 +243,11 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type)
 
   grub_dprintf ("mmap", "registering\n");
 
-  cur = (struct grub_mmap_region *) 
+  cur = (struct grub_mmap_region *)
     grub_malloc (sizeof (struct grub_mmap_region));
   if (! cur)
     {
-      grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+      grub_error (GRUB_ERR_OUT_OF_MEMORY,
                  "couldn't allocate memory map overlay");
       return 0;
     }
@@ -295,7 +295,7 @@ grub_mmap_unregister (int handle)
 
 #define CHUNK_SIZE     0x400
 
-static inline grub_uint64_t 
+static inline grub_uint64_t
 fill_mask (grub_uint64_t addr, grub_uint64_t mask, grub_uint64_t iterator)
 {
   int i, j;
@@ -324,15 +324,15 @@ grub_cmd_badram (grub_command_t cmd __attribute__ ((unused)),
   grub_uint64_t badaddr, badmask;
 
   auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t);
-  int NESTED_FUNC_ATTR hook (grub_uint64_t addr, 
-                            grub_uint64_t size, 
+  int NESTED_FUNC_ATTR hook (grub_uint64_t addr,
+                            grub_uint64_t size,
                             grub_uint32_t type __attribute__ ((unused)))
   {
     grub_uint64_t iterator, low, high, cur;
     int tail, var;
     int i;
-    grub_dprintf ("badram", "hook %llx+%llx\n", (unsigned long long) addr, 
-                 (unsigned long long) size); 
+    grub_dprintf ("badram", "hook %llx+%llx\n", (unsigned long long) addr,
+                 (unsigned long long) size);
 
     /* How many trailing zeros? */
     for (tail = 0; ! (badmask & (1ULL << tail)); tail++);
@@ -349,7 +349,7 @@ grub_cmd_badram (grub_command_t cmd __attribute__ ((unused)),
       {
        low = 0;
        high = ~0ULL;
-       /* Find starting value. Keep low and high such that 
+       /* Find starting value. Keep low and high such that
           fill_mask (low) < addr and fill_mask (high) >= addr;
        */
        while (high - low > 1)
@@ -364,11 +364,11 @@ grub_cmd_badram (grub_command_t cmd __attribute__ ((unused)),
       }
 
     for (; iterator < (1ULL << (var - tail))
-          && (cur = fill_mask (badaddr, badmask, iterator)) < addr + size; 
+          && (cur = fill_mask (badaddr, badmask, iterator)) < addr + size;
         iterator++)
       {
-       grub_dprintf ("badram", "%llx (size %llx) is a badram range\n", 
-                     (long long) cur, (long long) (1ULL << tail) - 1); 
+       grub_dprintf ("badram", "%llx (size %llx) is a badram range\n",
+                     (long long) cur, (long long) (1ULL << tail) - 1);
        grub_mmap_register (cur, (1ULL << tail) - 1, GRUB_MACHINE_MEMORY_HOLE);
       }
     return 0;
@@ -401,7 +401,7 @@ grub_cmd_badram (grub_command_t cmd __attribute__ ((unused)),
         no point in providing sub-page chunks.  */
       badmask &= ~(CHUNK_SIZE - 1);
 
-      grub_dprintf ("badram", "badram %llx:%llx\n", 
+      grub_dprintf ("badram", "badram %llx:%llx\n",
                    (unsigned long long) badaddr, (unsigned long long) badmask);
 
       grub_mmap_iterate (hook);
@@ -414,7 +414,7 @@ static grub_command_t cmd;
 GRUB_MOD_INIT(mmap)
 {
   cmd = grub_register_command ("badram", grub_cmd_badram,
-                              "badram ADDR1,MASK1[,ADDR2,MASK2[,...]]", 
+                              "badram ADDR1,MASK1[,ADDR2,MASK2[,...]]",
                               "declare memory regions as badram");
 }
 
index 4ef8890fb80068783cb5bc3ba749b5baedcc00f9..9a07d7d592a4793cc39c3083a188e38520806153 100644 (file)
@@ -72,7 +72,7 @@ grub_set_history (int newsize)
          /* Copy the older part.  */
          grub_memmove (hist_lines, old_hist_lines + hist_pos,
                        (hist_size - hist_pos) * sizeof (char *));
-         
+
          /* Copy the newer part. */
          grub_memmove (hist_lines + hist_size - hist_pos, old_hist_lines,
                        hist_end * sizeof (char *));
@@ -162,7 +162,7 @@ print_completion (const char *item, grub_completion_type_t type, int count)
          what = "things";
          break;
        }
-           
+
       grub_printf ("\nPossible %s are:\n", what);
     }
 
@@ -199,10 +199,10 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
       xpos = (plen + lpos) % 79;
       ypos = ystart + (plen + lpos) / 79;
       grub_gotoxy (xpos, ypos);
-      
+
       grub_refresh ();
     }
-  
+
   void cl_print (int pos, int c)
     {
       char *p;
@@ -212,7 +212,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
          if (xpos++ > 78)
            {
              grub_putchar ('\n');
-             
+
              xpos = 1;
              if (ypos == (unsigned) (grub_getxy () & 0xFF))
                ystart--;
@@ -226,7 +226,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
            grub_putchar (*p);
        }
     }
-  
+
   void cl_insert (const char *str)
     {
       grub_size_t len = grub_strlen (str);
@@ -241,7 +241,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
          cl_print (lpos - len, echo_char);
          cl_set_pos ();
        }
-      
+
       grub_refresh ();
     }
 
@@ -256,28 +256,28 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
          cl_print (lpos, ' ');
          lpos = saved_lpos;
          cl_set_pos ();
-         
+
          grub_memmove (buf + lpos, buf + lpos + len, llen - lpos + 1);
          llen -= len;
          cl_print (lpos, echo_char);
          cl_set_pos ();
        }
-      
+
       grub_refresh ();
     }
-  
+
   plen = grub_strlen (prompt);
   lpos = llen = 0;
   buf[0] = '\0';
 
   if ((grub_getxy () >> 8) != 0)
     grub_putchar ('\n');
-  
+
   grub_printf (prompt);
-  
+
   xpos = plen;
   ystart = ypos = (grub_getxy () & 0xFF);
-  
+
   cl_insert (cmdline);
 
   if (hist_used == 0)
@@ -319,18 +319,18 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
              {
                char *insert;
                int restore;
-               
+
                /* Backup the next character and make it 0 so it will
                   be easy to use string functions.  */
                char backup = buf[lpos];
                buf[lpos] = '\0';
-               
+
 
                insert = grub_normal_do_completion (buf, &restore,
                                                    print_completion);
                /* Restore the original string.  */
                buf[lpos] = backup;
-               
+
                if (restore)
                  {
                    /* Restore the prompt.  */
@@ -401,7 +401,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
              if (lpos > 0)
                {
                  grub_size_t n = lpos;
-                 
+
                  if (kill_buf)
                    grub_free (kill_buf);
 
@@ -440,7 +440,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
           else
             break;
          /* fall through */
-         
+
        case 4: /* Ctrl-d */
          if (lpos < llen)
            cl_delete (1);
@@ -474,7 +474,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
       grub_history_replace (histpos, buf);
       grub_history_add ("");
     }
-  
+
   grub_memcpy (cmdline, buf + lpos, llen - lpos + 1);
 
   return 1;
index 03effd8d6922e2c2683c8c77af333c0d66cf1430..4b38e334debd69b89b6242ab59c055032a09d59f 100644 (file)
@@ -69,7 +69,7 @@ add_completion (const char *completion, const char *extra,
        case 2:
          if (print_func)
            print_func (match, type, 0);
-         
+
          /* Fall through.  */
 
        default:
@@ -79,7 +79,7 @@ add_completion (const char *completion, const char *extra,
 
            if (print_func)
              print_func (completion, type, num_found - 1);
-                           
+
            /* Detect the matched portion.  */
            while (*s && *t && *s == *t)
              {
@@ -92,7 +92,7 @@ add_completion (const char *completion, const char *extra,
          break;
        }
     }
-      
+
   return 0;
 }
 
@@ -103,7 +103,7 @@ iterate_partition (grub_disk_t disk, const grub_partition_t p)
   char *partition_name = grub_partition_get_name (p);
   char *name;
   int ret;
-  
+
   if (! partition_name)
     return 1;
 
@@ -117,7 +117,7 @@ iterate_partition (grub_disk_t disk, const grub_partition_t p)
 
   grub_sprintf (name, "%s,%s", disk_name, partition_name);
   grub_free (partition_name);
-  
+
   ret = add_completion (name, ")", GRUB_COMPLETION_TYPE_PARTITION);
   grub_free (name);
   return ret;
@@ -147,7 +147,7 @@ iterate_dir (const char *filename, const struct grub_dirhook_info *info)
       if (add_completion (fname, "", GRUB_COMPLETION_TYPE_FILE))
        return 1;
     }
-  
+
   return 0;
 }
 
@@ -155,10 +155,10 @@ static int
 iterate_dev (const char *devname)
 {
   grub_device_t dev;
-  
+
   /* Complete the partition part.  */
   dev = grub_device_open (devname);
-  
+
   if (dev)
     {
       if (dev->disk && dev->disk->has_partitions)
@@ -172,7 +172,7 @@ iterate_dev (const char *devname)
            return 1;
        }
     }
-  
+
   grub_errno = GRUB_ERR_NONE;
   return 0;
 }
@@ -188,7 +188,7 @@ iterate_command (grub_command_t cmd)
            return 1;
        }
     }
-  
+
   return 0;
 }
 
@@ -199,7 +199,7 @@ complete_device (void)
   /* Check if this is a device or a partition.  */
   char *p = grub_strchr (++current_word, ',');
   grub_device_t dev;
-  
+
   if (! p)
     {
       /* Complete the disk part.  */
@@ -213,7 +213,7 @@ complete_device (void)
       dev = grub_device_open (current_word);
       *p = ',';
       grub_errno = GRUB_ERR_NONE;
-      
+
       if (dev)
        {
          if (dev->disk && dev->disk->has_partitions)
@@ -224,7 +224,7 @@ complete_device (void)
                  return 1;
                }
            }
-         
+
          grub_device_close (dev);
        }
       else
@@ -244,18 +244,18 @@ complete_file (void)
   grub_fs_t fs;
   grub_device_t dev;
   int ret = 0;
-  
+
   device = grub_file_get_device_name (current_word);
   if (grub_errno != GRUB_ERR_NONE)
     return 1;
-  
+
   dev = grub_device_open (device);
   if (! dev)
     {
       ret = 1;
       goto fail;
     }
-  
+
   fs = grub_fs_probe (dev);
   if (! fs)
     {
@@ -268,25 +268,25 @@ complete_file (void)
   if (dir)
     {
       char *dirfile;
-      
+
       current_word = last_dir + 1;
-      
+
       dir = grub_strdup (dir);
       if (! dir)
        {
          ret = 1;
          goto fail;
        }
-      
+
       /* Cut away the filename part.  */
       dirfile = grub_strrchr (dir, '/');
       dirfile[1] = '\0';
-      
+
       /* Iterate the directory.  */
       (fs->dir) (dev, dir, iterate_dir);
-      
+
       grub_free (dir);
-      
+
       if (grub_errno)
        {
          ret = 1;
@@ -302,7 +302,7 @@ complete_file (void)
          ret = 1;
          goto fail;
        }
-      
+
       suffix = "";
       num_found = 1;
     }
@@ -323,7 +323,7 @@ complete_arguments (char *command)
   const struct grub_arg_option *option;
   char shortarg[] = "- ";
 
-  cmd = grub_command_find (command); 
+  cmd = grub_command_find (command);
 
   if (!cmd || !(cmd->flags & GRUB_COMMAND_FLAG_EXTCMD))
     return 0;
@@ -478,13 +478,13 @@ grub_normal_do_completion (char *buf, int *restore,
 
       if (num_found == 1)
        grub_strcat (ret, suffix);
-      
+
       if (*ret == '\0')
        {
          grub_free (ret);
           goto fail;
        }
-      
+
       grub_free (argv[0]);
       grub_free (match);
       return ret;
index 9e667b79cd718b01ce4032648c8ef38ba34ed5c4..44791e18c5a29f73a61e40fbf0f7d021ff063f51 100644 (file)
@@ -60,10 +60,10 @@ grub_unixtime2datetime (grub_int32_t nix, struct grub_datetime *datetime)
 {
   int i;
   int div;
-  grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 
-  /* In the period of validity of unixtime all years divisible by 4 
+  grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+  /* In the period of validity of unixtime all years divisible by 4
      are bissextile*/
-  /* Convenience: let's have 3 consecutive non-bissextile years 
+  /* Convenience: let's have 3 consecutive non-bissextile years
      at the beginning of the epoch. So count from 1973 instead of 1970 */
   nix -= 3*SECPERYEAR + SECPERDAY;
   /* Transform C divisions and modulos to mathematical ones */
@@ -85,15 +85,15 @@ grub_unixtime2datetime (grub_int32_t nix, struct grub_datetime *datetime)
       datetime->year += nix / SECPERYEAR;
       nix %= SECPERYEAR;
     }
-  for (i = 0; i < 12 
-        && nix >= ((grub_int32_t) (i==1 && datetime->year % 4 == 0 
+  for (i = 0; i < 12
+        && nix >= ((grub_int32_t) (i==1 && datetime->year % 4 == 0
                                    ? 29 : months[i]))*SECPERDAY; i++)
-    nix -= ((grub_int32_t) (i==1 && datetime->year % 4 == 0 
+    nix -= ((grub_int32_t) (i==1 && datetime->year % 4 == 0
                            ? 29 : months[i]))*SECPERDAY;
-  datetime->month = i + 1; 
+  datetime->month = i + 1;
   datetime->day = 1 + (nix / SECPERDAY);
   nix %= SECPERDAY;
-  datetime->hour = (nix / SECPERHOUR);  
+  datetime->hour = (nix / SECPERHOUR);
   nix %= SECPERHOUR;
   datetime->minute = nix / SECPERMIN;
   datetime->second = nix % SECPERMIN;
index 9c5a827316baa61e3a4e5ab34e6851844deb5f71..7f6336eebdeb8a19e8c2acee7588c34960dfcb6a 100644 (file)
@@ -112,7 +112,7 @@ grub_file_getline (grub_file_t file)
       grub_free (cmdline);
       cmdline = 0;
     }
-  
+
   return cmdline;
 }
 
@@ -291,7 +291,7 @@ read_config_file (const char *config)
 {
   grub_file_t file;
   grub_parser_t old_parser = 0;
-  
+
   auto grub_err_t getline (char **line, int cont);
   grub_err_t getline (char **line, int cont __attribute__ ((unused)))
     {
@@ -406,7 +406,7 @@ grub_normal_execute (const char *config, int nested, int batch)
   grub_command_execute ("parser.sh", 0, 0);
 
   reader_nested = nested;
-  
+
   if (config)
     {
       menu = read_config_file (config);
@@ -446,7 +446,7 @@ grub_cmd_normal (struct grub_command *cmd,
         so that it won't get broken by longjmp.  */
       static char *config;
       const char *prefix;
-      
+
       prefix = grub_env_get ("prefix");
       if (prefix)
        {
index 6ec0d632acfc8596e166f177303c96e69440bff9..86e581e8098531e9f18b444720c419e764178960 100644 (file)
@@ -107,7 +107,7 @@ print_line (struct line *linep, int offset, int start, int y)
 {
   int i;
   char *p;
-  
+
   grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + start + 1,
               y + GRUB_TERM_FIRST_ENTRY_Y);
 
@@ -130,7 +130,7 @@ static void
 print_empty_line (int y)
 {
   int i;
-  
+
   grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + 1,
               y + GRUB_TERM_FIRST_ENTRY_Y);
 
@@ -144,26 +144,26 @@ print_up (int flag)
 {
   grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH,
               GRUB_TERM_FIRST_ENTRY_Y);
-  
+
   if (flag)
     grub_putcode (GRUB_TERM_DISP_UP);
   else
     grub_putchar (' ');
 }
-         
+
 /* Print a down arrow.  */
 static void
 print_down (int flag)
 {
   grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH,
               GRUB_TERM_TOP_BORDER_Y + GRUB_TERM_NUM_ENTRIES);
-  
+
   if (flag)
     grub_putcode (GRUB_TERM_DISP_DOWN);
   else
     grub_putchar (' ');
 }
-         
+
 /* Draw the lines of the screen SCREEN.  */
 static void
 update_screen (struct screen *screen, int region_start, int region_column,
@@ -174,7 +174,7 @@ update_screen (struct screen *screen, int region_start, int region_column,
   int y;
   int i;
   struct line *linep;
-  
+
   /* Check if scrolling is necessary.  */
   if (screen->y < 0 || screen->y >= GRUB_TERM_NUM_ENTRIES)
     {
@@ -182,7 +182,7 @@ update_screen (struct screen *screen, int region_start, int region_column,
        screen->y = 0;
       else
        screen->y = GRUB_TERM_NUM_ENTRIES - 1;
-      
+
       region_start = 0;
       region_column = 0;
       up = 1;
@@ -203,21 +203,21 @@ update_screen (struct screen *screen, int region_start, int region_column,
           linep--;
           y -= get_logical_num_lines (linep);
        }
-      
+
       if (y < 0 || i > 0)
        up_flag = 1;
-      
+
       do
        {
          int column;
-         
+
          for (column = 0;
               column <= linep->len && y < GRUB_TERM_NUM_ENTRIES;
               column += GRUB_TERM_ENTRY_WIDTH, y++)
            {
              if (y < 0)
                continue;
-             
+
              if (i == region_start)
                {
                  if (region_column >= column
@@ -229,34 +229,34 @@ update_screen (struct screen *screen, int region_start, int region_column,
              else if (i > region_start && mode == ALL_LINES)
                print_line (linep, column, 0, y);
            }
-         
+
          if (y == GRUB_TERM_NUM_ENTRIES)
            {
              if (column <= linep->len || i + 1 < screen->num_lines)
                down_flag = 1;
            }
-         
+
          linep++;
          i++;
 
          if (mode == ALL_LINES && i == screen->num_lines)
            for (; y < GRUB_TERM_NUM_ENTRIES; y++)
              print_empty_line (y);
-                 
+
        }
       while (y < GRUB_TERM_NUM_ENTRIES);
-      
+
       /* Draw up and down arrows.  */
       if (up)
        print_up (up_flag);
       if (down)
        print_down (down_flag);
     }
-  
+
   /* Place the cursor.  */
   grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + 1 + screen->x,
               GRUB_TERM_FIRST_ENTRY_Y + screen->y);
-  
+
   grub_refresh ();
 }
 
@@ -278,7 +278,7 @@ insert_string (struct screen *screen, char *s, int update)
          struct line *current_linep;
          struct line *next_linep;
          int size;
-         
+
          /* Make a new line.  */
          screen->num_lines++;
          screen->lines = grub_realloc (screen->lines,
@@ -295,15 +295,15 @@ insert_string (struct screen *screen, char *s, int update)
 
          if (! init_line (screen->lines + screen->line + 1))
            return 0;
-         
+
          /* Fold the line.  */
          current_linep = screen->lines + screen->line;
          next_linep = current_linep + 1;
          size = current_linep->len - screen->column;
-             
+
          if (! ensure_space (next_linep, size))
            return 0;
-         
+
          grub_memmove (next_linep->buf,
                        current_linep->buf + screen->column,
                        size);
@@ -319,7 +319,7 @@ insert_string (struct screen *screen, char *s, int update)
 
          mode = ALL_LINES;
          down = 1; /* XXX not optimal.  */
-         
+
          /* Move the cursor.  */
          screen->column = screen->real_column = 0;
          screen->line++;
@@ -363,7 +363,7 @@ insert_string (struct screen *screen, char *s, int update)
              region_start = screen->line;
              region_column = screen->column;
            }
-         
+
          if (orig_num != new_num)
            {
              mode = ALL_LINES;
@@ -378,14 +378,14 @@ insert_string (struct screen *screen, char *s, int update)
          screen->x += size;
          screen->y += screen->x / GRUB_TERM_ENTRY_WIDTH;
          screen->x %= GRUB_TERM_ENTRY_WIDTH;
-         
+
          s = p;
        }
     }
 
   if (update)
     update_screen (screen, region_start, region_column, 0, down, mode);
-  
+
   return 1;
 }
 
@@ -399,7 +399,7 @@ destroy_screen (struct screen *screen)
     for (i = 0; i < screen->num_lines; i++)
       {
        struct line *linep = screen->lines + i;
-       
+
        if (linep)
          grub_free (linep->buf);
       }
@@ -456,7 +456,7 @@ static int
 forward_char (struct screen *screen, int update)
 {
   struct line *linep;
-  
+
   linep = screen->lines + screen->line;
   if (screen->column < linep->len)
     {
@@ -499,7 +499,7 @@ backward_char (struct screen *screen, int update)
   else if (screen->line > 0)
     {
       struct line *linep;
-      
+
       screen->line--;
       linep = screen->lines + screen->line;
       screen->column = linep->len;
@@ -511,7 +511,7 @@ backward_char (struct screen *screen, int update)
 
   if (update)
     update_screen (screen, screen->num_lines, 0, 0, 0, NO_LINE);
-  
+
   return 1;
 }
 
@@ -522,24 +522,24 @@ previous_line (struct screen *screen, int update)
     {
       struct line *linep;
       int dy;
-      
+
       /* How many physical lines from the current position
         to the first physical line?  */
       dy = screen->column / GRUB_TERM_ENTRY_WIDTH;
-      
+
       screen->line--;
-      
+
       linep = screen->lines + screen->line;
       if (linep->len < screen->real_column)
        screen->column = linep->len;
       else
        screen->column = screen->real_column;
-      
+
       /* How many physical lines from the current position
         to the last physical line?  */
       dy += (linep->len / GRUB_TERM_ENTRY_WIDTH
             - screen->column / GRUB_TERM_ENTRY_WIDTH);
-      
+
       screen->y -= dy + 1;
       screen->x = screen->column % GRUB_TERM_ENTRY_WIDTH;
     }
@@ -552,7 +552,7 @@ previous_line (struct screen *screen, int update)
 
   if (update)
     update_screen (screen, screen->num_lines, 0, 0, 0, NO_LINE);
-  
+
   return 1;
 }
 
@@ -563,25 +563,25 @@ next_line (struct screen *screen, int update)
     {
       struct line *linep;
       int dy;
-      
+
       /* How many physical lines from the current position
         to the last physical line?  */
       linep = screen->lines + screen->line;
       dy = (linep->len / GRUB_TERM_ENTRY_WIDTH
            - screen->column / GRUB_TERM_ENTRY_WIDTH);
-      
+
       screen->line++;
-      
+
       linep++;
       if (linep->len < screen->real_column)
        screen->column = linep->len;
       else
        screen->column = screen->real_column;
-      
+
       /* How many physical lines from the current position
         to the first physical line?  */
       dy += screen->column / GRUB_TERM_ENTRY_WIDTH;
-      
+
       screen->y += dy + 1;
       screen->x = screen->column % GRUB_TERM_ENTRY_WIDTH;
     }
@@ -598,7 +598,7 @@ next_line (struct screen *screen, int update)
 
   if (update)
     update_screen (screen, screen->num_lines, 0, 0, 0, NO_LINE);
-  
+
   return 1;
 }
 
@@ -611,7 +611,7 @@ beginning_of_line (struct screen *screen, int update)
 
   if (update)
     update_screen (screen, screen->num_lines, 0, 0, 0, NO_LINE);
-  
+
   return 1;
 }
 
@@ -619,7 +619,7 @@ static int
 end_of_line (struct screen *screen, int update)
 {
   struct line *linep;
-  
+
   linep = screen->lines + screen->line;
   screen->y += (linep->len / GRUB_TERM_ENTRY_WIDTH
                - screen->column / GRUB_TERM_ENTRY_WIDTH);
@@ -628,7 +628,7 @@ end_of_line (struct screen *screen, int update)
 
   if (update)
     update_screen (screen, screen->num_lines, 0, 0, 0, NO_LINE);
-  
+
   return 1;
 }
 
@@ -640,14 +640,14 @@ delete_char (struct screen *screen, int update)
   int start = screen->num_lines;
   int column = 0;
   int down = 0;
-  
+
   linep = screen->lines + screen->line;
   if (linep->len > screen->column)
     {
       int orig_num, new_num;
 
       orig_num = get_logical_num_lines (linep);
-      
+
       grub_memmove (linep->buf + screen->column,
                    linep->buf + screen->column + 1,
                    linep->len - screen->column - 1);
@@ -680,7 +680,7 @@ delete_char (struct screen *screen, int update)
                    (screen->num_lines - screen->line - 2)
                    * sizeof (struct line));
       screen->num_lines--;
-      
+
       mode = ALL_LINES;
       start = screen->line;
       column = screen->column;
@@ -703,7 +703,7 @@ backward_delete_char (struct screen *screen, int update)
 
   saved_column = screen->column;
   saved_line = screen->line;
-  
+
   if (! backward_char (screen, 0))
     return 0;
 
@@ -721,25 +721,25 @@ kill_line (struct screen *screen, int continuous, int update)
   char *p;
   int size;
   int offset;
-  
+
   p = screen->killed_text;
   if (! continuous && p)
     p[0] = '\0';
-  
+
   linep = screen->lines + screen->line;
   size = linep->len - screen->column;
-  
+
   if (p)
     offset = grub_strlen (p);
   else
     offset = 0;
-      
+
   if (size > 0)
     {
       enum update_mode mode = SINGLE_LINE;
       int down = 0;
       int orig_num, new_num;
-      
+
       p = grub_realloc (p, offset + size + 1);
       if (! p)
        return 0;
@@ -748,7 +748,7 @@ kill_line (struct screen *screen, int continuous, int update)
       p[offset + size - 1] = '\0';
 
       screen->killed_text = p;
-      
+
       orig_num = get_logical_num_lines (linep);
       linep->len = screen->column;
       new_num = get_logical_num_lines (linep);
@@ -772,10 +772,10 @@ kill_line (struct screen *screen, int continuous, int update)
       p[offset + 1] = '\0';
 
       screen->killed_text = p;
-      
+
       return delete_char (screen, update);
     }
-    
+
   return 1;
 }
 
@@ -792,7 +792,7 @@ static int
 open_line (struct screen *screen, int update)
 {
   int saved_y = screen->y;
-  
+
   if (! insert_string (screen, "\n", 0))
     return 0;
 
@@ -812,7 +812,7 @@ static void
 store_completion (const char *item, grub_completion_type_t type, int count)
 {
   char *p;
-  
+
   if (count == 0)
     {
       /* If this is the first time, print a label.  */
@@ -839,7 +839,7 @@ store_completion (const char *item, grub_completion_type_t type, int count)
          what = "things";
          break;
        }
-           
+
       grub_gotoxy (0, GRUB_TERM_HEIGHT - 3);
       grub_printf ("   Possible %s are:\n    ", what);
     }
@@ -849,7 +849,7 @@ store_completion (const char *item, grub_completion_type_t type, int count)
                                   + (int) grub_strlen (item) + 1 + 1))
     {
       grub_size_t new_len;
-      
+
       new_len = completion_buffer.len + grub_strlen (item) + 80;
       p = grub_realloc (completion_buffer.buf, new_len);
       if (! p)
@@ -887,10 +887,10 @@ complete (struct screen *screen, int continuous, int update)
     count++;
   else
     count = 0;
-  
+
   pos = grub_getxy ();
   grub_gotoxy (0, GRUB_TERM_HEIGHT - 3);
-  
+
   completion_buffer.buf = 0;
   completion_buffer.len = 0;
   completion_buffer.max_len = 0;
@@ -902,13 +902,13 @@ complete (struct screen *screen, int continuous, int update)
   insert = grub_normal_do_completion (linep->buf, &restore, store_completion);
 
   linep->buf[screen->column] = saved_char;
-  
+
   if (restore)
     {
       char *p = completion_buffer.buf;
 
       screen->completion_shown = 1;
-      
+
       if (p)
        {
          int num_sections = ((completion_buffer.len + GRUB_TERM_WIDTH - 8 - 1)
@@ -922,17 +922,17 @@ complete (struct screen *screen, int continuous, int update)
            grub_putcode (GRUB_TERM_DISP_LEFT);
          else
            grub_putchar (' ');
-         
+
          while (*p && p < endp)
            grub_putchar (*p++);
-         
+
          if (*p)
            grub_putcode (GRUB_TERM_DISP_RIGHT);
        }
     }
 
   grub_gotoxy (pos >> 8, pos & 0xFF);
-  
+
   if (insert)
     {
       insert_string (screen, insert, update);
@@ -941,7 +941,7 @@ complete (struct screen *screen, int continuous, int update)
     }
   else if (update)
     grub_refresh ();
-    
+
   grub_free (completion_buffer.buf);
   return 1;
 }
@@ -952,17 +952,17 @@ clear_completions (void)
 {
   grub_uint16_t pos;
   int i, j;
-  
+
   pos = grub_getxy ();
   grub_gotoxy (0, GRUB_TERM_HEIGHT - 3);
-  
+
   for (i = 0; i < 2; i++)
     {
       for (j = 0; j < GRUB_TERM_WIDTH - 1; j++)
        grub_putchar (' ');
       grub_putchar ('\n');
     }
-  
+
   grub_gotoxy (pos >> 8, pos & 0xFF);
   grub_refresh ();
 }
@@ -1000,7 +1000,7 @@ run (struct screen *screen)
       currline++;
       return 0;
     }
-  
+
   grub_cls ();
   grub_printf ("  Booting a command list\n\n");
 
@@ -1033,7 +1033,7 @@ grub_menu_entry_run (grub_menu_entry_t entry)
 {
   struct screen *screen;
   int prev_c;
-  
+
   screen = make_screen (entry);
   if (! screen)
     return;
@@ -1044,7 +1044,7 @@ grub_menu_entry_run (grub_menu_entry_t entry)
   update_screen (screen, 0, 0, 1, 1, ALL_LINES);
   grub_setcursor (1);
   prev_c = '\0';
-  
+
   while (1)
     {
       int c = GRUB_TERM_ASCII_CHAR (grub_getkey ());
@@ -1054,7 +1054,7 @@ grub_menu_entry_run (grub_menu_entry_t entry)
          clear_completions ();
          screen->completion_shown = 0;
        }
-      
+
       switch (c)
        {
        case 16: /* C-p */
@@ -1071,7 +1071,7 @@ grub_menu_entry_run (grub_menu_entry_t entry)
          if (! forward_char (screen, 1))
            goto fail;
          break;
-         
+
        case 2: /* C-b */
          if (! backward_char (screen, 1))
            goto fail;
@@ -1086,12 +1086,12 @@ grub_menu_entry_run (grub_menu_entry_t entry)
          if (! end_of_line (screen, 1))
            goto fail;
          break;
-         
+
        case '\t': /* C-i */
          if (! complete (screen, prev_c == c, 1))
            goto fail;
          break;
-         
+
        case 4: /* C-d */
          if (! delete_char (screen, 1))
            goto fail;
@@ -1101,16 +1101,16 @@ grub_menu_entry_run (grub_menu_entry_t entry)
          if (! backward_delete_char (screen, 1))
            goto fail;
          break;
-         
+
        case 11: /* C-k */
          if (! kill_line (screen, prev_c == c, 1))
            goto fail;
          break;
-         
+
        case 21: /* C-u */
          /* FIXME: What behavior is good for this key?  */
          break;
-         
+
        case 25: /* C-y */
          if (! yank (screen, 1))
            goto fail;
@@ -1119,7 +1119,7 @@ grub_menu_entry_run (grub_menu_entry_t entry)
        case 12: /* C-l */
          /* FIXME: centering.  */
          goto refresh;
-         
+
        case 15: /* C-o */
          if (! open_line (screen, 1))
            goto fail;
@@ -1134,11 +1134,11 @@ grub_menu_entry_run (grub_menu_entry_t entry)
        case '\e':
          destroy_screen (screen);
          return;
-         
+
        case 3: /* C-c */
          grub_cmdline_run (1);
          goto refresh;
-         
+
        case 24: /* C-x */
          if (! run (screen))
            goto fail;
@@ -1149,7 +1149,7 @@ grub_menu_entry_run (grub_menu_entry_t entry)
        case 20: /* C-t */
          /* FIXME */
          break;
-         
+
        default:
          if (grub_isprint (c))
            {
@@ -1168,7 +1168,7 @@ grub_menu_entry_run (grub_menu_entry_t entry)
 
  fail:
   destroy_screen (screen);
-  
+
   grub_cls ();
   grub_print_error ();
   grub_errno = GRUB_ERR_NONE;
index f7047c7fc29ccf9a45e84b45dbe765dc1d6435b4..37d317b0b007145e37ab605dea1a77b553c6f4ad 100644 (file)
@@ -55,7 +55,7 @@ grub_err_t
 grub_menu_viewer_show_menu (grub_menu_t menu, int nested)
 {
   grub_menu_viewer_t cur = get_current_menu_viewer ();
-  if (!cur) 
+  if (!cur)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "No menu viewer available.");
 
   return cur->show_menu (menu, nested);
index bf677db7f5e320ef234eaab9fae4fbb2305c7e84..0a1a2f052de3b03cf13bdc533be211b39425ce95 100644 (file)
@@ -37,7 +37,7 @@ grub_normal_print_device_info (const char *name)
     grub_printf ("\tPartition %s: ", name);
   else
     grub_printf ("Device %s: ", name);
-  
+
   dev = grub_device_open (name);
   if (! dev)
     grub_printf ("Filesystem cannot be accessed");
@@ -98,7 +98,7 @@ grub_normal_print_device_info (const char *name)
        grub_printf ("Unknown filesystem");
       else
        grub_printf ("Partition table");
-         
+
       grub_device_close (dev);
     }
 
index a861eb0eabab99cf01182c64728a1c11b36b7409..42fd61f4a8c561fb691e134a6e79d7b544a48315 100644 (file)
@@ -140,7 +140,7 @@ acorn_partition_map_probe (grub_disk_t disk, const char *str)
   grub_disk_addr_t sector;
   grub_err_t err;
   grub_partition_t p;
-  
+
   /* Enforce raw disk access.  */
   raw.partition = 0;
 
index 81d95373c98a70a7489376a669b75cda1c0890c7..ffb807f5aa7bbf2a715bbc6e124096bf85d9cc42 100644 (file)
@@ -35,7 +35,7 @@ struct grub_amiga_rdsk
   grub_uint32_t badblcklst;
   grub_uint32_t partitionlst;
   grub_uint32_t fslst;
-  
+
   /* The other information is not important for us.  */
 } __attribute__ ((packed));
 
@@ -61,7 +61,7 @@ struct grub_amiga_partition
   grub_uint32_t unused5[3];
   grub_uint32_t lowcyl;
   grub_uint32_t highcyl;
-  
+
   grub_uint32_t firstcyl;
 } __attribute__ ((packed));
 
@@ -80,18 +80,18 @@ amiga_partition_map_iterate (grub_disk_t disk,
   int partno = 0;
   int next = -1;
   unsigned pos;
-  
+
   /* Enforce raw disk access.  */
   raw = *disk;
   raw.partition = 0;
-  
+
   /* The RDSK block is one of the first 15 blocks.  */
   for (pos = 0; pos < 15; pos++)
     {
       /* Read the RDSK block which is a descriptor for the entire disk.  */
       if (grub_disk_read (&raw, pos, 0, sizeof (rdsk), &rdsk))
        return grub_errno;
-      
+
       if (grub_strcmp ((char *) rdsk.magic, "RDSK") == 0)
        {
          /* Found the first PART block.  */
@@ -103,36 +103,36 @@ amiga_partition_map_iterate (grub_disk_t disk,
   if (next == -1)
     return grub_error (GRUB_ERR_BAD_PART_TABLE,
                       "Amiga partition map not found.");
-  
+
   /* The end of the partition list is marked using "-1".  */
   while (next != -1)
     {
       struct grub_amiga_partition apart;
-     
+
       /* Read the RDSK block which is a descriptor for the entire disk.  */
       if (grub_disk_read (&raw, next, 0, sizeof (apart), &apart))
        return grub_errno;
-      
+
       /* Calculate the first block and the size of the partition.  */
-      part.start = (grub_be_to_cpu32 (apart.lowcyl) 
+      part.start = (grub_be_to_cpu32 (apart.lowcyl)
                    * grub_be_to_cpu32 (apart.heads)
                    * grub_be_to_cpu32 (apart.block_per_track));
       part.len = ((grub_be_to_cpu32 (apart.highcyl)
                   - grub_be_to_cpu32 (apart.lowcyl) + 1)
                  * grub_be_to_cpu32 (apart.heads)
                  * grub_be_to_cpu32 (apart.block_per_track));
-      
+
       part.offset = (grub_off_t) next * 512;
       part.index = partno;
       part.partmap = &grub_amiga_partition_map;
-      
+
       if (hook (disk, &part))
        return grub_errno;
-      
+
       next = grub_be_to_cpu32 (apart.next);
       partno++;
     }
-  
+
   return 0;
 }
 
@@ -145,7 +145,7 @@ amiga_partition_map_probe (grub_disk_t disk, const char *str)
   char *s = (char *) str;
 
   auto int find_func (grub_disk_t d, const grub_partition_t partition);
-    
+
   int find_func (grub_disk_t d __attribute__ ((unused)),
                 const grub_partition_t partition)
     {
@@ -154,14 +154,14 @@ amiga_partition_map_probe (grub_disk_t disk, const char *str)
          p = (grub_partition_t) grub_malloc (sizeof (*p));
          if (! p)
            return 1;
-         
+
          grub_memcpy (p, partition, sizeof (*p));
          return 1;
        }
-      
+
       return 0;
     }
-  
+
   /* Get the partition number.  */
   partnum = grub_strtoul (s, 0, 10) - 1;
   if (grub_errno)
index 6d83f7bf35b1279df088c994319c79388afc527f..fce2f2c5fe5e08c2b3bda7cb878cbd915e4bc299 100644 (file)
@@ -76,7 +76,7 @@ struct grub_apple_part
 
   /* Reserved.  */
   grub_uint32_t reserved2;
-  
+
   /* The entry point of the bootcode.  */
   grub_uint32_t bootcode_entrypoint;
 
@@ -181,7 +181,7 @@ apple_partition_map_probe (grub_disk_t disk, const char *str)
   char *s = (char *) str;
 
   auto int find_func (grub_disk_t d, const grub_partition_t partition);
-  
+
   int find_func (grub_disk_t d __attribute__ ((unused)),
                 const grub_partition_t partition)
     {
@@ -190,14 +190,14 @@ apple_partition_map_probe (grub_disk_t disk, const char *str)
          p = (grub_partition_t) grub_malloc (sizeof (*p));
          if (! p)
            return 1;
-         
+
          grub_memcpy (p, partition, sizeof (*p));
          return 1;
        }
-      
+
       return 0;
     }
-  
+
   /* Get the partition number.  */
   partnum = grub_strtoul (s, 0, 10) - 1;
   if (grub_errno)
@@ -205,7 +205,7 @@ apple_partition_map_probe (grub_disk_t disk, const char *str)
       grub_error (GRUB_ERR_BAD_FILENAME, "invalid partition");
       return 0;
     }
-  
+
   if (apple_partition_map_iterate (disk, find_func))
     goto fail;
 
index 5c89e35b325087a3bf20ca079ac72c2d3d48fed3..d646d41b8c28c903ff33801865f10bbcef10760b 100644 (file)
@@ -122,7 +122,7 @@ gpt_partition_map_probe (grub_disk_t disk, const char *str)
   char *s = (char *) str;
 
   auto int find_func (grub_disk_t d, const grub_partition_t partition);
-    
+
   int find_func (grub_disk_t d __attribute__ ((unused)),
                 const grub_partition_t partition)
     {
@@ -131,14 +131,14 @@ gpt_partition_map_probe (grub_disk_t disk, const char *str)
          p = (grub_partition_t) grub_malloc (sizeof (*p));
          if (! p)
            return 1;
-         
+
          grub_memcpy (p, partition, sizeof (*p));
          return 1;
        }
-      
+
       return 0;
     }
-  
+
   /* Get the partition number.  */
   partnum = grub_strtoul (s, 0, 10) - 1;
   if (grub_errno)
index 1a110b24096a171f5ecaa0c3b24b0e7adff7d2ee..6f68ecf93372480626c785378d299c6ea24f2e77 100644 (file)
@@ -33,27 +33,27 @@ grub_partition_parse (const char *str)
 {
   grub_partition_t p;
   struct grub_pc_partition *pcdata;
-  
+
   char *s = (char *) str;
-  
+
   p = (grub_partition_t) grub_malloc (sizeof (*p));
   if (! p)
     return 0;
-  
+
   pcdata = (struct grub_pc_partition *) grub_malloc (sizeof (*pcdata));
   if (! pcdata)
     goto fail;
-  
+
   p->data = pcdata;
   p->partmap = &grub_pc_partition_map;
-  
+
   /* Initialize some of the fields with invalid values.  */
   pcdata->bsd_part = pcdata->dos_type = pcdata->bsd_type = p->index = -1;
 
   /* Get the DOS partition number. The number is counted from one for
      the user interface, and from zero internally.  */
   pcdata->dos_part = grub_strtoul (s, &s, 0) - 1;
-  
+
   if (grub_errno)
     {
       /* Not found. Maybe only a BSD label is specified.  */
@@ -79,7 +79,7 @@ grub_partition_parse (const char *str)
     goto fail;
 
   return p;
-  
+
  fail:
   grub_free (p);
   grub_free (pcdata);
@@ -101,18 +101,18 @@ pc_partition_map_iterate (grub_disk_t disk,
   /* Enforce raw disk access.  */
   raw = *disk;
   raw.partition = 0;
-  
+
   p.offset = 0;
   pcdata.ext_offset = 0;
   pcdata.dos_part = -1;
   p.data = &pcdata;
   p.partmap = &grub_pc_partition_map;
-  
+
   while (1)
     {
       int i;
       struct grub_pc_partition_entry *e;
-      
+
       /* Read the MBR.  */
       if (grub_disk_read (&raw, p.offset, 0, sizeof (mbr), &mbr))
        goto finish;
@@ -125,7 +125,7 @@ pc_partition_map_iterate (grub_disk_t disk,
       for (p.index = 0; p.index < 4; p.index++)
        {
          e = mbr.entries + p.index;
-         
+
          p.start = p.offset + grub_le_to_cpu32 (e->start);
          p.len = grub_le_to_cpu32 (e->length);
          pcdata.bsd_part = -1;
@@ -147,7 +147,7 @@ pc_partition_map_iterate (grub_disk_t disk,
              && ! grub_pc_partition_is_extended (e->type))
            {
              pcdata.dos_part++;
-             
+
              if (hook (disk, &p))
                return 1;
 
@@ -188,7 +188,7 @@ pc_partition_map_iterate (grub_disk_t disk,
                      p.start = grub_le_to_cpu32 (be->offset);
                      p.len = grub_le_to_cpu32 (be->size);
                      pcdata.bsd_type = be->fs_type;
-                     
+
                      if (be->fs_type != GRUB_PC_PARTITION_BSD_TYPE_UNUSED)
                        if (hook (disk, &p))
                          return 1;
@@ -205,7 +205,7 @@ pc_partition_map_iterate (grub_disk_t disk,
       for (i = 0; i < 4; i++)
        {
          e = mbr.entries + i;
-         
+
          if (grub_pc_partition_is_extended (e->type))
            {
              p.offset = pcdata.ext_offset + grub_le_to_cpu32 (e->start);
@@ -231,7 +231,7 @@ pc_partition_map_probe (grub_disk_t disk, const char *str)
 {
   grub_partition_t p;
   struct grub_pc_partition *pcdata;
-  
+
   auto int find_func (grub_disk_t d, const grub_partition_t partition);
 
   int find_func (grub_disk_t d __attribute__ ((unused)),
@@ -247,14 +247,14 @@ pc_partition_map_probe (grub_disk_t disk, const char *str)
          grub_memcpy (pcdata, partdata, sizeof (*pcdata));
          return 1;
        }
-      
+
       return 0;
     }
-  
+
   p = grub_partition_parse (str);
   if (! p)
     return 0;
-  
+
   pcdata = p->data;
   pc_partition_map_iterate (disk, find_func);
   if (grub_errno)
@@ -280,7 +280,7 @@ pc_partition_map_get_name (const grub_partition_t p)
 {
   char *name;
   struct grub_pc_partition *pcdata = p->data;
-  
+
   name = grub_malloc (13);
   if (! name)
     return 0;
index 8598534e8ddae5f84379edeeee8ece4e0e89692d..60947774f083ca085429716eedf4f439d0fb828b 100644 (file)
@@ -73,12 +73,12 @@ grub_sun_is_valid (struct grub_sun_block *label)
 {
   grub_uint16_t *pos;
   grub_uint16_t sum = 0;
-  
+
   for (pos = (grub_uint16_t *) label;
        pos < (grub_uint16_t *) (label + 1);
        pos++)
     sum ^= *pos;
-  
+
   return ! sum;
 }
 
@@ -91,10 +91,10 @@ sun_partition_map_iterate (grub_disk_t disk,
   struct grub_disk raw;
   struct grub_sun_block block;
   int partnum;
-  
+
   raw = *disk;
   raw.partition = 0;
-  
+
   p = (grub_partition_t) grub_malloc (sizeof (struct grub_partition));
   if (! p)
     return grub_errno;
@@ -107,16 +107,16 @@ sun_partition_map_iterate (grub_disk_t disk,
     {
       if (GRUB_PARTMAP_SUN_MAGIC != grub_be_to_cpu16 (block.magic))
        grub_error (GRUB_ERR_BAD_PART_TABLE, "not a sun partition table");
-      
+
       if (! grub_sun_is_valid (&block))
        grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid checksum");
-      
+
       /* Maybe another error value would be better, because partition
         table _is_ recognized but invalid.  */
       for (partnum = 0; partnum < GRUB_PARTMAP_SUN_MAX_PARTS; partnum++)
        {
          struct grub_sun_partition_descriptor *desc;
-         
+
          if (block.infos[partnum].id == 0
              || block.infos[partnum].id == GRUB_PARTMAP_SUN_WHOLE_DISK_ID)
            continue;
@@ -134,7 +134,7 @@ sun_partition_map_iterate (grub_disk_t disk,
            }
        }
     }
-  
+
   grub_free (p);
 
   return grub_errno;
@@ -148,7 +148,7 @@ sun_partition_map_probe (grub_disk_t disk, const char *str)
   char *s = (char *) str;
 
   auto int find_func (grub_disk_t d, const grub_partition_t partition);
-  
+
   int find_func (grub_disk_t d __attribute__ ((unused)),
                 const grub_partition_t partition)
     {
@@ -157,10 +157,10 @@ sun_partition_map_probe (grub_disk_t disk, const char *str)
           p = (grub_partition_t) grub_malloc (sizeof (*p));
           if (p)
             grub_memcpy (p, partition, sizeof (*p));
-         
+
           return 1;
         }
-      
+
       return 0;
     }
 
@@ -179,7 +179,7 @@ sun_partition_map_probe (grub_disk_t disk, const char *str)
       grub_error (GRUB_ERR_BAD_FILENAME, "invalid partition");
       p = 0;
     }
-  
+
   return p;
 }
 
@@ -187,11 +187,11 @@ static char *
 sun_partition_map_get_name (const grub_partition_t p)
 {
   char *name;
-  
+
   name = grub_malloc (13);
   if (name)
     grub_sprintf (name, "%d", p->index + 1);
-  
+
   return name;
 }
 
index c37a40111c8f1e2b094befe34c7ea846225230d1..6876d0d58de0a72ea6a048d30972373f6f6ef6f5 100644 (file)
@@ -37,7 +37,7 @@ static struct grub_parttool_argdesc grub_pcpart_bootargs[] =
   {0, 0, 0}
 };
 
-static grub_err_t grub_pcpart_boot (const grub_device_t dev, 
+static grub_err_t grub_pcpart_boot (const grub_device_t dev,
                                    const struct grub_parttool_args *args)
 {
   int i, index;
@@ -86,7 +86,7 @@ static struct grub_parttool_argdesc grub_pcpart_typeargs[] =
   {0, 0, 0}
 };
 
-static grub_err_t grub_pcpart_type (const grub_device_t dev, 
+static grub_err_t grub_pcpart_type (const grub_device_t dev,
                                    const struct grub_parttool_args *args)
 {
   int index;
@@ -99,7 +99,7 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev,
   dev->disk->partition = 0;
 
   /* Read the parttable.  */
-  if (grub_disk_read (dev->disk, part->offset, 0, 
+  if (grub_disk_read (dev->disk, part->offset, 0,
                      sizeof (mbr), &mbr))
     {
       dev->disk->partition = part;
@@ -119,7 +119,7 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev,
        type &= ~GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG;
     }
 
-  if (grub_pc_partition_is_empty (type) 
+  if (grub_pc_partition_is_empty (type)
       || grub_pc_partition_is_extended (type))
     {
       dev->disk->partition = part;
@@ -130,7 +130,7 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev,
   grub_printf ("Setting partition type to 0x%x\n", type);
 
    /* Write the parttable.  */
-  grub_disk_write (dev->disk, part->offset, 0, 
+  grub_disk_write (dev->disk, part->offset, 0,
                   sizeof (mbr), &mbr);
 
   dev->disk->partition = part;
@@ -140,13 +140,13 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev,
 
 GRUB_MOD_INIT (pcpart)
 {
-  activate_table_handle = grub_parttool_register ("pc_partition_map", 
+  activate_table_handle = grub_parttool_register ("pc_partition_map",
                                                  grub_pcpart_boot,
                                                  grub_pcpart_bootargs);
-  type_table_handle = grub_parttool_register ("pc_partition_map", 
+  type_table_handle = grub_parttool_register ("pc_partition_map",
                                              grub_pcpart_type,
                                              grub_pcpart_typeargs);
+
 }
 GRUB_MOD_FINI(pcpart)
 {
index dc411cc1f42ac7779153ab3a7f62ea57427789b7..1e49c709fade893a59049ce91f5805d3c26dcd55 100644 (file)
@@ -24,7 +24,7 @@
 static grub_script_function_t grub_script_function_list;
 
 grub_script_function_t
-grub_script_function_create (struct grub_script_arg *functionname_arg, 
+grub_script_function_create (struct grub_script_arg *functionname_arg,
                             struct grub_script *cmd)
 {
   grub_script_function_t func;
index 3ec78278db9156927171493f51aab250f8595be0..aa8ac35aa13f774921d40ceb453934d9b36e3c8b 100644 (file)
@@ -157,7 +157,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
 
   for (;! state->done && (*state->script || firstrun); firstrun = 0)
     {
-      
+
       if (! *state->script)
        {
          /* Check if more tokens are requested by the parser.  */
@@ -200,7 +200,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
        }
 
       newstate = grub_parser_cmdline_state (state->state, *state->script, &use);
-      
+
       /* Check if it is a text.  */
       if (check_textstate (newstate))
        {
@@ -253,19 +253,19 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
          buffer = grub_script_malloc (parsestate, 2048);
          if (! buffer)
            return 0;
-         
+
          bp = buffer;
-         
+
          /* Read one token, possible quoted.  */
          while (*state->script)
            {
              newstate = grub_parser_cmdline_state (state->state,
                                                    *state->script, &use);
-             
+
              /* Check if a variable name starts.  */
              if (check_varstate (newstate))
                break;
-             
+
              /* If the string is not quoted or escaped, stop processing
                 when a special token was found.  It will be recognized
                 next time when this function is called.  */
@@ -273,7 +273,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
                  && state->state != GRUB_PARSER_STATE_ESC)
                {
                  int breakout = 0;
-                 
+
                  switch (use)
                    {
                    case ' ':
@@ -290,7 +290,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
                }
              else if (use)
                *(bp++) = use;
-             
+
              state->state = newstate;
              nextchar (state);
            }
@@ -300,7 +300,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
          grub_dprintf ("scripting", "token=`%s'\n", buffer);
          yylval->arg = grub_script_arg_add (parsestate, yylval->arg,
                                             GRUB_SCRIPT_ARG_TYPE_STR, buffer);
-         
+
        }
       else if (newstate == GRUB_PARSER_STATE_VAR
               || newstate == GRUB_PARSER_STATE_QVAR)
@@ -309,15 +309,15 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
          buffer = grub_script_malloc (parsestate, 2096);
          if (! buffer)
            return 0;
-         
+
          bp = buffer;
-         
+
          /* This is a variable, read the variable name.  */
          while (*state->script)
            {
              newstate = grub_parser_cmdline_state (state->state,
                                                    *state->script, &use);
-             
+
              /* Check if this character is not part of the variable name
                 anymore.  */
              if (! (check_varstate (newstate)))
@@ -328,18 +328,18 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
                  state->state = newstate;
                  break;
                }
-             
+
              if (use)
                *(bp++) = use;
              nextchar (state);
              state->state = newstate;
            }
-         
+
          *bp = '\0';
          state->state = newstate;
          yylval->arg = grub_script_arg_add (parsestate, yylval->arg,
                                             GRUB_SCRIPT_ARG_TYPE_VAR, buffer);
-         grub_dprintf ("scripting", "vartoken=`%s'\n", buffer);          
+         grub_dprintf ("scripting", "vartoken=`%s'\n", buffer);
        }
       else
        {
@@ -349,7 +349,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
          return 0;
        }
     }
-  
+
   if (yylval->arg == 0)
     {
       int token = state->tokenonhold;
index 3322b8f70b5fc5bc293c17eab21ffa36d57e7eba..f3845089cdd25a1ce7c15fc8042e30a5bb46c947 100644 (file)
@@ -89,9 +89,9 @@ grub_console_putchar (grub_uint32_t c)
 {
   grub_efi_char16_t str[2];
   grub_efi_simple_text_output_interface_t *o;
-  
+
   o = grub_efi_system_table->con_out;
-  
+
   /* For now, do not try to use a surrogate pair.  */
   if (c > 0xffff)
     c = '?';
@@ -102,7 +102,7 @@ grub_console_putchar (grub_uint32_t c)
   /* Should this test be cached?  */
   if (c > 0x7f && efi_call_2 (o->test_string, o, str) != GRUB_EFI_SUCCESS)
     return;
-  
+
   efi_call_2 (o->output_string, o, str);
 }
 
@@ -119,7 +119,7 @@ grub_console_checkkey (void)
   grub_efi_simple_input_interface_t *i;
   grub_efi_input_key_t key;
   grub_efi_status_t status;
-  
+
   if (read_key >= 0)
     return 1;
 
@@ -131,7 +131,7 @@ grub_console_checkkey (void)
     case GRUB_EFI_SUCCESS:
       {
        grub_uint16_t xy;
-       
+
        xy = grub_getxy ();
        grub_gotoxy (0, 0);
        grub_printf ("scan_code=%x,unicode_char=%x  ",
@@ -150,7 +150,7 @@ grub_console_checkkey (void)
       break;
     }
 #endif
-  
+
   if (status == GRUB_EFI_SUCCESS)
     {
       switch (key.scan_code)
@@ -229,11 +229,11 @@ grub_console_getkey (void)
       status = efi_call_3 (b->wait_for_event, 1, &(i->wait_for_key), &index);
       if (status != GRUB_EFI_SUCCESS)
         return -1;
-      
+
       grub_console_checkkey ();
     }
   while (read_key < 0);
-  
+
   key = read_key;
   read_key = -1;
   return key;
@@ -244,7 +244,7 @@ grub_console_getwh (void)
 {
   grub_efi_simple_text_output_interface_t *o;
   grub_efi_uintn_t columns, rows;
-  
+
   o = grub_efi_system_table->con_out;
   if (efi_call_4 (o->query_mode, o, o->mode->mode, &columns, &rows) != GRUB_EFI_SUCCESS)
     {
@@ -260,7 +260,7 @@ static grub_uint16_t
 grub_console_getxy (void)
 {
   grub_efi_simple_text_output_interface_t *o;
-  
+
   o = grub_efi_system_table->con_out;
   return ((o->mode->cursor_column << 8) | o->mode->cursor_row);
 }
@@ -269,7 +269,7 @@ static void
 grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y)
 {
   grub_efi_simple_text_output_interface_t *o;
-  
+
   o = grub_efi_system_table->con_out;
   efi_call_3 (o->set_cursor_position, o, x, y);
 }
@@ -279,7 +279,7 @@ grub_console_cls (void)
 {
   grub_efi_simple_text_output_interface_t *o;
   grub_efi_int32_t orig_attr;
-  
+
   o = grub_efi_system_table->con_out;
   orig_attr = o->mode->attribute;
   efi_call_2 (o->set_attributes, o, GRUB_EFI_BACKGROUND_BLACK);
index 5da678846c942f3e3f7fe1fa19c14dd9f3a17830..ef93bb70fcdaeb0fea0c6f58b1c4ff6e9e5180ba 100644 (file)
@@ -91,7 +91,7 @@ struct grub_virtual_screen
   grub_uint8_t normal_color_setting;
   grub_uint8_t highlight_color_setting;
   grub_uint8_t term_color;
-  
+
   /* Color settings.  */
   grub_video_color_t fg_color;
   grub_video_color_t bg_color;
@@ -117,7 +117,7 @@ static void dirty_region_reset (void);
 
 static int dirty_region_is_empty (void);
 
-static void dirty_region_add (int x, int y, 
+static void dirty_region_add (int x, int y,
                               unsigned int width, unsigned int height);
 
 static unsigned int calculate_normal_character_width (grub_font_t font);
@@ -135,12 +135,12 @@ set_term_color (grub_uint8_t term_color)
 
   /* Map terminal color to text layer compatible video colors.  */
   virtual_screen.fg_color = grub_video_map_color(term_color & 0x0f);
-  
+
   /* Special case: use black as transparent color.  */
   if (((term_color >> 4) & 0x0f) == 0)
     {
       virtual_screen.bg_color = grub_video_map_rgba(0, 0, 0, 0);
-    } 
+    }
   else
     {
       virtual_screen.bg_color = grub_video_map_color((term_color >> 4) & 0x0f);
@@ -218,9 +218,9 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y,
   virtual_screen.standard_color_setting = DEFAULT_STANDARD_COLOR;
   virtual_screen.normal_color_setting = DEFAULT_NORMAL_COLOR;
   virtual_screen.highlight_color_setting = DEFAULT_HIGHLIGHT_COLOR;
-  
+
   virtual_screen.term_color = virtual_screen.normal_color_setting;
-  
+
   set_term_color (virtual_screen.term_color);
 
   grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
@@ -256,7 +256,7 @@ grub_gfxterm_init (void)
     err = grub_video_set_mode (DEFAULT_VIDEO_MODE, video_hook);
   else
     {
-      tmp = grub_malloc (grub_strlen (modevar) 
+      tmp = grub_malloc (grub_strlen (modevar)
                         + sizeof (DEFAULT_VIDEO_MODE) + 1);
       grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar);
       err = grub_video_set_mode (tmp, video_hook);
@@ -312,7 +312,7 @@ grub_gfxterm_fini (void)
 }
 
 static void
-redraw_screen_rect (unsigned int x, unsigned int y, 
+redraw_screen_rect (unsigned int x, unsigned int y,
                     unsigned int width, unsigned int height)
 {
   grub_video_color_t color;
@@ -323,11 +323,11 @@ redraw_screen_rect (unsigned int x, unsigned int y,
   if (bitmap)
     {
       /* Render bitmap as background.  */
-      grub_video_blit_bitmap (bitmap, GRUB_VIDEO_BLIT_REPLACE, x, y, 
+      grub_video_blit_bitmap (bitmap, GRUB_VIDEO_BLIT_REPLACE, x, y,
                              x, y,
                               width, height);
-      
-      /* If bitmap is smaller than requested blit area, use background 
+
+      /* If bitmap is smaller than requested blit area, use background
          color.  */
       color = virtual_screen.bg_color;
 
@@ -342,27 +342,27 @@ redraw_screen_rect (unsigned int x, unsigned int y,
             {
               h = bitmap_height - y;
             }
-          
+
           if (bitmap_width > tx)
             {
               tx = bitmap_width;
             }
-          
+
           /* Render background layer.  */
          grub_video_fill_rect (color, tx, y, w, h);
         }
-      
+
       /* Fill bottom side of the bitmap if needed.  */
       if (y + height >= bitmap_height)
         {
           int h = (y + height) - bitmap_height;
           unsigned int ty = y;
-          
+
           if (bitmap_height > ty)
             {
               ty = bitmap_height;
             }
-          
+
           /* Render background layer.  */
          grub_video_fill_rect (color, x, ty, width, h);
         }
@@ -419,7 +419,7 @@ dirty_region_add (int x, int y, unsigned int width, unsigned int height)
       dirty_region.top_left_y = y;
       dirty_region.bottom_right_x = x + width - 1;
       dirty_region.bottom_right_y = y + height - 1;
-    } 
+    }
   else
     {
       if (x < dirty_region.top_left_x)
@@ -431,7 +431,7 @@ dirty_region_add (int x, int y, unsigned int width, unsigned int height)
       if ((y + (int)height - 1) > dirty_region.bottom_right_y)
         dirty_region.bottom_right_y = y + height - 1;
     }
-} 
+}
 
 static void
 dirty_region_add_virtualscreen (void)
@@ -487,10 +487,10 @@ write_char (void)
   /* Get glyph for character.  */
   glyph = grub_font_get_glyph (virtual_screen.font, p->code);
   ascent = grub_font_get_ascent (virtual_screen.font);
-  
+
   width = virtual_screen.normal_char_width * calculate_character_width(glyph);
   height = virtual_screen.normal_char_height;
-  
+
   color = p->fg_color;
   bgcolor = p->bg_color;
 
@@ -556,7 +556,7 @@ scroll_up (void)
       /* Redraw only changed regions.  */
       dirty_region_redraw ();
     }
-  
+
   /* Scroll text buffer with one line to up.  */
   grub_memmove (virtual_screen.text_buffer,
                 virtual_screen.text_buffer + virtual_screen.columns,
@@ -581,7 +581,7 @@ scroll_up (void)
   color = virtual_screen.bg_color;
   grub_video_scroll (color, 0, -virtual_screen.normal_char_height);
   grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
-  
+
   /* If we have bitmap, re-draw screen, otherwise scroll physical screen too.  */
   if (bitmap)
     {
@@ -589,7 +589,7 @@ scroll_up (void)
       dirty_region_add_virtualscreen ();
     }
   else
-    {      
+    {
       /* Clear new border area.  */
       grub_video_fill_rect (color,
                             virtual_screen.offset_x, virtual_screen.offset_y,
@@ -825,15 +825,15 @@ grub_virtual_screen_setcolorstate (grub_term_color_state state)
     case GRUB_TERM_COLOR_STANDARD:
       virtual_screen.term_color = virtual_screen.standard_color_setting;
       break;
-      
+
     case GRUB_TERM_COLOR_NORMAL:
       virtual_screen.term_color = virtual_screen.normal_color_setting;
       break;
-      
+
     case GRUB_TERM_COLOR_HIGHLIGHT:
       virtual_screen.term_color = virtual_screen.highlight_color_setting;
       break;
-      
+
     default:
       break;
     }
@@ -887,13 +887,13 @@ grub_gfxterm_background_image_cmd (grub_command_t cmd __attribute__ ((unused)),
   /* Check that we have video adapter active.  */
   if (grub_video_get_info(NULL) != GRUB_ERR_NONE)
     return grub_errno;
-  
+
   /* Destroy existing background bitmap if loaded.  */
   if (bitmap)
     {
       grub_video_bitmap_destroy (bitmap);
       bitmap = 0;
-      
+
       /* Mark whole screen as dirty.  */
       dirty_region_reset ();
       dirty_region_add (0, 0, mode_info.width, mode_info.height);
@@ -903,7 +903,7 @@ grub_gfxterm_background_image_cmd (grub_command_t cmd __attribute__ ((unused)),
   if (argc >= 1)
     {
     /* Try to load new one.  */
-    grub_video_bitmap_load (&bitmap, args[0]);    
+    grub_video_bitmap_load (&bitmap, args[0]);
     if (grub_errno != GRUB_ERR_NONE)
       return grub_errno;
 
@@ -913,13 +913,13 @@ grub_gfxterm_background_image_cmd (grub_command_t cmd __attribute__ ((unused)),
         /* Determine bitmap dimensions.  */
         bitmap_width = grub_video_bitmap_get_width (bitmap);
         bitmap_height = grub_video_bitmap_get_width (bitmap);
-        
+
         /* Mark whole screen as dirty.  */
         dirty_region_reset ();
         dirty_region_add (0, 0, mode_info.width, mode_info.height);
       }
     }
-  
+
   /* All was ok.  */
   grub_errno = GRUB_ERR_NONE;
   return grub_errno;
index ec4d61506051a70a0a1712f0d9f94bd15427e1ee..6105e223a83e43c40a5756b2d97bd9b69f7ce305 100644 (file)
@@ -127,7 +127,7 @@ serial_translate_key_sequence (void)
       {'H', 1},
       {'4', 4}
     };
-  
+
   static struct
   {
       short key;
@@ -148,7 +148,7 @@ serial_translate_key_sequence (void)
   if (npending >= 3)
     {
       unsigned int i;
-      
+
       for (i = 0;
           i < sizeof (three_code_table) / sizeof (three_code_table[0]);
           i++)
@@ -165,7 +165,7 @@ serial_translate_key_sequence (void)
     {
       unsigned int i;
       short key = *((short *) (input_buf + 2));
-      
+
       for (i = 0;
           i < sizeof (four_code_table) / sizeof (four_code_table[0]);
           i++)
@@ -187,16 +187,16 @@ fill_input_buf (const int nowait)
   for (i = 0; i < 10000 && npending < sizeof (input_buf); i++)
     {
       int c;
-      
+
       c = serial_hw_fetch ();
       if (c >= 0)
        {
          input_buf[npending++] = c;
-         
+
          /* Reset the counter to zero, to wait for the same interval.  */
          i = 0;
        }
-      
+
       if (nowait)
        break;
     }
@@ -324,60 +324,60 @@ grub_serial_putchar (grub_uint32_t c)
            case GRUB_TERM_DISP_LEFT:
              c = '<';
              break;
-             
+
            case GRUB_TERM_DISP_UP:
              c = '^';
              break;
-             
+
            case GRUB_TERM_DISP_RIGHT:
              c = '>';
              break;
-             
+
            case GRUB_TERM_DISP_DOWN:
              c = 'v';
              break;
-             
+
            case GRUB_TERM_DISP_HLINE:
              c = '-';
              break;
-             
+
            case GRUB_TERM_DISP_VLINE:
              c = '|';
              break;
-             
+
            case GRUB_TERM_DISP_UL:
            case GRUB_TERM_DISP_UR:
            case GRUB_TERM_DISP_LL:
            case GRUB_TERM_DISP_LR:
              c = '+';
              break;
-             
+
            default:
              c = '?';
              break;
            }
        }
-      
+
       switch (c)
        {
        case '\a':
          break;
-         
+
        case '\b':
        case 127:
          if (xpos > 0)
            xpos--;
          break;
-         
+
        case '\n':
          if (ypos < TEXT_HEIGHT)
            ypos++;
          break;
-         
+
        case '\r':
          xpos = 0;
          break;
-         
+
        default:
          if (xpos >= TEXT_WIDTH)
            {
@@ -388,7 +388,7 @@ grub_serial_putchar (grub_uint32_t c)
          break;
        }
     }
-  
+
   serial_hw_put (c);
 }
 
@@ -422,7 +422,7 @@ grub_serial_gotoxy (grub_uint8_t x, grub_uint8_t y)
       keep_track = 0;
       grub_terminfo_gotoxy (x, y);
       keep_track = 1;
-      
+
       xpos = x;
       ypos = y;
     }
@@ -507,10 +507,10 @@ grub_cmd_serial (grub_extcmd_t cmd,
       if (!serial_settings.port)
        return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad unit number.");
     }
-  
+
   if (state[1].set)
     serial_settings.port = (unsigned short) grub_strtoul (state[1].arg, 0, 0);
-  
+
   if (state[2].set)
     {
       unsigned long speed;
@@ -523,7 +523,7 @@ grub_cmd_serial (grub_extcmd_t cmd,
          return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad speed");
        }
     }
-  
+
   if (state[3].set)
     {
       if (! grub_strcmp (state[3].arg, "5"))
@@ -540,7 +540,7 @@ grub_cmd_serial (grub_extcmd_t cmd,
          return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad word length");
        }
     }
-  
+
   if (state[4].set)
     {
       if (! grub_strcmp (state[4].arg, "no"))
@@ -555,7 +555,7 @@ grub_cmd_serial (grub_extcmd_t cmd,
          return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad parity");
        }
     }
-  
+
   if (state[5].set)
     {
       if (! grub_strcmp (state[5].arg, "1"))
@@ -571,7 +571,7 @@ grub_cmd_serial (grub_extcmd_t cmd,
 
   /* Initialize with new settings.  */
   hwiniterr = serial_hw_init ();
-  
+
   if (hwiniterr == GRUB_ERR_NONE)
     {
       /* Register terminal if not yet registered.  */
@@ -599,7 +599,7 @@ grub_cmd_serial (grub_extcmd_t cmd,
            }
        }
     }
-  
+
   return hwiniterr;
 }
 
index 7a81f644f68e0f65899abf83fff769b766268b9e..52694ed104027149c332bca14fe836542a29ab72 100644 (file)
@@ -267,7 +267,7 @@ static void
 grub_virtual_screen_invalidate_char (struct grub_colored_char *p)
 {
   p->code = 0xFFFF;
-  
+
   if (p->width)
     {
       struct grub_colored_char *q;
@@ -411,14 +411,14 @@ grub_vesafb_putchar (grub_uint32_t c)
          if (virtual_screen.cursor_x > 0)
            virtual_screen.cursor_x--;
          break;
-         
+
        case '\n':
          if (virtual_screen.cursor_y >= virtual_screen.rows - 1)
            scroll_up ();
          else
            virtual_screen.cursor_y++;
          break;
-         
+
        case '\r':
          virtual_screen.cursor_x = 0;
          break;
@@ -431,7 +431,7 @@ grub_vesafb_putchar (grub_uint32_t c)
     {
       unsigned width;
       struct grub_colored_char *p;
-      
+
       grub_virtual_screen_get_glyph (c, 0, &width);
 
       if (virtual_screen.cursor_x + width > virtual_screen.columns)
@@ -457,14 +457,14 @@ grub_vesafb_putchar (grub_uint32_t c)
              p[i].index = i;
            }
        }
-         
+
       write_char ();
-  
+
       virtual_screen.cursor_x += width;
       if (virtual_screen.cursor_x >= virtual_screen.columns)
        {
          virtual_screen.cursor_x = 0;
-         
+
          if (virtual_screen.cursor_y >= virtual_screen.rows - 1)
            scroll_up ();
          else
@@ -480,7 +480,7 @@ static grub_ssize_t
 grub_vesafb_getcharwidth (grub_uint32_t c)
 {
   unsigned width;
-  
+
   if (! grub_virtual_screen_get_glyph (c, 0, &width))
     return 0;
 
@@ -542,7 +542,7 @@ grub_vesafb_cls (void)
   grub_virtual_screen_cls ();
 
   grub_memset (framebuffer,
-               0, 
+               0,
               mode_info.y_resolution * bytes_per_scan_line);
 }
 
index 59c298375c02ac023ad44e9542fb7dd098a24c93..9deb6a6d7c308f65a23a26bede27d2b119786760 100644 (file)
@@ -95,12 +95,12 @@ get_map_mask (void)
 {
   unsigned char old_addr;
   unsigned char old_data;
-  
+
   old_addr = grub_inb (SEQUENCER_ADDR_PORT);
   grub_outb (MAP_MASK_REGISTER, SEQUENCER_ADDR_PORT);
-  
+
   old_data = grub_inb (SEQUENCER_DATA_PORT);
-  
+
   grub_outb (old_addr, SEQUENCER_ADDR_PORT);
 
   return old_data;
@@ -111,12 +111,12 @@ static void
 set_map_mask (unsigned char mask)
 {
   unsigned char old_addr;
-  
+
   old_addr = grub_inb (SEQUENCER_ADDR_PORT);
   grub_outb (MAP_MASK_REGISTER, SEQUENCER_ADDR_PORT);
-  
+
   grub_outb (mask, SEQUENCER_DATA_PORT);
-  
+
   grub_outb (old_addr, SEQUENCER_ADDR_PORT);
 }
 
@@ -125,7 +125,7 @@ static void
 set_read_map (unsigned char map)
 {
   unsigned char old_addr;
-  
+
   old_addr = grub_inb (GRAPHICS_ADDR_PORT);
 
   grub_outb (READ_MAP_REGISTER, GRAPHICS_ADDR_PORT);
@@ -139,12 +139,12 @@ static void
 set_start_address (unsigned int start)
 {
   unsigned char old_addr;
-  
+
   old_addr = grub_inb (CRTC_ADDR_PORT);
-  
+
   grub_outb (START_ADDR_LOW_REGISTER, CRTC_ADDR_PORT);
   grub_outb (start & 0xFF, CRTC_DATA_PORT);
-  
+
   grub_outb (START_ADDR_HIGH_REGISTER, CRTC_ADDR_PORT);
   grub_outb (start >> 8, CRTC_DATA_PORT);
 
@@ -164,7 +164,7 @@ grub_vga_mod_init (void)
   font = grub_font_get ("");  /* Choose any font, for now. */
   if (!font)
     return grub_error (GRUB_ERR_BAD_FONT, "No font loaded.");
-  
+
   return GRUB_ERR_NONE;
 }
 
@@ -192,13 +192,13 @@ write_char (void)
   unsigned char *mem_base;
   unsigned plane;
 
-  mem_base = (VGA_MEM + xpos + 
+  mem_base = (VGA_MEM + xpos +
              ypos * CHAR_HEIGHT * TEXT_WIDTH + PAGE_OFFSET (page)) - p->index;
   p -= p->index;
 
   /* Get glyph for character.  */
   glyph = grub_font_get_glyph (font, p->code);
-  
+
   for (plane = 0x01; plane <= 0x08; plane <<= 1)
     {
       unsigned y;
@@ -219,7 +219,7 @@ write_char (void)
          for (i = 0; i < char_width && offset < 32; i++)
            {
              unsigned char fg_mask, bg_mask;
-             
+
              fg_mask = (p->fg_color & plane) ? glyph->bitmap[offset] : 0;
              bg_mask = (p->bg_color & plane) ? ~(glyph->bitmap[offset]) : 0;
              offset++;
@@ -227,7 +227,7 @@ write_char (void)
              if (check_vga_mem (mem + i))
                mem[i] = (fg_mask | bg_mask);
            }
-#endif /* 0 */ 
+#endif /* 0 */
        }
     }
 
@@ -241,7 +241,7 @@ write_cursor (void)
                        + (ypos * CHAR_HEIGHT + CHAR_HEIGHT - 3) * TEXT_WIDTH);
   if (check_vga_mem (mem))
     *mem = 0xff;
-  
+
   mem += TEXT_WIDTH;
   if (check_vga_mem (mem))
     *mem = 0xff;
@@ -252,11 +252,11 @@ scroll_up (void)
 {
   unsigned i;
   unsigned plane;
-  
+
   /* Do all the work in the other page.  */
   grub_memmove (text_buf, text_buf + TEXT_WIDTH,
                sizeof (struct colored_char) * TEXT_WIDTH * (TEXT_HEIGHT - 1));
-      
+
   for (i = TEXT_WIDTH * (TEXT_HEIGHT - 1); i < TEXT_WIDTH * TEXT_HEIGHT; i++)
     {
       text_buf[i].code = ' ';
@@ -279,7 +279,7 @@ scroll_up (void)
   grub_memset (VGA_MEM + PAGE_OFFSET (1 - page)
               + VGA_WIDTH * (VGA_HEIGHT - CHAR_HEIGHT) / 8, 0,
               VGA_WIDTH * CHAR_HEIGHT / 8);
-  
+
   /* Activate the other page.  */
   page = 1 - page;
   wait_vretrace ();
@@ -292,7 +292,7 @@ grub_vga_putchar (grub_uint32_t c)
 #if DEBUG_VGA
   static int show = 1;
 #endif
-  
+
   if (c == '\a')
     /* FIXME */
     return;
@@ -302,21 +302,21 @@ grub_vga_putchar (grub_uint32_t c)
       /* Erase current cursor, if any.  */
       if (cursor_state)
        write_char ();
-  
+
       switch (c)
        {
        case '\b':
          if (xpos > 0)
            xpos--;
          break;
-         
+
        case '\n':
          if (ypos >= TEXT_HEIGHT - 1)
            scroll_up ();
          else
            ypos++;
          break;
-         
+
        case '\r':
          xpos = 0;
          break;
@@ -330,7 +330,7 @@ grub_vga_putchar (grub_uint32_t c)
       struct grub_font_glyph *glyph;
       struct colored_char *p;
       unsigned char_width = 1;
-      
+
       glyph = grub_font_get_glyph(font, c);
 
       if (xpos + char_width > TEXT_WIDTH)
@@ -354,14 +354,14 @@ grub_vga_putchar (grub_uint32_t c)
              p[i].index = i;
            }
        }
-         
+
       write_char ();
-  
+
       xpos += char_width;
       if (xpos >= TEXT_WIDTH)
        {
          xpos = 0;
-         
+
          if (ypos >= TEXT_HEIGHT - 1)
            scroll_up ();
          else
@@ -391,9 +391,9 @@ grub_vga_getcharwidth (grub_uint32_t c)
 {
 #if 0
   struct grub_font_glyph glyph;
-  
+
   glyph = grub_font_get_glyph (c);
-  
+
   return glyph.char_width;
 #else
   (void) c;   /* Prevent warning.  */
index 0cc0924fc34286d58cfe38dd3cdbe8e7053d48d1..c61e16eb73e255e01fc33634e9a9bb5c18b2e41f 100644 (file)
@@ -71,7 +71,7 @@ grub_ofconsole_writeesc (const char *str)
       char chr = *(str++);
       grub_ieee1275_write (stdout_ihandle, &chr, 1, 0);
     }
-  
+
 }
 
 static void
@@ -158,19 +158,19 @@ grub_ofconsole_readkey (int *key)
          *key = '\e';
          return 1;
        }
-      
+
       if (c != 91)
        return 0;
-      
+
       grub_ieee1275_read (stdin_ihandle, &c, 1, &actual);
       if (actual <= 0)
        return 0;
-      
+
       switch (c)
        {
        case 65:
          /* Up: Ctrl-p.  */
-         c = 16; 
+         c = 16;
          break;
        case 66:
          /* Down: Ctrl-n.  */
@@ -186,7 +186,7 @@ grub_ofconsole_readkey (int *key)
          break;
        }
     }
-  
+
   *key = c;
   return actual > 0;
 }
@@ -196,7 +196,7 @@ grub_ofconsole_checkkey (void)
 {
   int key;
   int read;
-  
+
   if (grub_buflen)
     return 1;
 
@@ -207,7 +207,7 @@ grub_ofconsole_checkkey (void)
       grub_buflen = 1;
       return 1;
     }
-    
+
   return -1;
 }
 
@@ -223,7 +223,7 @@ grub_ofconsole_getkey (void)
     }
 
   while (! grub_ofconsole_readkey (&key));
-  
+
   return key;
 }
 
index f18be9ef02efaab191cf3adf3d4840797630becc..80ae9b10021c0cf338d500c6c5b7d0f4e1ed91aa 100644 (file)
@@ -90,7 +90,7 @@ grub_terminfo_set_current (const char *str)
   grub_terminfo_free (&term.reverse_video_off);
   grub_terminfo_free (&term.cursor_on);
   grub_terminfo_free (&term.cursor_off);
-  
+
   if (grub_strcmp ("vt100", str) == 0)
     {
       term.name              = grub_strdup ("vt100");
@@ -102,7 +102,7 @@ grub_terminfo_set_current (const char *str)
       term.cursor_off        = grub_strdup ("\e[?25l");
       return grub_errno;
     }
-  
+
   return grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown terminfo type.");
 }
 
index 66962d8e5e853cf1f5b46208bba54fc072746d3a..c827955aba859ddf8c136ef15c178846d28c1ae4 100644 (file)
@@ -67,7 +67,7 @@ grub_usb_hid (void)
   int usb_iterate (grub_usb_device_t dev)
     {
       descdev = &dev->descdev;
-      
+
       grub_dprintf ("usb_keyboard", "%x %x %x\n",
                   descdev->class, descdev->subclass, descdev->protocol);
 
index 70b0440bb91594d1f616a9cec082f8fdb9e58c20..04bb56dbbeb4fc96e6f4101f099da1477797a3b8 100644 (file)
@@ -106,7 +106,7 @@ grub_ncurses_putchar (grub_uint32_t c)
        c = '?';
       break;
     }
-  
+
   addch (c | grub_console_attr);
 }
 
@@ -119,7 +119,7 @@ grub_ncurses_getcharwidth (grub_uint32_t code __attribute__ ((unused)))
 static void
 grub_ncurses_setcolorstate (grub_term_color_state state)
 {
-  switch (state) 
+  switch (state)
     {
     case GRUB_TERM_COLOR_STANDARD:
       grub_console_cur_color = grub_console_standard_color;
@@ -170,12 +170,12 @@ static int
 grub_ncurses_checkkey (void)
 {
   int c;
-  
+
   /* Check for SAVED_CHAR. This should not be true, because this
      means checkkey is called twice continuously.  */
   if (saved_char != ERR)
     return saved_char;
-  
+
   wtimeout (stdscr, 100);
   c = getch ();
   /* If C is not ERR, then put it back in the input queue.  */
@@ -192,7 +192,7 @@ static int
 grub_ncurses_getkey (void)
 {
   int c;
-  
+
   /* If checkkey has already got a character, then return it.  */
   if (saved_char != ERR)
     {
@@ -214,7 +214,7 @@ grub_ncurses_getkey (void)
     case KEY_RIGHT:
       c = 6;
       break;
-      
+
     case KEY_UP:
       c = 16;
       break;
@@ -234,7 +234,7 @@ grub_ncurses_getkey (void)
     case KEY_BACKSPACE:
       /* XXX: For some reason ncurses on xterm does not return
         KEY_BACKSPACE.  */
-    case 127: 
+    case 127:
       c = 8;
       break;
 
index 5f892afa6de08b1d25d70f27326f4441c4281755..b50979d6556f0311fe7078489af7d1b9b5df60fd 100644 (file)
@@ -52,7 +52,7 @@ strip_extra_slashes (char *dir)
            p[0] = '\0';
          break;
        }
-      
+
       p++;
     }
 }
@@ -104,7 +104,7 @@ grub_get_prefix (const char *dir)
   char *abs_dir, *prev_dir;
   char *prefix;
   struct stat st, prev_st;
-  
+
   /* Save the current directory.  */
   saved_cwd = xgetcwd ();
 
@@ -114,7 +114,7 @@ grub_get_prefix (const char *dir)
   abs_dir = xgetcwd ();
   strip_extra_slashes (abs_dir);
   prev_dir = xstrdup (abs_dir);
-  
+
   if (stat (".", &prev_st) < 0)
     grub_util_error ("Cannot stat `%s'", dir);
 
@@ -187,7 +187,7 @@ find_root_device (const char *dir, dev_t dev)
   DIR *dp;
   char *saved_cwd;
   struct dirent *ent;
-  
+
   dp = opendir (dir);
   if (! dp)
     return 0;
@@ -201,11 +201,11 @@ find_root_device (const char *dir, dev_t dev)
       closedir (dp);
       return 0;
     }
-  
+
   while ((ent = readdir (dp)) != 0)
     {
       struct stat st;
-      
+
       /* Avoid:
         - dotfiles (like "/dev/.tmp.md0") since they could be duplicates.
         - dotdirs (like "/dev/.static") since they could contain duplicates.  */
@@ -219,7 +219,7 @@ find_root_device (const char *dir, dev_t dev)
       if (S_ISLNK (st.st_mode))
        /* Don't follow symbolic links.  */
        continue;
-      
+
       if (S_ISDIR (st.st_mode))
        {
          /* Find it recursively.  */
@@ -231,7 +231,7 @@ find_root_device (const char *dir, dev_t dev)
            {
              if (chdir (saved_cwd) < 0)
                grub_util_error ("Cannot restore the original directory");
-             
+
              free (saved_cwd);
              closedir (dp);
              return res;
@@ -380,7 +380,7 @@ grub_guess_root_device (const char *dir)
 {
   struct stat st;
   char *os_dev;
-  
+
   if (stat (dir, &st) < 0)
     grub_util_error ("Cannot stat `%s'", dir);
 
@@ -437,7 +437,7 @@ grub_util_get_grub_dev (const char *os_dev)
              offset++;
          }
       }
-      
+
       break;
 
     case GRUB_DEV_ABSTRACTION_RAID:
@@ -500,7 +500,7 @@ grub_util_get_grub_dev (const char *os_dev)
        }
       else
        grub_util_error ("Unknown kind of RAID device `%s'", os_dev);
-      
+
       break;
 
     default:  /* GRUB_DEV_ABSTRACTION_NONE */
index 57f837a39705de04ede04f753bf2ca70c3f4147a..6d123405028020b3dfe5876a618b3fd5ab059072 100644 (file)
@@ -95,7 +95,7 @@ create_envblk_file (const char *name)
 {
   FILE *fp;
   char *buf;
-  
+
   buf = malloc (DEFAULT_ENVBLK_SIZE);
   if (! buf)
     grub_util_error ("out of memory");
@@ -107,7 +107,7 @@ create_envblk_file (const char *name)
   memcpy (buf, GRUB_ENVBLK_SIGNATURE, sizeof (GRUB_ENVBLK_SIGNATURE) - 1);
   memset (buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1, '#',
           DEFAULT_ENVBLK_SIZE - sizeof (GRUB_ENVBLK_SIGNATURE) + 1);
-  
+
   if (fwrite (buf, 1, DEFAULT_ENVBLK_SIZE, fp) != DEFAULT_ENVBLK_SIZE)
     grub_util_error ("cannot write to the file %s", name);
 
@@ -123,7 +123,7 @@ open_envblk_file (const char *name)
   char *buf;
   size_t size;
   grub_envblk_t envblk;
-  
+
   fp = fopen (name, "rb");
   if (! fp)
     {
@@ -145,12 +145,12 @@ open_envblk_file (const char *name)
   buf = malloc (size);
   if (! buf)
     grub_util_error ("out of memory");
-  
+
   if (fread (buf, 1, size, fp) != size)
     grub_util_error ("cannot read the file %s", name);
 
   fclose (fp);
-  
+
   envblk = grub_envblk_open (buf, size);
   if (! envblk)
     grub_util_error ("invalid environment block");
@@ -162,7 +162,7 @@ static void
 list_variables (const char *name)
 {
   grub_envblk_t envblk;
-  
+
   auto int print_var (const char *name, const char *value);
   int print_var (const char *name, const char *value)
     {
@@ -179,11 +179,11 @@ static void
 write_envblk (const char *name, grub_envblk_t envblk)
 {
   FILE *fp;
-  
+
   fp = fopen (name, "wb");
   if (! fp)
     grub_util_error ("cannot open the file %s", name);
-  
+
   if (fwrite (grub_envblk_buffer (envblk), 1, grub_envblk_size (envblk), fp)
       != grub_envblk_size (envblk))
     grub_util_error ("cannot write to the file %s", name);
@@ -196,7 +196,7 @@ static void
 set_variables (const char *name, int argc, char *argv[])
 {
   grub_envblk_t envblk;
-  
+
   envblk = open_envblk_file (name);
   while (argc)
     {
@@ -223,7 +223,7 @@ static void
 unset_variables (const char *name, int argc, char *argv[])
 {
   grub_envblk_t envblk;
-  
+
   envblk = open_envblk_file (name);
   while (argc)
     {
@@ -242,9 +242,9 @@ main (int argc, char *argv[])
 {
   char *filename;
   char *command;
-  
+
   progname = "grub-editenv";
-  
+
   /* Check for options.  */
   while (1)
     {
@@ -285,7 +285,7 @@ main (int argc, char *argv[])
       fprintf (stderr, "no command specified\n");
       usage (1);
     }
-  
+
   filename = argv[optind];
   command = argv[optind + 1];
 
index addbc085f61477d562c086bc04243750a92d5c7a..c133dbead13f3cb70ebac58e6287e61a32f2e733 100644 (file)
@@ -105,7 +105,7 @@ static struct option options[] =
     { 0, 0, 0, 0 }
   };
 
-static int 
+static int
 usage (int status)
 {
   if (status)
@@ -138,7 +138,7 @@ main (int argc, char *argv[])
   char *dev_map = DEFAULT_DEVICE_MAP;
   volatile int hold = 0;
   int opt;
-  
+
   progname = "grub-emu";
 
   while ((opt = getopt_long (argc, argv, "r:d:m:vH:hV", options, 0)) != -1)
@@ -185,7 +185,7 @@ main (int argc, char *argv[])
 
       sleep (1);
     }
-  
+
   signal (SIGINT, SIG_IGN);
   grub_console_init ();
 
@@ -218,7 +218,7 @@ main (int argc, char *argv[])
   prefix = xmalloc (strlen (root_dev) + 2 + strlen (dir) + 1);
   sprintf (prefix, "(%s)%s", root_dev, dir);
   free (dir);
-  
+
   /* Start GRUB!  */
   if (setjmp (main_env) == 0)
     grub_main ();
@@ -226,6 +226,6 @@ main (int argc, char *argv[])
   grub_fini_all ();
 
   grub_machine_fini ();
-  
+
   return 0;
 }
index 63c94c74207305a7032dcd69a1a1da42732c03c8..8683587be9608387611805e35e4735dd84714f1a 100644 (file)
@@ -24,7 +24,7 @@
 #include <stdlib.h>
 
 /* XXX: this file assumes particular Mach-O layout and does no checks. */
-/* However as build system ensures correct usage of this tool this 
+/* However as build system ensures correct usage of this tool this
    shouldn't be a problem. */
 
 int
@@ -71,7 +71,7 @@ main (int argc, char **argv)
       fclose (out);
       printf ("Couldn't allocate buffer\n");
       return 3;
-    }  
+    }
   fread (buf, 1, bufsize, in);
   head = (struct grub_macho_header32 *) buf;
   if (grub_le_to_cpu32 (head->magic) != GRUB_MACHO_MAGIC32)
@@ -81,22 +81,22 @@ main (int argc, char **argv)
       free (buf);
       printf ("Invalid Mach-O fle\n");
       return 4;
-    }  
+    }
   curcmd = (struct grub_macho_segment32 *) (buf + sizeof (*head));
-  for (i = 0; i < grub_le_to_cpu32 (head->ncmds); i++, 
-        curcmd = (struct grub_macho_segment32 *) 
+  for (i = 0; i < grub_le_to_cpu32 (head->ncmds); i++,
+        curcmd = (struct grub_macho_segment32 *)
         (((char *) curcmd) + curcmd->cmdsize))
     {
       if (curcmd->cmd != GRUB_MACHO_CMD_SEGMENT32)
        continue;
-      fwrite (buf + grub_le_to_cpu32 (curcmd->fileoff), 1, 
+      fwrite (buf + grub_le_to_cpu32 (curcmd->fileoff), 1,
              grub_le_to_cpu32 (curcmd->filesize), out);
-      if (grub_le_to_cpu32 (curcmd->vmsize) 
+      if (grub_le_to_cpu32 (curcmd->vmsize)
          > grub_le_to_cpu32 (curcmd->filesize))
        {
-         bssstart = grub_le_to_cpu32 (curcmd->vmaddr) 
+         bssstart = grub_le_to_cpu32 (curcmd->vmaddr)
            + grub_le_to_cpu32 (curcmd->filesize) ;
-         bssend = grub_le_to_cpu32 (curcmd->vmaddr) 
+         bssend = grub_le_to_cpu32 (curcmd->vmaddr)
            + grub_le_to_cpu32 (curcmd->vmsize) ;
        }
     }
index ff92590022f51ee398fd6748e23fb376f824f47a..aad0683d8f1a5f4db1b9019a6b499a3b405b37b7 100644 (file)
@@ -60,7 +60,7 @@ for option in "$@"; do
        ;;
     --output=)
        grub_cfg=`echo "$option" | sed 's/--output=//'`
-       ;;      
+       ;;
     -*)
        echo "Unrecognized option \`$option'" 1>&2
        usage
index ac8a39059f9cd7a9fb8266fada42b605730f31f0..ec43b34b409747d9fa57278774ef0b39887ac034 100644 (file)
@@ -55,7 +55,7 @@ make_device_map (const char *device_map, int floppy_disks)
     fp = stdout;
   else
     fp = fopen (device_map, "w");
-  
+
   if (! fp)
     grub_util_error ("cannot open %s", device_map);
 
@@ -98,7 +98,7 @@ Generate a device map file automatically.\n\
 Report bugs to <%s>.\n\
 ",
            DEFAULT_DEVICE_MAP, PACKAGE_BUGREPORT);
-  
+
   exit (status);
 }
 
@@ -107,14 +107,14 @@ main (int argc, char *argv[])
 {
   char *dev_map = 0;
   int floppy_disks = 1;
-  
+
   progname = "grub-mkdevicemap";
-  
+
   /* Check for options.  */
   while (1)
     {
       int c = getopt_long (argc, argv, "snm:r:hVv", options, 0);
-      
+
       if (c == -1)
        break;
       else
@@ -134,7 +134,7 @@ main (int argc, char *argv[])
          case 's':
            floppy_disks = 2;
            break;
-           
+
          case 'h':
            usage (0);
            break;
@@ -156,6 +156,6 @@ main (int argc, char *argv[])
   make_device_map (dev_map ? : DEFAULT_DEVICE_MAP, floppy_disks);
 
   free (dev_map);
-  
+
   return 0;
 }
index bdb9159641737fe16523d422fdc2fb617632409b..97d386051f8ddb84b61c006ed969ce929fb91a52 100644 (file)
@@ -80,21 +80,21 @@ probe_partmap (grub_disk_t disk)
 {
   char *name;
   char *underscore;
-  
+
   if (disk->partition == NULL)
     {
       grub_util_info ("No partition map found for %s", disk->name);
       return;
     }
-  
+
   name = strdup (disk->partition->partmap->name);
   if (! name)
     grub_util_error ("Not enough memory");
-  
+
   underscore = strchr (name, '_');
   if (! underscore)
     grub_util_error ("Invalid partition map %s", name);
-  
+
   *underscore = '\0';
   printf ("%s\n", name);
   free (name);
@@ -109,7 +109,7 @@ probe (const char *path, char *device_name)
   int abstraction_type;
   grub_device_t dev = NULL;
   grub_fs_t fs;
-  
+
   if (path == NULL)
     {
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
@@ -134,7 +134,7 @@ probe (const char *path, char *device_name)
 
   abstraction_type = grub_util_get_dev_abstraction (device_name);
   /* No need to check for errors; lack of abstraction is permissible.  */
-  
+
   if (print == PRINT_ABSTRACTION)
     {
       char *abstraction_name;
@@ -157,7 +157,7 @@ probe (const char *path, char *device_name)
   drive_name = grub_util_get_grub_dev (device_name);
   if (! drive_name)
     grub_util_error ("Cannot find a GRUB drive for %s.  Check your device.map.\n", device_name);
-  
+
   if (print == PRINT_DRIVE)
     {
       printf ("(%s)\n", drive_name);
@@ -206,15 +206,15 @@ probe (const char *path, char *device_name)
          grub_file_t file;
          grub_util_info ("reading %s via OS facilities", path);
          filebuf_via_sys = grub_util_read_image (path);
-         
+
          grub_util_info ("reading %s via GRUB facilities", path);
          asprintf (&grub_path, "(%s)%s", drive_name, path);
          file = grub_file_open (grub_path);
          filebuf_via_grub = xmalloc (file->size);
          grub_file_read (file, filebuf_via_grub, file->size);
-         
+
          grub_util_info ("comparing");
-         
+
          if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size))
            grub_util_error ("files differ");
        }
@@ -275,7 +275,7 @@ Probe device information for a given path (or device, if the -d option is given)
 Report bugs to <%s>.\n\
 ",
            DEFAULT_DEVICE_MAP, PACKAGE_BUGREPORT);
-  
+
   exit (status);
 }
 
@@ -284,14 +284,14 @@ main (int argc, char *argv[])
 {
   char *dev_map = 0;
   char *argument;
-  
+
   progname = "grub-probe";
-  
+
   /* Check for options.  */
   while (1)
     {
       int c = getopt_long (argc, argv, "dm:t:hVv", options, 0);
-      
+
       if (c == -1)
        break;
       else
@@ -360,10 +360,10 @@ main (int argc, char *argv[])
     }
 
   argument = argv[optind];
-  
+
   /* Initialize the emulated biosdisk driver.  */
   grub_util_biosdisk_init (dev_map ? : DEFAULT_DEVICE_MAP);
-  
+
   /* Initialize all modules. */
   grub_init_all ();
 
@@ -372,12 +372,12 @@ main (int argc, char *argv[])
     probe (NULL, argument);
   else
     probe (argument, NULL);
-  
+
   /* Free resources.  */
   grub_fini_all ();
   grub_util_biosdisk_fini ();
-  
+
   free (dev_map);
-  
+
   return 0;
 }
index 12d61b03908f97475f3f07c23797eb7fc9484c9b..e72198da632dbec46257317a7829714e779590ac 100644 (file)
@@ -50,7 +50,7 @@ case "${GRUB_FS}" in
 esac
 
 for i in /hurd/${hurd_fs}.static /hurd/exec ; do
-  if test -e "$i" ; then 
+  if test -e "$i" ; then
     echo "Found Hurd module: $i" >&2
     at_least_one=true
   else
index 7d4d17e9593240e5a65e7e671d7b2303a6e6b63a..cb7f6428ce7fc4ff4854933e29a49822d6fc1ef0 100644 (file)
@@ -52,7 +52,7 @@ EOF
     ;;
     linux)
       LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
+
       for LINUX in ${LINUXPROBED} ; do
         LROOT="`echo ${LINUX} | cut -d ':' -f 1`"
         LBOOT="`echo ${LINUX} | cut -d ':' -f 2`"
index a7262dd8f74bcd1e236be735583fb957638a54ee..1844a7e55b5b9f50cb244d0ed71357d94d5e60ae 100644 (file)
@@ -160,12 +160,12 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk)
 {
   int drive;
   struct stat st;
-  
+
   drive = find_grub_drive (name);
   if (drive < 0)
     return grub_error (GRUB_ERR_BAD_DEVICE,
                       "no mapping exists for `%s'", name);
-  
+
   disk->has_partitions = 1;
   disk->id = drive;
 
@@ -203,7 +203,7 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk)
        close (fd);
        goto fail;
       }
-    
+
 # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
     if (ioctl (fd, DIOCGMEDIASIZE, &nr))
 # else
@@ -219,9 +219,9 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk)
 
     if (nr % 512)
       grub_util_error ("unaligned device size");
-    
+
     grub_util_info ("the size of %s is %llu", name, disk->total_sectors);
-    
+
     return GRUB_ERR_NONE;
   }
 
@@ -234,9 +234,9 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk)
     return grub_error (GRUB_ERR_BAD_DEVICE, "cannot stat `%s'", map[drive].device);
 
   disk->total_sectors = st.st_size >> GRUB_DISK_SECTOR_BITS;
-  
+
   grub_util_info ("the size of %s is %lu", name, disk->total_sectors);
-  
+
   return GRUB_ERR_NONE;
 }
 
@@ -314,18 +314,18 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags)
 #ifdef O_BINARY
   flags |= O_BINARY;
 #endif
-  
+
 #ifdef __linux__
   /* Linux has a bug that the disk cache for a whole disk is not consistent
      with the one for a partition of the disk.  */
   {
     int is_partition = 0;
     char dev[PATH_MAX];
-    
+
     strcpy (dev, map[disk->id].device);
     if (disk->partition && strncmp (map[disk->id].device, "/dev/", 5) == 0)
       is_partition = linux_find_partition (dev, disk->partition->start);
-    
+
     /* Open the partition.  */
     grub_dprintf ("hostdisk", "opening the device `%s' in open_device()", dev);
     fd = open (dev, flags);
@@ -411,18 +411,18 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags)
 
   return fd;
 }
-  
+
 /* Read LEN bytes from FD in BUF. Return less than or equal to zero if an
    error occurs, otherwise return LEN.  */
 static ssize_t
 nread (int fd, char *buf, size_t len)
 {
   ssize_t size = len;
-  
+
   while (len)
     {
       ssize_t ret = read (fd, buf, len);
-      
+
       if (ret <= 0)
         {
           if (errno == EINTR)
@@ -430,11 +430,11 @@ nread (int fd, char *buf, size_t len)
           else
             return ret;
         }
-      
+
       len -= ret;
       buf += ret;
     }
-  
+
   return size;
 }
 
@@ -444,11 +444,11 @@ static ssize_t
 nwrite (int fd, const char *buf, size_t len)
 {
   ssize_t size = len;
-  
+
   while (len)
     {
       ssize_t ret = write (fd, buf, len);
-      
+
       if (ret <= 0)
         {
           if (errno == EINTR)
@@ -456,11 +456,11 @@ nwrite (int fd, const char *buf, size_t len)
           else
             return ret;
         }
-      
+
       len -= ret;
       buf += ret;
     }
-  
+
   return size;
 }
 
@@ -473,13 +473,13 @@ grub_util_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector,
   fd = open_device (disk, sector, O_RDONLY);
   if (fd < 0)
     return grub_errno;
-  
+
 #ifdef __linux__
   if (sector == 0 && size > 1)
     {
       /* Work around a bug in Linux ez remapping.  Linux remaps all
         sectors that are read together with the MBR in one read.  It
-        should only remap the MBR, so we split the read in two 
+        should only remap the MBR, so we split the read in two
         parts. -jochen  */
       if (nread (fd, buf, GRUB_DISK_SECTOR_SIZE) != GRUB_DISK_SECTOR_SIZE)
        {
@@ -487,12 +487,12 @@ grub_util_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector,
          close (fd);
          return grub_errno;
        }
-      
+
       buf += GRUB_DISK_SECTOR_SIZE;
       size--;
     }
 #endif /* __linux__ */
-  
+
   if (nread (fd, buf, size << GRUB_DISK_SECTOR_BITS)
       != (ssize_t) (size << GRUB_DISK_SECTOR_BITS))
     grub_error (GRUB_ERR_READ_ERROR, "cannot read from `%s'", map[disk->id].device);
@@ -510,7 +510,7 @@ grub_util_biosdisk_write (grub_disk_t disk, grub_disk_addr_t sector,
   fd = open_device (disk, sector, O_WRONLY);
   if (fd < 0)
     return grub_errno;
-  
+
   if (nwrite (fd, buf, size << GRUB_DISK_SECTOR_BITS)
       != (ssize_t) (size << GRUB_DISK_SECTOR_BITS))
     grub_error (GRUB_ERR_WRITE_ERROR, "cannot write to `%s'", map[disk->id].device);
@@ -544,7 +544,7 @@ read_device_map (const char *dev_map)
     {
       grub_util_error ("%s:%d: %s", dev_map, lineno, msg);
     }
-  
+
   fp = fopen (dev_map, "r");
   if (! fp)
     grub_util_error ("Cannot open `%s'", dev_map);
@@ -554,9 +554,9 @@ read_device_map (const char *dev_map)
       char *p = buf;
       char *e;
       int drive;
-      
+
       lineno++;
-      
+
       /* Skip leading spaces.  */
       while (*p && isspace (*p))
        p++;
@@ -636,7 +636,7 @@ void
 grub_util_biosdisk_fini (void)
 {
   unsigned i;
-  
+
   for (i = 0; i < sizeof (map) / sizeof (map[0]); i++)
     {
       if (map[i].drive)
@@ -645,7 +645,7 @@ grub_util_biosdisk_fini (void)
        free (map[i].device);
       map[i].drive = map[i].device = NULL;
     }
-  
+
   grub_disk_dev_unregister (&grub_util_biosdisk_dev);
 }
 
@@ -672,13 +672,13 @@ make_device_name (int drive, int dos_part, int bsd_part)
    */
   p = xmalloc (len + 2);
   sprintf (p, "%s", map[drive].drive);
-  
+
   if (dos_part >= 0)
     sprintf (p + strlen (p), ",%d", dos_part + 1);
-  
+
   if (bsd_part >= 0)
     sprintf (p + strlen (p), ",%c", bsd_part + 'a');
-  
+
   return p;
 }
 
@@ -689,7 +689,7 @@ convert_system_partition_to_system_disk (const char *os_dev)
   char *path = xmalloc (PATH_MAX);
   if (! realpath (os_dev, path))
     return 0;
-  
+
   if (strncmp ("/dev/", path, 5) == 0)
     {
       char *p = path + 5;
@@ -700,20 +700,20 @@ convert_system_partition_to_system_disk (const char *os_dev)
          p = strstr (p, "part");
          if (p)
            strcpy (p, "disc");
-         
+
          return path;
        }
-      
+
       /* If this is a SCSI disk.  */
       if (strncmp ("scsi/", p, 5) == 0)
        {
          p = strstr (p, "part");
          if (p)
            strcpy (p, "disc");
-         
+
          return path;
        }
-      
+
       /* If this is a DAC960 disk.  */
       if (strncmp ("rd/c", p, 4) == 0)
        {
@@ -724,7 +724,7 @@ convert_system_partition_to_system_disk (const char *os_dev)
 
          return path;
        }
-      
+
       /* If this is a CCISS disk.  */
       if (strncmp ("cciss/c", p, sizeof ("cciss/c") - 1) == 0)
        {
@@ -735,7 +735,7 @@ convert_system_partition_to_system_disk (const char *os_dev)
 
          return path;
        }
-      
+
       /* If this is a Compaq Intelligent Drive Array.  */
       if (strncmp ("ida/c", p, sizeof ("ida/c") - 1) == 0)
        {
@@ -746,7 +746,7 @@ convert_system_partition_to_system_disk (const char *os_dev)
 
          return path;
        }
-      
+
       /* If this is an I2O disk.  */
       if (strncmp ("i2o/hd", p, sizeof ("i2o/hd") - 1) == 0)
        {
@@ -754,7 +754,7 @@ convert_system_partition_to_system_disk (const char *os_dev)
          p[sizeof ("i2o/hda") - 1] = '\0';
          return path;
        }
-      
+
       /* If this is a MultiMediaCard (MMC).  */
       if (strncmp ("mmcblk", p, sizeof ("mmcblk") - 1) == 0)
        {
@@ -765,7 +765,7 @@ convert_system_partition_to_system_disk (const char *os_dev)
 
          return path;
        }
-      
+
       /* If this is an IDE, SCSI or Virtio disk.  */
       if (strncmp ("vdisk", p, 5) == 0
          && p[5] >= 'a' && p[5] <= 'z')
@@ -794,7 +794,7 @@ convert_system_partition_to_system_disk (const char *os_dev)
     }
 
   return path;
-  
+
 #elif defined(__GNU__)
   char *path = xstrdup (os_dev);
   if (strncmp ("/dev/sd", path, 7) == 0 || strncmp ("/dev/hd", path, 7) == 0)
@@ -852,7 +852,7 @@ find_system_device (const char *os_dev)
   os_disk = convert_system_partition_to_system_disk (os_dev);
   if (! os_disk)
     return -1;
-  
+
   for (i = 0; i < (int) (sizeof (map) / sizeof (map[0])); i++)
     if (map[i].device && strcmp (map[i].device, os_disk) == 0)
       {
@@ -884,17 +884,17 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
       return 0;
     }
 
-  if (grub_strcmp (os_dev, convert_system_partition_to_system_disk (os_dev)) 
+  if (grub_strcmp (os_dev, convert_system_partition_to_system_disk (os_dev))
       == 0)
     return make_device_name (drive, -1, -1);
-  
+
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
   if (! S_ISCHR (st.st_mode))
 #else
   if (! S_ISBLK (st.st_mode))
 #endif
     return make_device_name (drive, -1, -1);
-  
+
 #if defined(__linux__) || defined(__CYGWIN__)
   /* Linux counts partitions uniformly, whether a BSD partition or a DOS
      partition, so mapping them to GRUB devices is not trivial.
@@ -913,7 +913,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
     int bsd_part = -1;
     auto int find_partition (grub_disk_t disk,
                             const grub_partition_t partition);
-    
+
     int find_partition (grub_disk_t disk __attribute__ ((unused)),
                        const grub_partition_t partition)
       {
@@ -921,7 +921,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
 
        if (strcmp (partition->partmap->name, "pc_partition_map") == 0)
          pcdata = partition->data;
-         
+
        if (pcdata)
          {
            if (pcdata->bsd_part < 0)
@@ -937,7 +937,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
              grub_util_info ("Partition %d starts from %lu",
                              partition->index, partition->start);
          }
-       
+
        if (hdg.start == partition->start)
          {
            if (pcdata)
@@ -952,15 +952,15 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
              }
            return 1;
          }
-       
+
        return 0;
       }
-    
+
     name = make_device_name (drive, -1, -1);
-    
+
     if (MAJOR (st.st_rdev) == FLOPPY_MAJOR)
       return name;
-    
+
     fd = open (os_dev, O_RDONLY);
     if (fd == -1)
       {
@@ -968,7 +968,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
        free (name);
        return 0;
       }
-    
+
     if (ioctl (fd, HDIO_GETGEO, &hdg))
       {
        grub_error (GRUB_ERR_BAD_DEVICE,
@@ -977,28 +977,28 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
        free (name);
        return 0;
       }
-    
+
     close (fd);
 
     grub_util_info ("%s starts from %lu", os_dev, hdg.start);
-    
+
     if (hdg.start == 0 && device_is_wholedisk (os_dev))
       return name;
 
     grub_util_info ("opening the device %s", name);
     disk = grub_disk_open (name);
     free (name);
-    
+
     if (! disk)
       return 0;
-    
+
     grub_partition_iterate (disk, find_partition);
     if (grub_errno != GRUB_ERR_NONE)
       {
        grub_disk_close (disk);
        return 0;
       }
-    
+
     if (dos_part < 0)
       {
        grub_disk_close (disk);
@@ -1006,43 +1006,43 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
                    "cannot find the partition of `%s'", os_dev);
        return 0;
       }
-    
+
     return make_device_name (drive, dos_part, bsd_part);
   }
-  
+
 #elif defined(__GNU__)
   /* GNU uses "/dev/[hs]d[0-9]+(s[0-9]+[a-z]?)?".  */
   {
     char *p;
     int dos_part = -1;
     int bsd_part = -1;
-    
+
     p = strrchr (os_dev, 's');
     if (p)
       {
        long int n;
        char *q;
-       
+
        p++;
        n = strtol (p, &q, 10);
        if (p != q && n != GRUB_LONG_MIN && n != GRUB_LONG_MAX)
          {
            dos_part = (int) n;
-           
+
            if (*q >= 'a' && *q <= 'g')
              bsd_part = *q - 'a';
          }
       }
-    
+
     return make_device_name (drive, dos_part, bsd_part);
   }
-  
+
 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
   /* FreeBSD uses "/dev/[a-z]+[0-9]+(s[0-9]+[a-z]?)?".  */
   {
     int dos_part = -1;
     int bsd_part = -1;
-  
+
     if (strncmp ("/dev/", os_dev, 5) == 0)
       {
         char *p, *q;
@@ -1067,7 +1067,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
               break;
             }
       }
-    
+
     return make_device_name (drive, dos_part, bsd_part);
   }
 
index de3bcd68083308e13f84569b4d4f32128472480c..1b963bb67e4dce19b8f23b44f3a1c57e806ca98c 100644 (file)
@@ -56,8 +56,8 @@ is_dir (const char *path, const char *name)
 #endif
 
 static grub_err_t
-grub_hostfs_dir (grub_device_t device, const char *path, 
-                int (*hook) (const char *filename, 
+grub_hostfs_dir (grub_device_t device, const char *path,
+                int (*hook) (const char *filename,
                              const struct grub_dirhook_info *info))
 {
   DIR *dir;
index 8b8796360045c9f73244fb5031f9426b4f0f73ab..f4203b5a36e5cb3f932b1008183787d93582170a 100644 (file)
@@ -92,7 +92,7 @@ read_kernel_module (const char *dir, size_t *size)
 {
   char *kernel_image;
   char *kernel_path;
-  
+
   kernel_path = grub_util_get_path (dir, "kernel.mod");
   *size = grub_util_get_image_size (kernel_path);
   kernel_image = grub_util_read_image (kernel_path);
@@ -162,7 +162,7 @@ locate_sections (Elf_Shdr *sections, Elf_Half section_entsize,
   Elf_Addr current_address;
   Elf_Addr *section_addresses;
   Elf_Shdr *s;
-  
+
   section_addresses = xmalloc (sizeof (*section_addresses) * num_sections);
   memset (section_addresses, 0, sizeof (*section_addresses) * num_sections);
 
@@ -176,10 +176,10 @@ locate_sections (Elf_Shdr *sections, Elf_Half section_entsize,
       {
        Elf_Word align = grub_le_to_cpu32 (s->sh_addralign);
        const char *name = strtab + grub_le_to_cpu32 (s->sh_name);
-       
+
        if (align)
          current_address = align_address (current_address, align);
-       
+
        grub_util_info ("locating the section %s at 0x%x",
                        name, current_address);
        section_addresses[i] = current_address;
@@ -196,10 +196,10 @@ locate_sections (Elf_Shdr *sections, Elf_Half section_entsize,
       {
        Elf_Word align = grub_le_to_cpu32 (s->sh_addralign);
        const char *name = strtab + grub_le_to_cpu32 (s->sh_name);
-       
+
        if (align)
          current_address = align_address (current_address, align);
-       
+
        grub_util_info ("locating the section %s at 0x%x",
                        name, current_address);
        section_addresses[i] = current_address;
@@ -216,7 +216,7 @@ find_symtab_section (Elf_Shdr *sections,
 {
   int i;
   Elf_Shdr *s;
-  
+
   for (i = 0, s = sections;
        i < num_sections;
        i++, s = (Elf_Shdr *) ((char *) s + section_entsize))
@@ -232,7 +232,7 @@ find_strtab (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Half section_entsize)
 {
   Elf_Shdr *s;
   char *strtab;
-  
+
   s = (Elf_Shdr *) ((char *) sections
                      + grub_le_to_cpu16 (e->e_shstrndx) * section_entsize);
   strtab = (char *) e + grub_le_to_cpu32 (s->sh_offset);
@@ -253,13 +253,13 @@ relocate_symbols (Elf_Ehdr *e, Elf_Shdr *sections,
   Elf_Word i;
   Elf_Shdr *strtab_section;
   const char *strtab;
-  
+
   strtab_section
     = (Elf_Shdr *) ((char *) sections
                      + (grub_le_to_cpu32 (symtab_section->sh_link)
                         * section_entsize));
   strtab = (char *) e + grub_le_to_cpu32 (strtab_section->sh_offset);
-  
+
   symtab_size = grub_le_to_cpu32 (symtab_section->sh_size);
   sym_size = grub_le_to_cpu32 (symtab_section->sh_entsize);
   symtab_offset = grub_le_to_cpu32 (symtab_section->sh_offset);
@@ -271,9 +271,9 @@ relocate_symbols (Elf_Ehdr *e, Elf_Shdr *sections,
     {
       Elf_Section index;
       const char *name;
-      
+
       name = strtab + grub_le_to_cpu32 (sym->st_name);
-      
+
       index = grub_le_to_cpu16 (sym->st_shndx);
       if (index == STN_ABS)
         {
@@ -288,7 +288,7 @@ relocate_symbols (Elf_Ehdr *e, Elf_Shdr *sections,
        }
       else if (index >= num_sections)
        grub_util_error ("section %d does not exist", index);
-      
+
       sym->st_value = (grub_le_to_cpu32 (sym->st_value)
                       + section_addresses[index]);
       grub_util_info ("locating %s at 0x%x", name, sym->st_value);
@@ -306,7 +306,7 @@ static Elf_Addr
 get_symbol_address (Elf_Ehdr *e, Elf_Shdr *s, Elf_Word i)
 {
   Elf_Sym *sym;
-  
+
   sym = (Elf_Sym *) ((char *) e
                       + grub_le_to_cpu32 (s->sh_offset)
                       + i * grub_le_to_cpu32 (s->sh_entsize));
@@ -332,7 +332,7 @@ relocate_addresses (Elf_Ehdr *e, Elf_Shdr *sections,
 {
   Elf_Half i;
   Elf_Shdr *s;
-  
+
   for (i = 0, s = sections;
        i < num_sections;
        i++, s = (Elf_Shdr *) ((char *) s + section_entsize))
@@ -375,7 +375,7 @@ relocate_addresses (Elf_Ehdr *e, Elf_Shdr *sections,
            Elf_Addr sym_addr;
            Elf_Addr *target;
            Elf_Addr addend;
-           
+
            offset = grub_le_to_cpu (r->r_offset);
            target = get_target_address (e, target_section, offset);
            info = grub_le_to_cpu (r->r_info);
@@ -414,7 +414,7 @@ relocate_addresses (Elf_Ehdr *e, Elf_Shdr *sections,
                 break;
 
               case R_X86_64_64:
-               *target = grub_cpu_to_le64 (grub_le_to_cpu64 (*target) 
+               *target = grub_cpu_to_le64 (grub_le_to_cpu64 (*target)
                                            + addend + sym_addr);
                grub_util_info ("relocating an R_X86_64_64 entry to 0x%llx at the offset 0x%llx",
                                *target, offset);
@@ -470,7 +470,7 @@ add_fixup_entry (struct grub_pe32_fixup_block **block, grub_uint16_t type,
                 FILE *out)
 {
   struct grub_pe32_fixup_block *b = *block;
-  
+
   /* First, check if it is necessary to write out the current block.  */
   if (b)
     {
@@ -485,7 +485,7 @@ add_fixup_entry (struct grub_pe32_fixup_block **block, grub_uint16_t type,
              Elf_Addr next_address;
              unsigned padding_size;
               size_t index;
-             
+
              next_address = current_address + b->block_size;
              padding_size = ((align_pe32_section (next_address)
                               - next_address)
@@ -528,7 +528,7 @@ add_fixup_entry (struct grub_pe32_fixup_block **block, grub_uint16_t type,
     {
       grub_uint16_t entry;
       size_t index;
-      
+
       /* If not allocated yet, allocate a block with enough entries.  */
       if (! b)
        {
@@ -559,7 +559,7 @@ static Elf_Addr
 make_header_space (FILE *out)
 {
   Elf_Addr addr;
-  
+
   addr = get_starting_section_address ();
   write_padding (out, addr);
 
@@ -576,7 +576,7 @@ write_text_sections (FILE *out, Elf_Addr current_address,
   Elf_Half i;
   Elf_Shdr *s;
   Elf_Addr addr;
-  
+
   for (i = 0, s = sections;
        i < num_sections;
        i++, s = (Elf_Shdr *) ((char *) s + section_entsize))
@@ -586,7 +586,7 @@ write_text_sections (FILE *out, Elf_Addr current_address,
        Elf_Off offset = grub_le_to_cpu32 (s->sh_offset);
        Elf_Word size = grub_le_to_cpu32 (s->sh_size);
        const char *name = strtab + grub_le_to_cpu32 (s->sh_name);
-       
+
        if (align)
          {
            addr = align_address (current_address, align);
@@ -598,13 +598,13 @@ write_text_sections (FILE *out, Elf_Addr current_address,
                current_address = addr;
              }
          }
-       
+
        grub_util_info ("writing the text section %s at 0x%x",
                        name, current_address);
-       
+
        if (fwrite ((char *) e + offset, size, 1, out) != 1)
          grub_util_error ("write failed");
-       
+
        current_address += size;
       }
 
@@ -615,7 +615,7 @@ write_text_sections (FILE *out, Elf_Addr current_address,
                      addr - current_address);
       write_padding (out, addr - current_address);
     }
-  
+
   return addr;
 }
 
@@ -629,7 +629,7 @@ write_data_sections (FILE *out, Elf_Addr current_address,
   Elf_Half i;
   Elf_Shdr *s;
   Elf_Addr addr;
-  
+
   for (i = 0, s = sections;
        i < num_sections;
        i++, s = (Elf_Shdr *) ((char *) s + section_entsize))
@@ -639,7 +639,7 @@ write_data_sections (FILE *out, Elf_Addr current_address,
        Elf_Off offset = grub_le_to_cpu32 (s->sh_offset);
        Elf_Word size = grub_le_to_cpu32 (s->sh_size);
        const char *name = strtab + grub_le_to_cpu32 (s->sh_name);
-       
+
        if (align)
          {
            addr = align_address (current_address, align);
@@ -651,19 +651,19 @@ write_data_sections (FILE *out, Elf_Addr current_address,
                current_address = addr;
              }
          }
-       
+
        grub_util_info ("writing the data section %s at 0x%x",
                        name, current_address);
-       
+
        if (s->sh_type == grub_cpu_to_le32 (SHT_NOBITS))
          write_padding (out, size);
        else
          if (fwrite ((char *) e + offset, size, 1, out) != 1)
            grub_util_error ("write failed");
-       
+
        current_address += size;
       }
-  
+
   addr = align_pe32_section (current_address);
   if (addr != current_address)
     {
@@ -671,7 +671,7 @@ write_data_sections (FILE *out, Elf_Addr current_address,
                      addr - current_address);
       write_padding (out, addr - current_address);
     }
-  
+
   return addr;
 }
 
@@ -689,7 +689,7 @@ make_mods_section (FILE *out, Elf_Addr current_address,
   memset (&modinfo, 0, sizeof (modinfo));
 
   path_list = grub_util_resolve_dependencies (dir, "moddep.lst", mods);
-  
+
   total_module_size = sizeof (struct grub_module_info);
   for (p = path_list; p; p = p->next)
     {
@@ -711,15 +711,15 @@ make_mods_section (FILE *out, Elf_Addr current_address,
       struct grub_module_header header;
       size_t mod_size;
       char *mod_image;
-      
+
       memset (&header, 0, sizeof (header));
-      
+
       grub_util_info ("adding module %s", p->name);
-      
+
       mod_size = grub_util_get_image_size (p->name);
       header.type = grub_cpu_to_le32 (OBJ_TYPE_ELF);
       header.size = grub_cpu_to_le32 (mod_size + sizeof (header));
-      
+
       mod_image = grub_util_read_image (p->name);
 
       if (fwrite (&header, sizeof (header), 1, out) != 1
@@ -728,7 +728,7 @@ make_mods_section (FILE *out, Elf_Addr current_address,
 
       free (mod_image);
     }
-  
+
   for (p = path_list; p; )
     {
       struct grub_util_path_list *q;
@@ -737,9 +737,9 @@ make_mods_section (FILE *out, Elf_Addr current_address,
       free (p);
       p = q;
     }
-      
+
   current_address += total_module_size;
-  
+
   addr = align_pe32_section (current_address);
   if (addr != current_address)
     {
@@ -761,7 +761,7 @@ make_reloc_section (FILE *out, Elf_Addr current_address, Elf_Ehdr *e,
   Elf_Half i;
   Elf_Shdr *s;
   struct grub_pe32_fixup_block *fixup_block = 0;
-  
+
   for (i = 0, s = sections;
        i < num_sections;
        i++, s = (Elf_Shdr *) ((char *) s + section_entsize))
@@ -773,15 +773,15 @@ make_reloc_section (FILE *out, Elf_Addr current_address, Elf_Ehdr *e,
        Elf_Off rtab_offset;
        Elf_Addr section_address;
        Elf_Word j;
-       
+
        grub_util_info ("translating the relocation section %s",
                        strtab + grub_le_to_cpu32 (s->sh_name));
-                       
+
        rtab_size = grub_le_to_cpu32 (s->sh_size);
        r_size = grub_le_to_cpu32 (s->sh_entsize);
        rtab_offset = grub_le_to_cpu32 (s->sh_offset);
        num_rs = rtab_size / r_size;
-       
+
        section_address = section_addresses[grub_le_to_cpu32 (s->sh_info)];
 
        for (j = 0, r = (Elf_Rel *) ((char *) e + rtab_offset);
@@ -888,7 +888,7 @@ make_header (FILE *out, Elf_Addr text_address, Elf_Addr data_address,
   o->image_size = grub_cpu_to_le32 (end_address);
   o->header_size = grub_cpu_to_le32 (text_address);
   o->subsystem = grub_cpu_to_le16 (GRUB_PE32_SUBSYSTEM_EFI_APPLICATION);
-  
+
   /* Do these really matter? */
   o->stack_reserve_size = grub_cpu_to_le32 (0x10000);
   o->stack_commit_size = grub_cpu_to_le32 (0x10000);
@@ -896,7 +896,7 @@ make_header (FILE *out, Elf_Addr text_address, Elf_Addr data_address,
   o->heap_commit_size = grub_cpu_to_le32 (0x10000);
 
   o->num_data_directories = grub_cpu_to_le32 (GRUB_PE32_NUM_DATA_DIRECTORIES);
-  
+
   o->base_relocation_table.rva = grub_cpu_to_le32 (reloc_address);
   o->base_relocation_table.size = grub_cpu_to_le32 (end_address
                                                    - reloc_address);
@@ -982,7 +982,7 @@ convert_elf (const char *dir, char *prefix, FILE *out, char *mods[])
   e = (Elf_Ehdr *) kernel_image;
   if (! check_elf_header (e, kernel_size))
     grub_util_error ("invalid ELF header");
-  
+
   section_offset = grub_cpu_to_le32 (e->e_shoff);
   section_entsize = grub_cpu_to_le16 (e->e_shentsize);
   num_sections = grub_cpu_to_le16 (e->e_shnum);
@@ -1002,20 +1002,20 @@ convert_elf (const char *dir, char *prefix, FILE *out, char *mods[])
 
          if (GRUB_KERNEL_MACHINE_PREFIX + strlen (prefix) + 1 > GRUB_KERNEL_MACHINE_DATA_END)
            grub_util_error ("prefix too long");
-         
+
          strcpy (kernel_image + offset + GRUB_KERNEL_MACHINE_PREFIX, prefix);
          break;
       }
-       
+
   /* Relocate sections then symbols in the virtual address space.  */
   section_addresses = locate_sections (sections, section_entsize,
                                       num_sections, strtab);
-  
+
   symtab_section = find_symtab_section (sections,
                                        section_entsize, num_sections);
   if (! symtab_section)
     grub_util_error ("no symbol table");
-  
+
   start_address = relocate_symbols (e, sections, symtab_section,
                                    section_addresses, section_entsize,
                                    num_sections);
index 1bdddac4dcf8d8d48d72d9c906273836ebdf5769..b10768eef2b8abf7f54f9e78eaeb998c6cfb4ce2 100644 (file)
@@ -58,11 +58,11 @@ compress_kernel (char *kernel_img, size_t kernel_size,
 {
   lzo_uint size;
   char *wrkmem;
-  
+
   grub_util_info ("kernel_img=%p, kernel_size=0x%x", kernel_img, kernel_size);
   if (kernel_size < GRUB_KERNEL_MACHINE_RAW_SIZE)
     grub_util_error ("the core image is too small");
-  
+
   if (lzo_init () != LZO_E_OK)
     grub_util_error ("cannot initialize LZO");
 
@@ -70,7 +70,7 @@ compress_kernel (char *kernel_img, size_t kernel_size,
   wrkmem = xmalloc (LZO1X_999_MEM_COMPRESS);
 
   memcpy (*core_img, kernel_img, GRUB_KERNEL_MACHINE_RAW_SIZE);
-  
+
   grub_util_info ("compressing the core image");
   if (lzo1x_999_compress ((const lzo_byte *) (kernel_img
                                              + GRUB_KERNEL_MACHINE_RAW_SIZE),
@@ -189,7 +189,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
       size_t mod_size;
 
       mod_size = grub_util_get_image_size (p->name);
-      
+
       header = (struct grub_module_header *) (kernel_img + offset);
       header->type = grub_cpu_to_le32 (OBJ_TYPE_ELF);
       header->size = grub_cpu_to_le32 (mod_size + sizeof (*header));
@@ -202,7 +202,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
   if (memdisk_path)
     {
       struct grub_module_header *header;
-      
+
       header = (struct grub_module_header *) (kernel_img + offset);
       header->type = grub_cpu_to_le32 (OBJ_TYPE_MEMDISK);
       header->size = grub_cpu_to_le32 (memdisk_size + sizeof (*header));
@@ -230,7 +230,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
                   &core_img, &core_size);
 
   grub_util_info ("the core size is 0x%x", core_size);
-  
+
   num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
   if (num > 0xffff)
     grub_util_error ("the core image is too big");
@@ -239,9 +239,9 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
   boot_size = grub_util_get_image_size (boot_path);
   if (boot_size != GRUB_DISK_SECTOR_SIZE)
     grub_util_error ("diskboot.img is not one sector size");
-  
+
   boot_img = grub_util_read_image (boot_path);
-  
+
   /* i386 is a little endian architecture.  */
   *((grub_uint16_t *) (boot_img + GRUB_DISK_SECTOR_SIZE
                       - GRUB_BOOT_MACHINE_LIST_SIZE + 8))
@@ -250,7 +250,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
   grub_util_write_image (boot_img, boot_size, out);
   free (boot_img);
   free (boot_path);
-  
+
   module_addr = (path_list
                 ? (GRUB_BOOT_MACHINE_KERNEL_ADDR + GRUB_DISK_SECTOR_SIZE
                    + kernel_size)
@@ -277,7 +277,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
   if (core_size > GRUB_MEMORY_MACHINE_UPPER - GRUB_MEMORY_MACHINE_LINK_ADDR)
     grub_util_error ("Core image is too big (%p > %p)\n", core_size,
                     GRUB_MEMORY_MACHINE_UPPER - GRUB_MEMORY_MACHINE_LINK_ADDR);
-  
+
   grub_util_write_image (core_img, core_size, out);
   free (kernel_img);
   free (core_img);
@@ -344,7 +344,7 @@ main (int argc, char *argv[])
   FILE *fp = stdout;
 
   progname = "grub-mkimage";
-  
+
   while (1)
     {
       int c = getopt_long (argc, argv, "d:p:m:c:o:hVv", options, 0);
@@ -357,7 +357,7 @@ main (int argc, char *argv[])
          case 'o':
            if (output)
              free (output);
-           
+
            output = xstrdup (optarg);
            break;
 
@@ -373,7 +373,7 @@ main (int argc, char *argv[])
              free (memdisk);
 
            memdisk = xstrdup (optarg);
-       
+
            if (prefix)
              free (prefix);
 
index 997811bb99e9bdd069e8ef1e252894fc76844be7..bdf234c645513ef88867634eeb189814462e0ae9 100644 (file)
@@ -110,7 +110,7 @@ setup (const char *dir,
   FILE *fp;
   struct { grub_uint64_t start; grub_uint64_t end; } embed_region;
   embed_region.start = embed_region.end = ~0UL;
-  
+
   auto void NESTED_FUNC_ATTR save_first_sector (grub_disk_addr_t sector, unsigned offset,
                               unsigned length);
   auto void NESTED_FUNC_ATTR save_blocklists (grub_disk_addr_t sector, unsigned offset,
@@ -122,44 +122,44 @@ setup (const char *dir,
                                                 const grub_partition_t p)
     {
       struct grub_pc_partition *pcdata = p->data;
-      
+
       /* There's always an embed region, and it starts right after the MBR.  */
       embed_region.start = 1;
-      
+
       /* For its end offset, include as many dummy partitions as we can.  */
       if (! grub_pc_partition_is_empty (pcdata->dos_type)
          && ! grub_pc_partition_is_bsd (pcdata->dos_type)
          && embed_region.end > p->start)
        embed_region.end = p->start;
-      
+
       return 1;
     }
-  
+
   auto int NESTED_FUNC_ATTR find_usable_region_gpt (grub_disk_t disk,
                                                    const grub_partition_t p);
   int NESTED_FUNC_ATTR find_usable_region_gpt (grub_disk_t disk __attribute__ ((unused)),
                                               const grub_partition_t p)
     {
       struct grub_gpt_partentry *gptdata = p->data;
-      
+
       /* If there's an embed region, it is in a dedicated partition.  */
       if (! memcmp (&gptdata->type, &grub_gpt_partition_type_bios_boot, 16))
        {
          embed_region.start = p->start;
          embed_region.end = p->start + p->len;
-         
+
          return 1;
        }
-      
+
       return 0;
     }
-  
+
   void NESTED_FUNC_ATTR save_first_sector (grub_disk_addr_t sector, unsigned offset,
                          unsigned length)
     {
       grub_util_info ("the first sector is <%llu,%u,%u>",
                      sector, offset, length);
-      
+
       if (offset != 0 || length != GRUB_DISK_SECTOR_SIZE)
        grub_util_error ("The first sector of the core file is not sector-aligned");
 
@@ -173,7 +173,7 @@ setup (const char *dir,
 
       grub_util_info ("saving <%llu,%u,%u> with the segment 0x%x",
                      sector, offset, length, (unsigned) current_segment);
-      
+
       if (offset != 0 || last_length != GRUB_DISK_SECTOR_SIZE)
        grub_util_error ("Non-sector-aligned data is found in the core file");
 
@@ -191,11 +191,11 @@ setup (const char *dir,
          if (block->len)
            grub_util_error ("The sectors of the core file are too fragmented");
        }
-      
+
       last_length = length;
       current_segment += GRUB_DISK_SECTOR_SIZE >> 4;
     }
-  
+
   /* Read the boot image by the OS service.  */
   boot_path = grub_util_get_path (dir, boot_file);
   boot_size = grub_util_get_image_size (boot_path);
@@ -212,7 +212,7 @@ setup (const char *dir,
                                     + GRUB_BOOT_MACHINE_KERNEL_SECTOR);
   boot_drive_check = (grub_uint16_t *) (boot_img
                                        + GRUB_BOOT_MACHINE_DRIVE_CHECK);
-  
+
   core_path = grub_util_get_path (dir, core_file);
   core_size = grub_util_get_image_size (core_path);
   core_sectors = ((core_size + GRUB_DISK_SECTOR_SIZE - 1)
@@ -221,7 +221,7 @@ setup (const char *dir,
     grub_util_error ("The size of `%s' is too small", core_path);
   else if (core_size > 0xFFFF * GRUB_DISK_SECTOR_SIZE)
     grub_util_error ("The size of `%s' is too large", core_path);
-  
+
   core_img = grub_util_read_image (core_path);
 
   /* Have FIRST_BLOCK to point to the first blocklist.  */
@@ -264,7 +264,7 @@ setup (const char *dir,
            GRUB_BOOT_MACHINE_PART_END - GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC);
 
   free (tmp_img);
-  
+
   /* If DEST_DRIVE is a hard disk, enable the workaround, which is
      for buggy BIOSes which don't pass boot drive correctly. Instead,
      they pass 0x00 or 0x01 even when booted from 0x80.  */
@@ -304,7 +304,7 @@ setup (const char *dir,
       dos_part = grub_le_to_cpu32 (*install_dos_part);
       bsd_part = grub_le_to_cpu32 (*install_bsd_part);
     }
-  
+
   grub_util_info ("dos partition is %d, bsd partition is %d",
                  dos_part, bsd_part);
 
@@ -319,7 +319,7 @@ setup (const char *dir,
       grub_util_warn ("Attempting to install GRUB to a partition instead of the MBR.  This is a BAD idea.");
       goto unable_to_embed;
     }
-  
+
   /* Unlike root_dev, with dest_dev we're interested in the partition map even
      if dest_dev itself is a whole disk.  */
   auto int NESTED_FUNC_ATTR identify_partmap (grub_disk_t disk,
@@ -331,7 +331,7 @@ setup (const char *dir,
       return 1;
     }
   grub_partition_iterate (dest_dev->disk, identify_partmap);
-  
+
   grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, "pc_partition_map") ?
                                           find_usable_region_gpt : find_usable_region_msdos));
   if (embed_region.end == embed_region.start)
@@ -356,69 +356,69 @@ setup (const char *dir,
 
 
   grub_util_info ("will embed the core image at sector 0x%llx", embed_region.start);
-  
+
   *install_dos_part = grub_cpu_to_le32 (dos_part);
   *install_bsd_part = grub_cpu_to_le32 (bsd_part);
-  
+
   /* The first blocklist contains the whole sectors.  */
   first_block->start = grub_cpu_to_le64 (embed_region.start + 1);
   first_block->len = grub_cpu_to_le16 (core_sectors - 1);
   first_block->segment
     = grub_cpu_to_le16 (GRUB_BOOT_MACHINE_KERNEL_SEG
                        + (GRUB_DISK_SECTOR_SIZE >> 4));
-  
+
   /* Make sure that the second blocklist is a terminator.  */
   block = first_block - 1;
   block->start = 0;
   block->len = 0;
   block->segment = 0;
-  
+
   /* Write the core image onto the disk.  */
   if (grub_disk_write (dest_dev->disk, embed_region.start, 0, core_size, core_img))
     grub_util_error ("%s", grub_errmsg);
-  
+
   /* FIXME: can this be skipped?  */
   *boot_drive = 0xFF;
   *root_drive = 0xFF;
-  
+
   *kernel_sector = grub_cpu_to_le64 (embed_region.start);
-  
+
   /* Write the boot image onto the disk.  */
   if (grub_disk_write (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE,
                       boot_img))
     grub_util_error ("%s", grub_errmsg);
-  
+
   goto finish;
-  
+
 unable_to_embed:
-  
+
   if (must_embed)
     grub_util_error ("Embedding is not possible, but this is required when "
                     "the root device is on a RAID array or LVM volume.");
-  
+
   grub_util_warn ("Embedding is not possible.  GRUB can only be installed in this "
                  "setup by using blocklists.  However, blocklists are UNRELIABLE and "
                  "its use is discouraged.");
   if (! force)
     grub_util_error ("If you really want blocklists, use --force.");
-  
+
   /* Make sure that GRUB reads the identical image as the OS.  */
   tmp_img = xmalloc (core_size);
   core_path_dev = grub_util_get_path (dir, core_file);
-  
+
   /* It is a Good Thing to sync two times.  */
   sync ();
   sync ();
 
 #define MAX_TRIES      5
-  
+
   for (i = 0; i < MAX_TRIES; i++)
     {
       grub_util_info ("attempting to read the core image `%s' from GRUB%s",
                      core_path_dev, (i == 0) ? "" : " again");
-      
+
       grub_disk_cache_invalidate_all ();
-      
+
       file = grub_file_open (core_path_dev);
       if (file)
        {
@@ -434,7 +434,7 @@ unable_to_embed:
 #if 0
              FILE *dump;
              FILE *dump2;
-             
+
              dump = fopen ("dump.img", "wb");
              if (dump)
                {
@@ -448,8 +448,8 @@ unable_to_embed:
                  fwrite (core_img, 1, core_size, dump2);
                  fclose (dump2);
                }
-             
-#endif      
+
+#endif
              grub_util_info ("succeeded in opening the core image but the data is different");
            }
          else
@@ -465,7 +465,7 @@ unable_to_embed:
 
       if (grub_errno)
        grub_util_info ("error message = %s", grub_errmsg);
-      
+
       grub_errno = GRUB_ERR_NONE;
       sync ();
       sleep (1);
@@ -483,16 +483,16 @@ unable_to_embed:
       block->segment = 0;
 
       block--;
-      
+
       if ((char *) block <= core_img)
        grub_util_error ("No terminator in the core image");
     }
-  
+
   /* Now read the core image to determine where the sectors are.  */
   file = grub_file_open (core_path_dev);
   if (! file)
     grub_util_error ("%s", grub_errmsg);
-  
+
   file->read_hook = save_first_sector;
   if (grub_file_read (file, tmp_img, GRUB_DISK_SECTOR_SIZE)
       != GRUB_DISK_SECTOR_SIZE)
@@ -505,10 +505,10 @@ unable_to_embed:
     grub_util_error ("Failed to read the rest sectors of the core image");
 
   grub_file_close (file);
-  
+
   free (core_path_dev);
   free (tmp_img);
-  
+
   *kernel_sector = grub_cpu_to_le64 (first_sector);
 
   /* FIXME: can this be skipped?  */
@@ -535,7 +535,7 @@ unable_to_embed:
 
   /* Sync is a Good Thing.  */
   sync ();
-  
+
   free (core_path);
   free (core_img);
   free (boot_img);
@@ -591,7 +591,7 @@ static char *
 get_device_name (char *dev)
 {
   size_t len = strlen (dev);
-  
+
   if (dev[0] != '(' || dev[len - 1] != ')')
     return 0;
 
@@ -609,7 +609,7 @@ main (int argc, char *argv[])
   char *root_dev = 0;
   char *dest_dev;
   int must_embed = 0, force = 0;
-  
+
   progname = "grub-setup";
 
   /* Check for options.  */
@@ -642,7 +642,7 @@ main (int argc, char *argv[])
 
            dir = xstrdup (optarg);
            break;
-           
+
          case 'm':
            if (dev_map)
              free (dev_map);
@@ -656,7 +656,7 @@ main (int argc, char *argv[])
 
            root_dev = xstrdup (optarg);
            break;
-           
+
          case 'f':
            force = 1;
            break;
@@ -700,7 +700,7 @@ main (int argc, char *argv[])
 
   /* Initialize all modules. */
   grub_init_all ();
-  
+
   dest_dev = get_device_name (argv[optind]);
   if (! dest_dev)
     {
@@ -722,7 +722,7 @@ main (int argc, char *argv[])
 
       if (! tmp)
        grub_util_error ("Invalid root device `%s'", root_dev);
-      
+
       tmp = xstrdup (tmp);
       free (root_dev);
       root_dev = tmp;
@@ -741,7 +741,7 @@ main (int argc, char *argv[])
 #ifdef __linux__
   if (grub_util_lvm_isvolume (root_dev))
     must_embed = 1;
-  
+
   if (root_dev[0] == 'm' && root_dev[1] == 'd'
       && root_dev[2] >= '0' && root_dev[2] <= '9')
     {
@@ -776,13 +776,13 @@ main (int argc, char *argv[])
   /* Free resources.  */
   grub_fini_all ();
   grub_util_biosdisk_fini ();
-  
+
   free (boot_file);
   free (core_file);
   free (dir);
   free (dev_map);
   free (root_dev);
   free (dest_dev);
-  
+
   return 0;
 }
index edd31b0a4da22c3ec7b0487abc81022e0d1b9b6c..8a8ed1e4cc290860c8665f5b81dfa37258c1dc01 100644 (file)
@@ -32,7 +32,7 @@ grub_util_lvm_isvolume (char *name)
   char *devname;
   struct stat st;
   int err;
-  
+
   devname = xmalloc (strlen (name) + 13);
 
   strcpy (devname, "/dev/mapper/");
index edfcc813a35fbe402c08065898f5becf69927ec9..939867b7f181ffe7d6943a356e0f606814ab08e8 100644 (file)
@@ -55,7 +55,7 @@ void
 grub_util_warn (const char *fmt, ...)
 {
   va_list ap;
-  
+
   fprintf (stderr, "%s: warn: ", progname);
   va_start (ap, fmt);
   vfprintf (stderr, fmt, ap);
@@ -70,7 +70,7 @@ grub_util_info (const char *fmt, ...)
   if (verbosity > 0)
     {
       va_list ap;
-      
+
       fprintf (stderr, "%s: info: ", progname);
       va_start (ap, fmt);
       vfprintf (stderr, fmt, ap);
@@ -84,7 +84,7 @@ void
 grub_util_error (const char *fmt, ...)
 {
   va_list ap;
-  
+
   fprintf (stderr, "%s: error: ", progname);
   va_start (ap, fmt);
   vfprintf (stderr, fmt, ap);
@@ -98,7 +98,7 @@ grub_err_printf (const char *fmt, ...)
 {
   va_list ap;
   int ret;
-  
+
   va_start (ap, fmt);
   ret = vfprintf (stderr, fmt, ap);
   va_end (ap);
@@ -110,7 +110,7 @@ void *
 xmalloc (size_t size)
 {
   void *p;
-  
+
   p = malloc (size);
   if (! p)
     grub_util_error ("out of memory");
@@ -133,7 +133,7 @@ xstrdup (const char *str)
 {
   size_t len;
   char *dup;
-  
+
   len = strlen (str);
   dup = (char *) xmalloc (len + 1);
   memcpy (dup, str, len + 1);
@@ -145,7 +145,7 @@ char *
 grub_util_get_path (const char *dir, const char *file)
 {
   char *path;
-  
+
   path = (char *) xmalloc (strlen (dir) + 1 + strlen (file) + 1);
   sprintf (path, "%s/%s", dir, file);
   return path;
@@ -155,13 +155,13 @@ size_t
 grub_util_get_fp_size (FILE *fp)
 {
   struct stat st;
-  
+
   if (fflush (fp) == EOF)
     grub_util_error ("fflush failed");
 
   if (fstat (fileno (fp), &st) == -1)
     grub_util_error ("fstat failed");
-  
+
   return st.st_size;
 }
 
@@ -169,12 +169,12 @@ size_t
 grub_util_get_image_size (const char *path)
 {
   struct stat st;
-  
+
   grub_util_info ("getting the size of %s", path);
-  
+
   if (stat (path, &st) == -1)
     grub_util_error ("cannot stat %s", path);
-  
+
   return st.st_size;
 }
 
@@ -194,7 +194,7 @@ grub_util_read_image (const char *path)
   char *img;
   FILE *fp;
   size_t size;
-  
+
   grub_util_info ("reading %s", path);
 
   size = grub_util_get_image_size (path);
@@ -207,7 +207,7 @@ grub_util_read_image (const char *path)
   grub_util_read_at (img, size, 0, fp);
 
   fclose (fp);
-  
+
   return img;
 }
 
@@ -216,11 +216,11 @@ grub_util_load_image (const char *path, char *buf)
 {
   FILE *fp;
   size_t size;
-  
+
   grub_util_info ("reading %s", path);
 
   size = grub_util_get_image_size (path);
-  
+
   fp = fopen (path, "rb");
   if (! fp)
     grub_util_error ("cannot open %s", path);
@@ -282,10 +282,10 @@ grub_memalign (grub_size_t align, grub_size_t size)
   (void) size;
   grub_util_error ("grub_memalign is not supported");
 #endif
-  
+
   if (! p)
     grub_util_error ("out of memory");
-  
+
   return p;
 }
 
@@ -313,7 +313,7 @@ grub_get_rtc (void)
   struct timeval tv;
 
   gettimeofday (&tv, 0);
-  
+
   return (tv.tv_sec * GRUB_TICKS_PER_SECOND
          + (((tv.tv_sec % GRUB_TICKS_PER_SECOND) * 1000000 + tv.tv_usec)
             * GRUB_TICKS_PER_SECOND / 1000000));
@@ -325,7 +325,7 @@ grub_get_time_ms (void)
   struct timeval tv;
 
   gettimeofday (&tv, 0);
-  
+
   return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
 }
 
@@ -351,7 +351,7 @@ grub_millisleep (grub_uint32_t ms)
 
 #endif
 
-void 
+void
 grub_arch_sync_caches (void *address __attribute__ ((unused)),
                       grub_size_t len __attribute__ ((unused)))
 {
index ad6e407f25c1f1b6932a8767999de3bcae87d5db..83a0ee6e2e8a7532f071fb2ff76b68a3a8339279 100644 (file)
@@ -51,7 +51,7 @@ grub_util_getdiskname (int major, int minor)
     sprintf (name, "/dev/sd%c", 'a' + minor / 16);
   else
     grub_util_error ("Unknown device number: %d, %d", major, minor);
-    
+
   return name;
 }
 
@@ -83,7 +83,7 @@ grub_util_raid_getmembers (char *name)
   if (version.major != 0 || version.minor != 90)
     grub_util_error ("Unsupported RAID version: %d.%d",
                     version.major, version.minor);
-  
+
   ret = ioctl (fd, GET_ARRAY_INFO, &info);
   if (ret != 0)
     grub_util_error ("ioctl GET_ARRAY_INFO error: %s", strerror (errno));
@@ -105,7 +105,7 @@ grub_util_raid_getmembers (char *name)
     }
 
   devicelist[j] = NULL;
-  
+
   return devicelist;
 }
 
index c79f3c10411620c8a99319d2931054456e8c2dcf..8b33beba024331d0c52dbf6a54cd651ef0d5a495 100644 (file)
@@ -75,7 +75,7 @@ static struct dep_list *
 read_dep_list (FILE *fp)
 {
   struct dep_list *dep_list = 0;
-  
+
   while (fgets (buf, sizeof (buf), fp))
     {
       char *p;
@@ -91,7 +91,7 @@ read_dep_list (FILE *fp)
       dep = xmalloc (sizeof (*dep));
       dep->name = xstrdup (buf);
       dep->list = 0;
-      
+
       dep->next = dep_list;
       dep_list = dep;
 
@@ -115,7 +115,7 @@ read_dep_list (FILE *fp)
            p++;
 
          *p++ = '\0';
-         
+
          mod = (struct mod_list *) xmalloc (sizeof (*mod));
          mod->name = xstrdup (name);
          mod->next = dep->list;
@@ -131,7 +131,7 @@ get_module_name (const char *str)
 {
   char *base;
   char *ext;
-  
+
   base = strrchr (str, '/');
   if (! base)
     base = (char *) str;
@@ -142,13 +142,13 @@ get_module_name (const char *str)
   if (ext && strcmp (ext, ".mod") == 0)
     {
       char *name;
-      
+
       name = xmalloc (ext - base + 1);
       memcpy (name, base, ext - base);
       name[ext - base] = '\0';
       return name;
     }
-  
+
   return xstrdup (base);
 }
 
@@ -159,7 +159,7 @@ get_module_path (const char *prefix, const char *str)
   char *base;
   char *ext;
   char *ret;
-  
+
   ext = strrchr (str, '.');
   if (ext && strcmp (ext, ".mod") == 0)
     base = xstrdup (str);
@@ -168,7 +168,7 @@ get_module_path (const char *prefix, const char *str)
       base = xmalloc (strlen (str) + 4 + 1);
       sprintf (base, "%s.mod", str);
     }
-  
+
   dir = strchr (str, '/');
   if (dir)
     return base;
@@ -189,7 +189,7 @@ add_module (const char *dir,
   struct grub_util_path_list *path;
   struct mod_list *mod;
   struct dep_list *dep;
-  
+
   mod_name = get_module_name (name);
 
   /* Check if the module has already been added.  */
index 744ad86c9485b96d8ed7759c1f3353f23ad5e399..e1d8c71bb846b413e7fdcaf572133de7abdf5f70 100644 (file)
@@ -82,7 +82,7 @@ grub_libusb_init (void)
   if (grub_libusb_devices ())
     return grub_errno;
 
-  grub_usb_controller_dev_register (&usb_controller);  
+  grub_usb_controller_dev_register (&usb_controller);
 
   return 0;
 }
index 8fda511667d16cdb379d9e6eba2ea3190242e707..d399fd72bc5b862dfb7610d7863be9caa4e78ea5 100644 (file)
@@ -50,7 +50,7 @@ grub_video_bitmap_reader_unregister (grub_video_bitmap_reader_t reader)
 
 /* Creates new bitmap, saves created bitmap on success to *bitmap.  */
 grub_err_t
-grub_video_bitmap_create (struct grub_video_bitmap **bitmap, 
+grub_video_bitmap_create (struct grub_video_bitmap **bitmap,
                           unsigned int width, unsigned int height,
                           enum grub_video_blit_format blit_format)
 {
@@ -79,7 +79,7 @@ grub_video_bitmap_create (struct grub_video_bitmap **bitmap,
   switch (blit_format)
     {
       case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
-        mode_info->mode_type = GRUB_VIDEO_MODE_TYPE_RGB 
+        mode_info->mode_type = GRUB_VIDEO_MODE_TYPE_RGB
                                | GRUB_VIDEO_MODE_TYPE_ALPHA;
         mode_info->bpp = 32;
         mode_info->bytes_per_pixel = 4;
@@ -137,7 +137,7 @@ grub_video_bitmap_create (struct grub_video_bitmap **bitmap,
   /* Calculate size needed for the data.  */
   size = (width * mode_info->bytes_per_pixel) * height;
 
-  (*bitmap)->data = grub_malloc (size);  
+  (*bitmap)->data = grub_malloc (size);
   if (! (*bitmap)->data)
     {
       grub_free (*bitmap);
@@ -185,7 +185,7 @@ match_extension (const char *filename, const char *ext)
 
 /* Loads bitmap using registered bitmap readers.  */
 grub_err_t
-grub_video_bitmap_load (struct grub_video_bitmap **bitmap, 
+grub_video_bitmap_load (struct grub_video_bitmap **bitmap,
                         const char *filename)
 {
   grub_video_bitmap_reader_t reader = bitmap_readers_list;
index cdaa7dda922dabecb273a00d4ed3278e73b7d3d8..3e31e4477f34d28cacd8cf3c6e348c0103178f98 100644 (file)
@@ -327,7 +327,7 @@ grub_video_reader_tga (struct grub_video_bitmap **bitmap,
      not going to support developer area & extensions at this point.  */
 
   /* Read TGA header from beginning of file.  */
-  if (grub_file_read (file, (char*)&header, sizeof (header)) 
+  if (grub_file_read (file, (char*)&header, sizeof (header))
       != sizeof (header))
     {
       grub_file_close (file);
@@ -460,7 +460,7 @@ grub_cmd_tgatest (struct grub_arg_list *state __attribute__ ((unused)),
   if (argc != 1)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
 
-  grub_video_reader_tga (&bitmap, args[0]);  
+  grub_video_reader_tga (&bitmap, args[0]);
   if (grub_errno != GRUB_ERR_NONE)
     return grub_errno;
 
index 2c7f12b9efddc49b504ab86ee8f4bd3d88ac9294..c22947b63ee2b64037d442dc9d654202f01387d5 100644 (file)
@@ -402,7 +402,7 @@ grub_video_set_mode (char *modestring,
   next_mode = modevar;
 
   if (! modevar)
-    return grub_error (GRUB_ERR_OUT_OF_MEMORY, 
+    return grub_error (GRUB_ERR_OUT_OF_MEMORY,
                       "couldn't allocate space for local modevar copy");
 
   if (grub_memcmp (next_mode, "keep", sizeof ("keep")) == 0
@@ -412,7 +412,7 @@ grub_video_set_mode (char *modestring,
       struct grub_video_mode_info mode_info;
       int suitable = 1;
       grub_err_t err;
-      
+
       grub_memset (&mode_info, 0, sizeof (mode_info));
 
       if (grub_video_adapter_active)
@@ -438,11 +438,11 @@ grub_video_set_mode (char *modestring,
       if (! *next_mode)
        {
          grub_free (modevar);
-  
+
          return grub_error (GRUB_ERR_BAD_ARGUMENT,
                             "No suitable mode found.");
        }
-      
+
       /* Skip separator. */
       next_mode++;
     }
@@ -454,23 +454,23 @@ grub_video_set_mode (char *modestring,
       grub_video_adapter_active->fini ();
       if (grub_errno != GRUB_ERR_NONE)
        grub_errno = GRUB_ERR_NONE;
-      
+
       /* Mark active adapter as not set.  */
       grub_video_adapter_active = 0;
     }
-    
+
   /* Loop until all modes has been tested out.  */
   while (next_mode != NULL)
     {
       /* Use last next_mode as current mode.  */
       tmp = next_mode;
-      
+
       /* Reset video mode settings.  */
       width = -1;
       height = -1;
       depth = -1;
       flags = 0;
-      
+
       /* Save position of next mode and separate modes.  */
       for (; *next_mode; next_mode++)
        if (*next_mode == ',' || *next_mode == ';')
@@ -482,22 +482,22 @@ grub_video_set_mode (char *modestring,
        }
       else
        next_mode = 0;
-      
+
       /* Skip whitespace.  */
       while (grub_isspace (*tmp))
        tmp++;
-      
+
       /* Initialize token holders.  */
       current_mode = tmp;
       param = tmp;
       value = NULL;
 
-      /* XXX: we assume that we're in pure text mode if 
+      /* XXX: we assume that we're in pure text mode if
         no video mode is initialized. Is it always true? */
       if (grub_strcmp (param, "text") == 0)
        {
          struct grub_video_mode_info mode_info;
-         
+
          grub_memset (&mode_info, 0, sizeof (mode_info));
          mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_PURE_TEXT;
 
@@ -515,44 +515,44 @@ grub_video_set_mode (char *modestring,
        }
 
       /* Parse <width>x<height>[x<depth>]*/
-      
+
       /* Find width value.  */
       value = param;
       param = grub_strchr(param, 'x');
       if (param == NULL)
        {
          grub_err_t rc;
-          
+
          /* First setup error message.  */
          rc = grub_error (GRUB_ERR_BAD_ARGUMENT,
                           "Invalid mode: %s\n",
                           current_mode);
-          
+
          /* Free memory before returning.  */
          grub_free (modevar);
-         
+
          return rc;
        }
-      
+
       *param = 0;
       param++;
-      
+
       width = grub_strtoul (value, 0, 0);
       if (grub_errno != GRUB_ERR_NONE)
        {
          grub_err_t rc;
-          
+
          /* First setup error message.  */
          rc = grub_error (GRUB_ERR_BAD_ARGUMENT,
                           "Invalid mode: %s\n",
                           current_mode);
-         
+
          /* Free memory before returning.  */
          grub_free (modevar);
-          
+
          return rc;
        }
-      
+
       /* Find height value.  */
       value = param;
       param = grub_strchr(param, 'x');
@@ -562,15 +562,15 @@ grub_video_set_mode (char *modestring,
          if (grub_errno != GRUB_ERR_NONE)
            {
              grub_err_t rc;
-             
+
              /* First setup error message.  */
              rc = grub_error (GRUB_ERR_BAD_ARGUMENT,
                               "Invalid mode: %s\n",
                               current_mode);
-             
+
              /* Free memory before returning.  */
              grub_free (modevar);
-             
+
              return rc;
            }
        }
@@ -579,35 +579,35 @@ grub_video_set_mode (char *modestring,
          /* We have optional color depth value.  */
          *param = 0;
          param++;
-         
+
          height = grub_strtoul (value, 0, 0);
          if (grub_errno != GRUB_ERR_NONE)
            {
              grub_err_t rc;
-             
+
              /* First setup error message.  */
              rc = grub_error (GRUB_ERR_BAD_ARGUMENT,
                               "Invalid mode: %s\n",
                               current_mode);
-             
+
              /* Free memory before returning.  */
              grub_free (modevar);
-             
+
              return rc;
            }
-         
+
          /* Convert color depth value.  */
          value = param;
          depth = grub_strtoul (value, 0, 0);
          if (grub_errno != GRUB_ERR_NONE)
            {
              grub_err_t rc;
-             
+
              /* First setup error message.  */
              rc = grub_error (GRUB_ERR_BAD_ARGUMENT,
                               "Invalid mode: %s\n",
                               current_mode);
-             
+
              /* Free memory before returning.  */
              grub_free (modevar);
 
@@ -616,7 +616,7 @@ grub_video_set_mode (char *modestring,
        }
 
       /* Try out video mode.  */
-      
+
       /* If we have 8 or less bits, then assume that it is indexed color mode.  */
       if ((depth <= 8) && (depth != -1))
        flags |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR;
@@ -624,12 +624,12 @@ grub_video_set_mode (char *modestring,
       /* We have more than 8 bits, then assume that it is RGB color mode.  */
       if (depth > 8)
        flags |= GRUB_VIDEO_MODE_TYPE_RGB;
-      
+
       /* If user requested specific depth, forward that information to driver.  */
       if (depth != -1)
        flags |= (depth << GRUB_VIDEO_MODE_TYPE_DEPTH_POS)
          & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK;
-      
+
       /* Try to initialize requested mode.  Ignore any errors.  */
       grub_video_adapter_t p;
 
@@ -638,7 +638,7 @@ grub_video_set_mode (char *modestring,
        {
          grub_err_t err;
          struct grub_video_mode_info mode_info;
-         
+
          grub_memset (&mode_info, 0, sizeof (mode_info));
 
          /* Try to initialize adapter, if it fails, skip to next adapter.  */
@@ -672,14 +672,14 @@ grub_video_set_mode (char *modestring,
              grub_errno = GRUB_ERR_NONE;
              continue;
            }
-           
+
          /* Valid mode found from adapter, and it has been activated.
             Specify it as active adapter.  */
          grub_video_adapter_active = p;
-         
+
          /* Free memory.  */
          grub_free (modevar);
-         
+
          return GRUB_ERR_NONE;
        }
 
@@ -687,7 +687,7 @@ grub_video_set_mode (char *modestring,
 
   /* Free memory.  */
   grub_free (modevar);
-  
+
   return grub_error (GRUB_ERR_BAD_ARGUMENT,
                     "No suitable mode found.");
 }