Ignore:
Timestamp:
2013-10-07T20:00:34Z (11 years ago)
Author:
Jakub Klama <jakub.klama@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a73ebf0
Parents:
80d9d83
Message:

First attempt to implement preemptive trap handlers
and switch to userspace. Preemptive traps are needed
for at least page faults, as page fault handling code
can trigger window underflow/overflow exceptions.

This commit also introduces userspace window buffer
for saving userspace register windows (just as in
sparc64).

These changes are unfinished and far from working
correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc32/include/arch/istate.h

    r80d9d83 r1f12fab  
    2727 */
    2828
    29 /** @addtogroup abs32leinterrupt
     29/** @addtogroup sparc32interrupt
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef KERN_abs32le_ISTATE_H_
    36 #define KERN_abs32le_ISTATE_H_
     35#ifndef KERN_sparc32_ISTATE_H_
     36#define KERN_sparc32_ISTATE_H_
    3737
    3838#include <trace.h>
     
    5454 */
    5555typedef struct istate {
    56         uintptr_t ip;
    57         uintptr_t fp;
     56        uintptr_t pstate;
     57        uintptr_t pc;
     58        uintptr_t npc;
    5859        uint32_t stack[];
    5960} istate_t;
     
    6465        /* On real hardware this checks whether the interrupted
    6566           context originated from user space. */
    66        
    67         return !(istate->ip & UINT32_C(0x80000000));
     67
     68        return !(istate->pc & UINT32_C(0x80000000));
    6869}
    6970
     
    7475        /* On real hardware this sets the instruction pointer. */
    7576       
    76         istate->ip = retaddr;
     77        istate->pc = retaddr;
    7778}
    7879
     
    8283        /* On real hardware this returns the instruction pointer. */
    8384       
    84         return istate->ip;
     85        return istate->pc;
    8586}
    8687
     
    9091        /* On real hardware this returns the frame pointer. */
    9192       
    92         return istate->fp;
     93        return 0;//istate->fp;
    9394}
    9495
Note: See TracChangeset for help on using the changeset viewer.