Changeset 2f57690 in mainline for kernel/arch/ia32/src/boot/cboot.c


Ignore:
Timestamp:
2009-03-03T12:41:39Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
deca67b
Parents:
561db3f
Message:

cstyle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/boot/cboot.c

    r561db3f r2f57690  
    4747/** Extract command name from the multiboot module command line.
    4848 *
    49  * @param buf           Destination buffer (will always null-terminate).
    50  * @param n             Size of destination buffer.
    51  * @param cmd_line      Input string (the command line).                       
     49 * @param buf      Destination buffer (will always null-terminate).
     50 * @param n        Size of destination buffer.
     51 * @param cmd_line Input string (the command line).
     52 *
    5253 */
    5354static void extract_command(char *buf, size_t n, const char *cmd_line)
     
    5556        const char *start, *end, *cp;
    5657        size_t max_len;
    57 
     58       
    5859        /* Find the first space. */
    5960        end = strchr(cmd_line, ' ');
    60         if (end == NULL) end = cmd_line + strlen(cmd_line);
    61 
     61        if (end == NULL)
     62                end = cmd_line + strlen(cmd_line);
     63       
    6264        /*
    6365         * Find last occurence of '/' before 'end'. If found, place start at
     
    7375                --cp;
    7476        }
    75 
     77       
    7678        /* Copy the command and null-terminate the string. */
    7779        max_len = min(n - 1, (size_t) (end - start));
     
    8183
    8284/** C part of ia32 boot sequence.
    83  * @param signature     Should contain the multiboot signature.
    84  * @param mi            Pointer to the multiboot information structure.
     85 *
     86 * @param signature Should contain the multiboot signature.
     87 * @param mi        Pointer to the multiboot information structure.
    8588 */
    8689void ia32_cboot(uint32_t signature, const mb_info_t *mi)
     
    8992        mb_mod_t *mods;
    9093        uint32_t i;
    91 
    92         if (signature == MULTIBOOT_LOADER_MAGIC) {
     94       
     95        if (signature == MULTIBOOT_LOADER_MAGIC)
    9396                flags = mi->flags;
    94         } else {
     97        else {
    9598                /* No multiboot info available. */
    9699                flags = 0;
    97100        }
    98 
     101       
    99102        /* Copy module information. */
    100 
     103       
    101104        if ((flags & MBINFO_FLAGS_MODS) != 0) {
    102105                init.cnt = mi->mods_count;
    103106                mods = mi->mods_addr;
    104 
     107               
    105108                for (i = 0; i < init.cnt; i++) {
    106109                        init.tasks[i].addr = mods[i].start + 0x80000000;
    107110                        init.tasks[i].size = mods[i].end - mods[i].start;
    108 
     111                       
    109112                        /* Copy command line, if available. */
    110113                        if (mods[i].string) {
     
    112115                                    CONFIG_TASK_NAME_BUFLEN,
    113116                                    mods[i].string);
    114                         } else {
     117                        } else
    115118                                init.tasks[i].name[0] = '\0';
    116                         }
    117119                }
    118         } else {
     120        } else
    119121                init.cnt = 0;
    120         }
    121 
     122       
    122123        /* Copy memory map. */
    123 
     124       
    124125        int32_t mmap_length;
    125126        mb_mmap_t *mme;
    126127        uint32_t size;
    127 
     128       
    128129        if ((flags & MBINFO_FLAGS_MMAP) != 0) {
    129130                mmap_length = mi->mmap_length;
    130131                mme = mi->mmap_addr;
    131132                e820counter = 0;
    132 
     133               
    133134                i = 0;
    134135                while (mmap_length > 0) {
    135136                        e820table[i++] = mme->mm_info;
    136 
     137                       
    137138                        /* Compute address of next structure. */
    138139                        size = sizeof(mme->size) + mme->size;
     
    140141                        mmap_length -= size;
    141142                }
    142 
     143               
    143144                e820counter = i;
    144         } else {
     145        } else
    145146                e820counter = 0;
    146         }
    147 
     147       
    148148#ifdef CONFIG_SMP
    149149        /* Copy AP bootstrap routines below 1 MB. */
     
    151151            (size_t) &_hardcoded_unmapped_size);
    152152#endif
    153 
     153       
    154154        main_bsp();
    155155}
Note: See TracChangeset for help on using the changeset viewer.