Changeset 4236b18 in mainline


Ignore:
Timestamp:
2014-08-28T09:39:19Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4abe919
Parents:
95fe55ca
Message:

Autogenerate amd64 istate_t and its offsets.

Files:
2 added
3 edited

Legend:

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

    r95fe55ca r4236b18  
    8686                arch/$(KARCH)/src/smp/smp.c
    8787endif
     88
     89ARCH_AUTOGENS_AG = \
     90        arch/$(KARCH)/include/arch/istate_struct.ag
     91
  • kernel/arch/amd64/include/arch/istate.h

    r95fe55ca r4236b18  
    3838#include <trace.h>
    3939
    40 /** This is passed to interrupt handlers */
    41 typedef struct istate {
    42         uint64_t rax;
    43         uint64_t rbx;
    44         uint64_t rcx;
    45         uint64_t rdx;
    46         uint64_t rsi;
    47         uint64_t rdi;
    48         uint64_t rbp;
    49         uint64_t r8;
    50         uint64_t r9;
    51         uint64_t r10;
    52         uint64_t r11;
    53         uint64_t r12;
    54         uint64_t r13;
    55         uint64_t r14;
    56         uint64_t r15;
    57         uint64_t alignment;   /* align rbp_frame on multiple of 16 */
    58         uint64_t rbp_frame;   /* imitation of frame pointer linkage */
    59         uint64_t rip_frame;   /* imitation of return address linkage */
    60         uint64_t error_word;  /* real or fake error word */
    61         uint64_t rip;
    62         uint64_t cs;
    63         uint64_t rflags;
    64         uint64_t rsp;         /* only if istate_t is from uspace */
    65         uint64_t ss;          /* only if istate_t is from uspace */
    66 } istate_t;
     40#ifdef KERNEL
     41#include <arch/istate_struct.h>
     42#else
     43#include <libarch/istate_struct.h>
     44#endif
    6745
    6846#define RPL_USER        3
  • kernel/arch/amd64/src/asm.S

    r95fe55ca r4236b18  
    2929#include <arch/pm.h>
    3030#include <arch/mm/page.h>
     31#include <arch/istate_struct.h>
    3132
    3233.text
     
    142143        ret
    143144
    144 #define ISTATE_OFFSET_RAX               0
    145 #define ISTATE_OFFSET_RBX               8
    146 #define ISTATE_OFFSET_RCX               16
    147 #define ISTATE_OFFSET_RDX               24
    148 #define ISTATE_OFFSET_RSI               32
    149 #define ISTATE_OFFSET_RDI               40
    150 #define ISTATE_OFFSET_RBP               48
    151 #define ISTATE_OFFSET_R8                56
    152 #define ISTATE_OFFSET_R9                64
    153 #define ISTATE_OFFSET_R10               72
    154 #define ISTATE_OFFSET_R11               80
    155 #define ISTATE_OFFSET_R12               88     
    156 #define ISTATE_OFFSET_R13               96
    157 #define ISTATE_OFFSET_R14               104
    158 #define ISTATE_OFFSET_R15               112
    159 #define ISTATE_OFFSET_ALIGNMENT         120
    160 #define ISTATE_OFFSET_RBP_FRAME         128
    161 #define ISTATE_OFFSET_RIP_FRAME         136
    162 #define ISTATE_OFFSET_ERROR_WORD        144
    163 #define ISTATE_OFFSET_RIP               152
    164 #define ISTATE_OFFSET_CS                160
    165 #define ISTATE_OFFSET_RFLAGS            168
    166 #define ISTATE_OFFSET_RSP               176
    167 #define ISTATE_OFFSET_SS                184
    168 
    169145/*
    170146 * Size of the istate structure without the hardware-saved part and without the
    171147 * error word.
    172148 */
    173 #define ISTATE_SOFT_SIZE        144
     149#define ISTATE_SOFT_SIZE        ISTATE_SIZE - (6 * 8)
    174150
    175151/**
Note: See TracChangeset for help on using the changeset viewer.