Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1685 → Rev 1686

/kernel/trunk/arch/mips32/include/boot.h
0,0 → 1,48
/*
* Copyright (C) 2006 Martin Decky
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __mips32_BOOT_H__
#define __mips32_BOOT_H__
 
#define TASKMAP_MAX_RECORDS 32
 
#include <arch/types.h>
 
typedef struct {
__address addr;
__u32 size;
} utask_t;
 
typedef struct {
__u32 cnt;
utask_t tasks[TASKMAP_MAX_RECORDS];
} bootinfo_t;
 
extern bootinfo_t bootinfo;
 
#endif
/kernel/trunk/arch/mips32/src/start.S
182,10 → 182,35
/* Load temporary stack */
lui $sp, %hi(end_stack)
ori $sp, $sp, %lo(end_stack)
 
/* $a1 contains physical address of bootinfo_t */
/* $a2 contains size of bootinfo_t */
beq $a2, $0, bootinfo_end
/* Not sure about this, but might be needed for PIC code???? */
lui $gp, 0x8000
lui $a3, 0x8000
addu $a1, $a1, $a3
lui $a3, %hi(bootinfo)
ori $a3, $a3, %lo(bootinfo)
bootinfo_loop:
lw $v0, 0($a1)
sw $v0, 0($a3)
addi $a1, $a1, 4
addi $a3, $a3, 4
addi $a2, $a2, -4
bgtz $a2, bootinfo_loop
nop
bootinfo_end:
jal arch_pre_main
nop
/kernel/trunk/arch/mips32/src/mips32.c
28,6 → 28,7
 
 
#include <arch.h>
#include <arch/boot.h>
#include <arch/cp0.h>
#include <arch/exception.h>
#include <arch/asm.h>
60,26 → 61,19
#define NORM_EXC ((char *) 0x80000180)
#define CACHE_EXC ((char *) 0x80000100)
 
bootinfo_t bootinfo;
 
void arch_pre_main(void)
{
/* Setup usermode */
init.cnt = 8;
init.tasks[0].addr = INIT_ADDRESS;
init.tasks[0].size = INIT_SIZE;
init.tasks[1].addr = INIT_ADDRESS + 0x100000;
init.tasks[1].size = INIT_SIZE;
init.tasks[2].addr = INIT_ADDRESS + 0x200000;
init.tasks[2].size = INIT_SIZE;
init.tasks[3].addr = INIT_ADDRESS + 0x300000;
init.tasks[3].size = INIT_SIZE;
init.tasks[4].addr = INIT_ADDRESS + 0x400000;
init.tasks[4].size = INIT_SIZE;
init.tasks[5].addr = INIT_ADDRESS + 0x500000;
init.tasks[5].size = INIT_SIZE;
init.tasks[6].addr = INIT_ADDRESS + 0x600000;
init.tasks[6].size = INIT_SIZE;
init.tasks[7].addr = INIT_ADDRESS + 0x700000;
init.tasks[7].size = INIT_SIZE;
init.cnt = bootinfo.cnt;
__u32 i;
for (i = 0; i < bootinfo.cnt; i++) {
init.tasks[i].addr = bootinfo.tasks[i].addr;
init.tasks[i].size = bootinfo.tasks[i].size;
}
}
 
void arch_pre_mm_init(void)