Changeset 96e0748d in mainline for kernel/arch/arm32


Ignore:
Timestamp:
2009-02-17T22:47:27Z (17 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f89979b
Parents:
e662a5f
Message:

make arch_pre_main optional, don't force any specific prototype
simplify boot process
mips32: detect number of configured CPUs in msim

Location:
kernel/arch/arm32
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/include/arch.h

    re662a5f r96e0748d  
    2727 */
    2828
    29 /** @addtogroup arm32   
     29/** @addtogroup arm32
    3030 * @{
    3131 */
     
    3737#define KERN_arm32_ARCH_H_
    3838
     39#define TASKMAP_MAX_RECORDS  32
     40#define CPUMAP_MAX_RECORDS   32
     41
     42#include <typedefs.h>
     43
     44typedef struct {
     45        uintptr_t addr;
     46        uint32_t size;
     47} utask_t;
     48
     49typedef struct {
     50        uint32_t cnt;
     51        utask_t tasks[TASKMAP_MAX_RECORDS];
     52} bootinfo_t;
     53
     54extern void arch_pre_main(void *entry, bootinfo_t *bootinfo);
     55
    3956#endif
    4057
  • kernel/arch/arm32/include/asm/boot.h

    re662a5f r96e0748d  
    2727 */
    2828
    29 /** @addtogroup arm32   
     29/** @addtogroup arm32
    3030 * @{
    3131 */
     
    4040#define TEMP_STACK_SIZE 0x100
    4141
    42 #ifndef __ASM__
    43 
    44 /** Kernel entry point.
    45  *
    46  * Implemented in assembly. Copies boot_bootinfo (declared as bootinfo in
    47  * boot/arch/arm32/loader/main.c) to #bootinfo struct. Then jumps to
    48  * #arch_pre_main and #main_bsp.
    49  *
    50  * @param entry          Entry point address (not used).
    51  * @param boot_bootinfo  Struct holding information about loaded tasks.
    52  * @param bootinfo_size  Size of the bootinfo structure.
    53  */
    54 extern void kernel_image_start(void *entry, void *boot_bootinfo,
    55     unsigned int bootinfo_size);
    56 
    57 #endif
    58 
    5942#endif
    6043
  • kernel/arch/arm32/src/arm32.c

    re662a5f r96e0748d  
    3535
    3636#include <arch.h>
    37 #include <arch/boot.h>
    3837#include <config.h>
    3938#include <arch/console.h>
     
    4948#include <arch/machine.h>
    5049#include <userspace.h>
    51 
    52 /** Information about loaded tasks. */
    53 bootinfo_t bootinfo;
     50#include <macros.h>
    5451
    5552/** Performs arm32 specific initialization before main_bsp() is called. */
    56 void arch_pre_main(void)
     53void arch_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo)
    5754{
    5855        unsigned int i;
    59 
    60         init.cnt = bootinfo.cnt;
    61 
    62         for (i = 0; i < bootinfo.cnt; ++i) {
    63                 init.tasks[i].addr = bootinfo.tasks[i].addr;
    64                 init.tasks[i].size = bootinfo.tasks[i].size;
     56       
     57        init.cnt = bootinfo->cnt;
     58       
     59        for (i = 0; i < min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); ++i) {
     60                init.tasks[i].addr = bootinfo->tasks[i].addr;
     61                init.tasks[i].size = bootinfo->tasks[i].size;
    6562        }
    66        
    6763}
    6864
  • kernel/arch/arm32/src/start.S

    re662a5f r96e0748d  
    4141        bic r3, r3, #0x1f
    4242        orr r3, r3, #0x13
    43         msr cpsr_c, r3 
     43        msr cpsr_c, r3
    4444       
    4545        ldr sp, =temp_stack
    46 
    47         cmp r2, #0
    48         beq bootinfo_end
    49 
    50         ldr r3, =bootinfo
    51 
    52         bootinfo_loop:
    53                 ldr r4, [r1]
    54                 str r4, [r3]
    55 
    56                 add r1, r1, #4
    57                 add r3, r3, #4
    58                 add r2, r2, #-4
    59 
    60                 cmp r2, #0
    61                 bne bootinfo_loop
    6246       
    63         bootinfo_end:
    64 
    6547        bl arch_pre_main
    66 
     48       
    6749        bl main_bsp
    6850
     
    7557supervisor_sp:
    7658        .space 4
    77 
Note: See TracChangeset for help on using the changeset viewer.