Changeset 971cf31f in mainline for arch/mips32


Ignore:
Timestamp:
2006-06-10T11:05:21Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0182a665
Parents:
88636f68
Message:

update mips32 boot loading API

Location:
arch/mips32
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • arch/mips32/src/mips32.c

    r88636f68 r971cf31f  
    2929
    3030#include <arch.h>
     31#include <arch/boot.h>
    3132#include <arch/cp0.h>
    3233#include <arch/exception.h>
     
    6162#define CACHE_EXC ((char *) 0x80000100)
    6263
     64bootinfo_t bootinfo;
     65
    6366void arch_pre_main(void)
    6467{
    6568        /* Setup usermode */
    66         init.cnt = 8;
    67         init.tasks[0].addr = INIT_ADDRESS;
    68         init.tasks[0].size = INIT_SIZE;
    69         init.tasks[1].addr = INIT_ADDRESS + 0x100000;
    70         init.tasks[1].size = INIT_SIZE;
    71         init.tasks[2].addr = INIT_ADDRESS + 0x200000;
    72         init.tasks[2].size = INIT_SIZE;
    73         init.tasks[3].addr = INIT_ADDRESS + 0x300000;
    74         init.tasks[3].size = INIT_SIZE;
    75         init.tasks[4].addr = INIT_ADDRESS + 0x400000;
    76         init.tasks[4].size = INIT_SIZE;
    77         init.tasks[5].addr = INIT_ADDRESS + 0x500000;
    78         init.tasks[5].size = INIT_SIZE;
    79         init.tasks[6].addr = INIT_ADDRESS + 0x600000;
    80         init.tasks[6].size = INIT_SIZE;
    81         init.tasks[7].addr = INIT_ADDRESS + 0x700000;
    82         init.tasks[7].size = INIT_SIZE;
     69        init.cnt = bootinfo.cnt;
     70       
     71        __u32 i;
     72       
     73        for (i = 0; i < bootinfo.cnt; i++) {
     74                init.tasks[i].addr = bootinfo.tasks[i].addr;
     75                init.tasks[i].size = bootinfo.tasks[i].size;
     76        }
    8377}
    8478
  • arch/mips32/src/start.S

    r88636f68 r971cf31f  
    183183        lui $sp, %hi(end_stack)
    184184        ori $sp, $sp, %lo(end_stack)
    185 
     185       
     186        /* $a1 contains physical address of bootinfo_t */
     187        /* $a2 contains size of bootinfo_t */
     188       
     189        beq $a2, $0, bootinfo_end
     190       
    186191        /* Not sure about this, but might be needed for PIC code???? */
    187192        lui $gp, 0x8000
     193       
     194        lui $a3, 0x8000
     195        addu $a1, $a1, $a3
     196       
     197        lui $a3, %hi(bootinfo)
     198        ori $a3, $a3, %lo(bootinfo)
     199       
     200        bootinfo_loop:
     201               
     202                lw $v0, 0($a1)
     203                sw $v0, 0($a3)
     204               
     205                addi $a1, $a1, 4
     206                addi $a3, $a3, 4
     207                addi $a2, $a2, -4
     208               
     209                bgtz $a2, bootinfo_loop
     210                nop
     211               
     212        bootinfo_end:
    188213       
    189214        jal arch_pre_main
Note: See TracChangeset for help on using the changeset viewer.