Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 21 → Rev 22

/SPARTAN/trunk/arch/mips/src/fake.s
32,7 → 32,9
.global calibrate_delay_loop
.global asm_delay_loop
.global userspace
.global before_thread_runs
 
before_thread_runs:
userspace:
calibrate_delay_loop:
asm_delay_loop:
/SPARTAN/trunk/arch/ia32/Makefile.inc
22,6 → 22,7
arch/cpuid.s \
arch/delay.s \
arch/asm.s \
arch/proc/scheduler.c \
arch/smp/ap.S \
arch/smp/apic.c \
arch/smp/mp.c \
/SPARTAN/trunk/arch/ia32/src/proc/scheduler.c
0,0 → 1,38
/*
* Copyright (C) 2005 Jakub Jermar
* 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.
*/
 
#include <proc/scheduler.h>
#include <cpu.h>
#include <proc/thread.h>
#include <arch.h>
 
void before_thread_runs(void)
{
CPU->arch.tss->esp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-8];
CPU->arch.tss->ss0 = selector(KDATA_DES);
}
/SPARTAN/trunk/arch/ia32/src/cpu/cpu.c
104,7 → 104,7
}
}
 
void cpu_print_report(struct cpu* m)
void cpu_print_report(cpu_t* m)
{
printf("cpu%d: (%s family=%d model=%d stepping=%d) %dMHz\n",
m->id, vendor_str[m->arch.vendor], m->arch.family, m->arch.model, m->arch.stepping,
/SPARTAN/trunk/arch/ia32/src/userspace.c
38,13 → 38,7
pri_t pri;
pri = cpu_priority_high();
/*
* Prepare TSS stack selector and pointers for next syscall.
*/
CPU->arch.tss->esp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-8];
CPU->arch.tss->ss0 = selector(KDATA_DES);
 
__asm__ volatile (""
"pushl %0\n"
"pushl %1\n"
/SPARTAN/trunk/arch/ia32/src/interrupt.c
34,6 → 34,7
#include <cpu.h>
#include <arch/asm.h>
#include <mm/tlb.h>
#include <arch.h>
 
/*
* Interrupt and exception dispatching.
90,8 → 91,8
 
void syscall(__u8 n, __u32 stack[])
{
printf("syscall... ");
thread_sleep(1);
printf("cpu%d: syscall\n", CPU->id);
thread_usleep(600);
}
 
void tlb_shootdown_ipi(__u8 n, __u32 stack[])
/SPARTAN/trunk/arch/ia32/src/pm.c
65,7 → 65,7
 
struct tss *tss_p = NULL;
 
/* gdtr changes everytime new CPU is initialized */
/* gdtr is changed by kmp before next CPU is initialized */
struct ptr_16_32 gdtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(gdt), .base = (__address) gdt };
struct ptr_16_32 idtr __attribute__ ((section ("K_DATA_START")))= { .limit = sizeof(idt), .base = (__address) idt };