Changeset 598f90e in mainline for uspace


Ignore:
Timestamp:
2010-10-31T20:13:16Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
458619f7
Parents:
5c088975
Message:

Use istate_t definitions from kernel instead of duplicating them.

Location:
uspace/lib/c/arch
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/abs32le/include/istate.h

    r5c088975 r598f90e  
    3636#define LIBC_abs32le__ISTATE_H_
    3737
    38 #include <sys/types.h>
    39 
    40 /** Interrupt context.
    41  *
    42  * On real hardware this stores the registers which
    43  * need to be preserved during interupts.
    44  */
    45 typedef struct istate {
    46         uintptr_t ip;
    47         uintptr_t fp;
    48         uint32_t stack[];
    49 } istate_t;
    50 
    51 static inline uintptr_t istate_get_pc(istate_t *istate)
    52 {
    53         return istate->ip;
    54 }
    55 
    56 static inline uintptr_t istate_get_fp(istate_t *istate)
    57 {
    58         return istate->fp;
    59 }
     38#include <arch/istate.h>
    6039
    6140#endif
  • uspace/lib/c/arch/amd64/include/istate.h

    r5c088975 r598f90e  
    3636#define LIBC_amd64_ISTATE_H_
    3737
    38 #include <sys/types.h>
    39 
    40 /** Interrupt context.
    41  *
    42  * This is a copy of the kernel definition with which it must be kept in sync.
    43  */
    44 typedef struct istate {
    45         uint64_t rax;
    46         uint64_t rcx;
    47         uint64_t rdx;
    48         uint64_t rsi;
    49         uint64_t rdi;
    50         uint64_t r8;
    51         uint64_t r9;
    52         uint64_t r10;
    53         uint64_t r11;
    54         uint64_t rbp;
    55         uint64_t error_word;
    56         uint64_t rip;
    57         uint64_t cs;
    58         uint64_t rflags;
    59         uint64_t stack[]; /* Additional data on stack */
    60 } istate_t;
    61 
    62 static inline uintptr_t istate_get_pc(istate_t *istate)
    63 {
    64         return istate->rip;
    65 }
    66 
    67 static inline uintptr_t istate_get_fp(istate_t *istate)
    68 {
    69         return istate->rbp;
    70 }
     38#include <arch/istate.h>
    7139
    7240#endif
  • uspace/lib/c/arch/arm32/include/istate.h

    r5c088975 r598f90e  
    3636#define LIBC_arm32__ISTATE_H_
    3737
    38 #include <sys/types.h>
    39 
    40 /** Interrupt context.
    41  *
    42  * This is a copy of the kernel definition with which it must be kept in sync.
    43  */
    44 typedef struct istate {
    45         uint32_t spsr;
    46         uint32_t sp;
    47         uint32_t lr;
    48 
    49         uint32_t r0;
    50         uint32_t r1;
    51         uint32_t r2;
    52         uint32_t r3;
    53         uint32_t r4;
    54         uint32_t r5;
    55         uint32_t r6;
    56         uint32_t r7;
    57         uint32_t r8;
    58         uint32_t r9;
    59         uint32_t r10;
    60         uint32_t fp;
    61         uint32_t r12;
    62 
    63         uint32_t pc;
    64 } istate_t;
    65 
    66 static inline uintptr_t istate_get_pc(istate_t *istate)
    67 {
    68         return istate->pc;
    69 }
    70 
    71 static inline uintptr_t istate_get_fp(istate_t *istate)
    72 {
    73         return istate->fp;
    74 }
     38#include <arch/istate.h>
    7539
    7640#endif
  • uspace/lib/c/arch/ia32/include/istate.h

    r5c088975 r598f90e  
    3636#define LIBC_ia32__ISTATE_H_
    3737
    38 #include <sys/types.h>
    39 
    40 /** Interrupt context.
    41  *
    42  * This is a copy of the kernel definition with which it must be kept in sync.
    43  */
    44 typedef struct istate {
    45         uint32_t eax;
    46         uint32_t ecx;
    47         uint32_t edx;
    48         uint32_t ebp;
    49 
    50         uint32_t gs;
    51         uint32_t fs;
    52         uint32_t es;
    53         uint32_t ds;
    54 
    55         uint32_t error_word;
    56         uint32_t eip;
    57         uint32_t cs;
    58         uint32_t eflags;
    59         uint32_t stack[];
    60 } istate_t;
    61 
    62 static inline uintptr_t istate_get_pc(istate_t *istate)
    63 {
    64         return istate->eip;
    65 }
    66 
    67 static inline uintptr_t istate_get_fp(istate_t *istate)
    68 {
    69         return istate->ebp;
    70 }
     38#include <arch/istate.h>
    7139
    7240#endif
  • uspace/lib/c/arch/ia64/include/istate.h

    r5c088975 r598f90e  
    3636#define LIBC_ia64_ISTATE_H_
    3737
    38 #include <sys/types.h>
    39 
    40 /** Interrupt context.
    41  *
    42  * This is a copy of the kernel definition with which it must be kept in sync.
    43  */
    44 typedef struct istate {
    45         /* TODO */
    46 } istate_t;
    47 
    48 static inline uintptr_t istate_get_pc(istate_t *istate)
    49 {
    50         /* TODO */
    51         return 0;
    52 }
    53 
    54 static inline uintptr_t istate_get_fp(istate_t *istate)
    55 {
    56         /* TODO */
    57         return 0;
    58 }
     38#include <arch/istate.h>
    5939
    6040#endif
  • uspace/lib/c/arch/mips32/include/istate.h

    r5c088975 r598f90e  
    3636#define LIBC_mips32__ISTATE_H_
    3737
    38 #include <sys/types.h>
    39 
    40 /** Interrupt context.
    41  *
    42  * This is a copy of the kernel definition with which it must be kept in sync.
    43  */
    44 typedef struct istate {
    45         uint32_t at;
    46         uint32_t v0;
    47         uint32_t v1;
    48         uint32_t a0;
    49         uint32_t a1;
    50         uint32_t a2;
    51         uint32_t a3;
    52         uint32_t t0;
    53         uint32_t t1;
    54         uint32_t t2;
    55         uint32_t t3;
    56         uint32_t t4;
    57         uint32_t t5;
    58         uint32_t t6;
    59         uint32_t t7;
    60         uint32_t t8;
    61         uint32_t t9;
    62         uint32_t gp;
    63         uint32_t sp;
    64         uint32_t ra;
    65 
    66         uint32_t lo;
    67         uint32_t hi;
    68 
    69         uint32_t status; /* cp0_status */
    70         uint32_t epc; /* cp0_epc */
    71         uint32_t k1; /* We use it as thread-local pointer */
    72 } istate_t;
    73 
    74 static inline uintptr_t istate_get_pc(istate_t *istate)
    75 {
    76         return istate->epc;
    77 }
    78 
    79 static inline uintptr_t istate_get_fp(istate_t *istate)
    80 {
    81         /* TODO */
    82         return 0;
    83 }
     38#include <arch/istate.h>
    8439
    8540#endif
  • uspace/lib/c/arch/sparc64/include/istate.h

    r5c088975 r598f90e  
    3636#define LIBC_sparc64_ISTATE_H_
    3737
    38 #include <sys/types.h>
    39 
    40 /** Interrupt context.
    41  *
    42  * This is a copy of the kernel definition with which it must be kept in sync.
    43  */
    44 typedef struct istate {
    45         /* TODO */
    46 } istate_t;
    47 
    48 static inline uintptr_t istate_get_pc(istate_t *istate)
    49 {
    50         /* TODO */
    51         return 0;
    52 }
    53 
    54 static inline uintptr_t istate_get_fp(istate_t *istate)
    55 {
    56         /* TODO */
    57         return 0;
    58 }
     38#include <arch/istate.h>
    5939
    6040#endif
Note: See TracChangeset for help on using the changeset viewer.