Changeset 89c57b6 in mainline for kernel/arch/ppc32/include/istate.h


Ignore:
Timestamp:
2011-04-13T14:45:41Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88634420
Parents:
cefb126 (diff), 17279ead (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 moved

Legend:

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

    rcefb126 r89c57b6  
    11/*
    2  * Copyright (c) 2005 Sergey Bondari
     2 * Copyright (c) 2006 Martin Decky
    33 * All rights reserved.
    44 *
     
    3333 */
    3434
    35 #ifndef KERN_ppc32_MEMSTR_H_
    36 #define KERN_ppc32_MEMSTR_H_
     35#ifndef KERN_ppc32_EXCEPTION_H_
     36#define KERN_ppc32_EXCEPTION_H_
    3737
    38 #define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
     38#include <typedefs.h>
     39#include <arch/cpu.h>
     40#include <trace.h>
    3941
    40 extern void memsetw(void *, size_t, uint16_t);
    41 extern void memsetb(void *, size_t, uint8_t);
     42typedef struct istate {
     43        uint32_t r0;
     44        uint32_t r2;
     45        uint32_t r3;
     46        uint32_t r4;
     47        uint32_t r5;
     48        uint32_t r6;
     49        uint32_t r7;
     50        uint32_t r8;
     51        uint32_t r9;
     52        uint32_t r10;
     53        uint32_t r11;
     54        uint32_t r13;
     55        uint32_t r14;
     56        uint32_t r15;
     57        uint32_t r16;
     58        uint32_t r17;
     59        uint32_t r18;
     60        uint32_t r19;
     61        uint32_t r20;
     62        uint32_t r21;
     63        uint32_t r22;
     64        uint32_t r23;
     65        uint32_t r24;
     66        uint32_t r25;
     67        uint32_t r26;
     68        uint32_t r27;
     69        uint32_t r28;
     70        uint32_t r29;
     71        uint32_t r30;
     72        uint32_t r31;
     73        uint32_t cr;
     74        uint32_t pc;
     75        uint32_t srr1;
     76        uint32_t lr;
     77        uint32_t ctr;
     78        uint32_t xer;
     79        uint32_t dar;
     80        uint32_t r12;
     81        uint32_t sp;
     82} istate_t;
     83
     84NO_TRACE static inline void istate_set_retaddr(istate_t *istate,
     85    uintptr_t retaddr)
     86{
     87        istate->pc = retaddr;
     88}
     89
     90/** Return true if exception happened while in userspace
     91 *
     92 * The contexts of MSR register was stored in SRR1.
     93 *
     94 */
     95NO_TRACE static inline int istate_from_uspace(istate_t *istate)
     96{
     97        return (istate->srr1 & MSR_PR) != 0;
     98}
     99
     100NO_TRACE static inline uintptr_t istate_get_pc(istate_t *istate)
     101{
     102        return istate->pc;
     103}
     104
     105NO_TRACE static inline uintptr_t istate_get_fp(istate_t *istate)
     106{
     107        return istate->sp;
     108}
    42109
    43110#endif
Note: See TracChangeset for help on using the changeset viewer.