Changeset 4b4cfe0cd38d6ab371f58d76a171b5edcffd9787

Show
Ignore:
Timestamp:
10/29/09 23:14:57 (2 years ago)
Author:
Shao Miller <shao.miller@…>
Children:
259c0dca1bc6ead6003fc504e136be67a1311abb
Parents:
39adcc6d820d6432034c901f64a43dcd011ef1c3
git-committer:
Shao Miller <shao.miller@yrdsb.edu.on.ca> / 2009-10-29T19:14:57Z-0400
Message:

[chain] Run Nindent on chain.c

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • com32/modules/chain.c

    r39adcc r4b4cfe  
    554554    return; 
    555555 
    556 too_big: 
     556  too_big: 
    557557    error("Loader file too large\n"); 
    558558    return; 
    559559 
    560 enomem: 
     560  enomem: 
    561561    error("Out of memory\n"); 
    562562    return; 
     
    597597} 
    598598 
    599  
    600  
    601599static uint32_t get_file_lba(const char *filename) 
    602600{ 
    603     com32sys_t inregs;  
     601    com32sys_t inregs; 
    604602    uint32_t lba; 
    605603 
     
    619617 
    620618    if ((inregs.eflags.l & EFLAGS_CF) || inregs.esi.w[0] == 0) { 
    621         return 0; /* Filename not found */ 
     619        return 0;               /* Filename not found */ 
    622620    } 
    623621 
    624622    /* Since the first member is the LBA, we simply cast */ 
    625     lba = *((uint32_t*)MK_PTR(inregs.ds, inregs.esi.w[0])); 
    626  
    627     /* Clean the registers for the next call*/ 
     623    lba = *((uint32_t *) MK_PTR(inregs.ds, inregs.esi.w[0])); 
     624 
     625    /* Clean the registers for the next call */ 
    628626    memset(&inregs, 0, sizeof(com32sys_t)); 
    629627 
     
    653651    uint32_t *checksum, *chkhead, *chktail; 
    654652    size_t boot_size = SECTOR; 
    655  
    656653 
    657654    openconsole(&dev_null_r, &dev_stdcon_w); 
     
    831828 
    832829                   Offset Name         Size      Meaning 
    833                      8     bi_pvd       4 bytes   LBA of primary volume descriptor 
    834                     12     bi_file      4 bytes   LBA of boot file 
    835                     16     bi_length    4 bytes   Boot file length in bytes 
    836                     20     bi_csum      4 bytes   32-bit checksum 
    837                     24     bi_reserved  40 bytes  Reserved 
     830                   8     bi_pvd       4 bytes   LBA of primary volume descriptor 
     831                   12     bi_file      4 bytes   LBA of boot file 
     832                   16     bi_length    4 bytes   Boot file length in bytes 
     833                   20     bi_csum      4 bytes   32-bit checksum 
     834                   24     bi_reserved  40 bytes  Reserved 
    838835 
    839836                   The 32-bit checksum is the sum of all the 32-bit words in the 
     
    842839 
    843840                   LBA of primary volume descriptor should already be set to 16.  
    844                 */ 
    845  
    846                 isolinux_bin = (unsigned char*)boot_sector; 
     841                 */ 
     842 
     843                isolinux_bin = (unsigned char *)boot_sector; 
    847844 
    848845                /* Get LBA address of bootfile */ 
     
    854851                } 
    855852                /* Set it */ 
    856                 *((uint32_t*)&isolinux_bin[12]) = file_lba; 
    857  
    858                 /* Set boot file length */               
    859                 *((uint32_t*)&isolinux_bin[16]) = boot_size; 
     853                *((uint32_t *) & isolinux_bin[12]) = file_lba; 
     854 
     855                /* Set boot file length */ 
     856                *((uint32_t *) & isolinux_bin[16]) = boot_size; 
    860857 
    861858                /* Calculate checksum */ 
    862                 checksum = (uint32_t*)&isolinux_bin[20]; 
    863                 chkhead = (uint32_t*)&isolinux_bin[64]; 
    864                 chktail = (uint32_t*)&isolinux_bin[boot_size-1]; 
     859                checksum = (uint32_t *) & isolinux_bin[20]; 
     860                chkhead = (uint32_t *) & isolinux_bin[64]; 
     861                chktail = (uint32_t *) & isolinux_bin[boot_size - 1]; 
    865862                /* Fresh checksum and clear possibly fractional uint32_t at the end */ 
    866                 *checksum = *((uint32_t*)&isolinux_bin[boot_size]) = 0; 
    867  
    868                 while (chkhead <= chktail) 
    869                 { 
    870                         *checksum += *chkhead++; 
     863                *checksum = *((uint32_t *) & isolinux_bin[boot_size]) = 0; 
     864 
     865                while (chkhead <= chktail) { 
     866                    *checksum += *chkhead++; 
    871867                } 
    872             } 
    873             else { 
    874                 error("The isolinux= option is only valid when run from ISOLINUX\n"); 
     868            } else { 
     869                error 
     870                    ("The isolinux= option is only valid when run from ISOLINUX\n"); 
    875871                goto bail; 
    876872            } 
    877         }  
    878              
     873        } 
     874 
    879875    } else if (partinfo) { 
    880876        /* Actually read the boot sector */ 
     
    902898    do_boot(boot_sector, boot_size, &regs); 
    903899 
    904 bail: 
     900  bail: 
    905901    return 255; 
    906902} 
    907