Changeset 0ddb84b in mainline


Ignore:
Timestamp:
2014-08-28T19:37:25Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2a37b9f
Parents:
3dcc9d8
Message:

Autogenerate sparc64 istate_t and its offsets.

Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/Makefile.inc

    r3dcc9d8 r0ddb84b  
    108108                arch/$(KARCH)/src/mm/$(USARCH)/tsb.c
    109109endif
     110
     111ARCH_AUTOGENS_AG = \
     112        arch/$(KARCH)/include/arch/istate_struct.ag
     113
  • kernel/arch/sparc64/include/arch/istate.h

    r3dcc9d8 r0ddb84b  
    4141#ifdef KERNEL
    4242
     43#include <arch/istate_struct.h>
    4344#include <arch/regdef.h>
    4445
    4546#else /* KERNEL */
    4647
     48#include <libarch/istate_struct.h>
    4749#include <libarch/regdef.h>
    4850
    4951#endif /* KERNEL */
    50 
    51 typedef struct istate {
    52         uint64_t tnpc;
    53         uint64_t tpc;
    54         uint64_t tstate;
    55 } istate_t;
    5652
    5753NO_TRACE static inline void istate_set_retaddr(istate_t *istate,
  • kernel/arch/sparc64/include/arch/trap/trap_table.h

    r3dcc9d8 r0ddb84b  
    3737
    3838#include <arch/stack.h>
     39#include <arch/istate_struct.h>
    3940
    4041#define TRAP_TABLE_ENTRY_COUNT  1024
     
    4243#define TRAP_TABLE_SIZE         (TRAP_TABLE_ENTRY_COUNT * TRAP_TABLE_ENTRY_SIZE)
    4344
     45#define ISTATE_END_OFFSET(o)    ((o) - ISTATE_SIZE)
     46
    4447/*
    45  * The following needs to be in sync with the definition of the istate
    46  * structure. The one STACK_ITEM_SIZE is counted for space holding the 7th
     48 * The one STACK_ITEM_SIZE is counted for space holding the 7th
    4749 * argument to syscall_handler (i.e. syscall number) and the other
    4850 * STACK_ITEM_SIZE is counted because of the required alignment.
     
    5052#define PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE \
    5153    (STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE + \
    52     (2 * STACK_ITEM_SIZE) + (12 * 8))
    53 #define SAVED_TSTATE    -(1 * 8)
    54 #define SAVED_TPC       -(2 * 8)
    55 #define SAVED_TNPC      -(3 * 8)        /* <-- istate_t begins here */
    56 #define SAVED_Y         -(4 * 8)
    57 #define SAVED_I0        -(5 * 8)
    58 #define SAVED_I1        -(6 * 8)
    59 #define SAVED_I2        -(7 * 8)
    60 #define SAVED_I3        -(8 * 8)
    61 #define SAVED_I4        -(9 * 8)
    62 #define SAVED_I5        -(10 * 8)
    63 #define SAVED_I6        -(11 * 8)
    64 #define SAVED_I7        -(12 * 8)
     54    (2 * STACK_ITEM_SIZE) + (ISTATE_SIZE + 9 * 8))
     55/* <-- istate_t ends here */
     56#define SAVED_TSTATE    ISTATE_END_OFFSET(ISTATE_OFFSET_TSTATE)
     57#define SAVED_TPC       ISTATE_END_OFFSET(ISTATE_OFFSET_TPC)
     58#define SAVED_TNPC      ISTATE_END_OFFSET(ISTATE_OFFSET_TNPC)
     59/* <-- istate_t begins here */
     60#define SAVED_Y         -(1 * 8 + ISTATE_SIZE)
     61#define SAVED_I0        -(2 * 8 + ISTATE_SIZE)
     62#define SAVED_I1        -(3 * 8 + ISTATE_SIZE)
     63#define SAVED_I2        -(4 * 8 + ISTATE_SIZE)
     64#define SAVED_I3        -(5 * 8 + ISTATE_SIZE)
     65#define SAVED_I4        -(6 * 8 + ISTATE_SIZE)
     66#define SAVED_I5        -(7 * 8 + ISTATE_SIZE)
     67#define SAVED_I6        -(8 * 8 + ISTATE_SIZE)
     68#define SAVED_I7        -(9 * 8 + ISTATE_SIZE)
    6569
    6670#ifndef __ASM__
Note: See TracChangeset for help on using the changeset viewer.