Changeset b994a60 in mainline for arch/ia64/src/ia64.c


Ignore:
Timestamp:
2006-03-09T12:44:27Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
901122b
Parents:
cd373bb
Message:

ia64 work.
Changes to make userspace work (kernel part).
Use ski.conf from contrib directory to run Ski.

There is actually no appropriate syscall handler yet.

File:
1 edited

Legend:

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

    rcd373bb rb994a60  
    3232#include <arch/interrupt.h>
    3333#include <arch/barrier.h>
     34#include <arch/asm.h>
     35#include <arch/register.h>
    3436#include <arch/types.h>
    35 
     37#include <arch/context.h>
     38#include <arch/mm/page.h>
     39#include <mm/as.h>
     40#include <config.h>
     41#include <userspace.h>
    3642#include <console/console.h>
    3743
     
    4450        ski_init_console();
    4551        it_init();
     52        config.init_addr = INIT_ADDRESS;
     53        config.init_size = INIT_SIZE;
    4654}
    4755
     
    5462}
    5563
    56 
    5764void arch_post_smp_init(void)
    5865{
    5966}
     67
     68/** Enter userspace and never return. */
     69void userspace(void)
     70{
     71        psr_t psr;
     72        rsc_t rsc;
     73
     74        psr.value = psr_read();
     75        psr.cpl = PL_USER;
     76        psr.i = true;                           /* start with interrupts enabled */
     77        psr.ic = true;
     78        psr.ri = 0;                             /* start with instruction #0 */
     79
     80        __asm__ volatile ("mov %0 = ar.rsc\n" : "=r" (rsc.value));
     81        rsc.loadrs = 0;
     82        rsc.be = false;
     83        rsc.pl = PL_USER;
     84        rsc.mode = 3;                           /* eager mode */
     85
     86        switch_to_userspace(UTEXT_ADDRESS, USTACK_ADDRESS+PAGE_SIZE-1, USTACK_ADDRESS, psr.value, rsc.value);
     87
     88        while (1) {
     89                ;
     90        }
     91}
Note: See TracChangeset for help on using the changeset viewer.