--- trunk/src/include/cpu_alpha.h 2007/10/08 16:20:10 26 +++ trunk/src/include/cpu_alpha.h 2007/10/08 16:20:58 32 @@ -28,16 +28,20 @@ * SUCH DAMAGE. * * - * $Id: cpu_alpha.h,v 1.38 2006/06/24 21:47:23 debug Exp $ + * $Id: cpu_alpha.h,v 1.44 2006/09/01 11:39:50 debug Exp $ */ #include "misc.h" +#include "alpha_cpu.h" + /* ALPHA CPU types: */ struct alpha_cpu_type_def { char *name; + uint64_t pcs_type; /* See alpha_rpb.h */ int features; + int implver; int icache_shift; int ilinesize; int iway; @@ -53,18 +57,21 @@ #define ALPHA_FEATURE_BWX 1 #define ALPHA_CPU_TYPE_DEFS { \ - { "21064", 0, 16,5,2, 16,5,2, 0,0,0 }, \ - { "21066", 0, 16,5,2, 16,5,2, 0,0,0 }, \ - { "21164", 0, 16,5,2, 16,5,2, 0,0,0 }, \ - { "21164A-2", 0, 16,5,2, 16,5,2, 0,0,0 }, \ - { "21164PC", 0, 16,5,2, 16,5,2, 0,0,0 }, \ - { "21264", 0, 16,5,2, 16,5,2, 0,0,0 }, \ - { "21364", 0, 16,5,2, 16,5,2, 0,0,0 }, \ - { NULL, 0, 0,0,0, 0,0,0, 0,0,0 } } + { "21064", 0x000000002ULL, 0, 0, 16,5,2, 16,5,2, 0,0,0 }, \ + { "21066", 0x200000004ULL, 0, 0, 16,5,2, 16,5,2, 0,0,0 }, \ + { "21164", 0x000000005ULL, 0, 1, 16,5,2, 16,5,2, 0,0,0 }, \ + { "21164A-2", 0x000000007ULL, 0, 1, 16,5,2, 16,5,2, 0,0,0 }, \ + { "21164PC", 0x000000009ULL, 0, 1, 16,5,2, 16,5,2, 0,0,0 }, \ + { "21264", 0x00000000dULL, 0, 2, 16,5,2, 16,5,2, 0,0,0 }, \ + { "21364", 0x000000000ULL, 0, 3, 16,5,2, 16,5,2, 0,0,0 }, \ + { NULL, 0x000000000ULL, 0, 0, 0,0,0, 0,0,0, 0,0,0 } } struct cpu_family; +/* ALPHA_KENTRY_INT .. ALPHA_KENTRY_SYS */ +#define N_ALPHA_KENTRY 6 + #define ALPHA_V0 0 #define ALPHA_A0 16 #define ALPHA_A1 17 @@ -85,6 +92,8 @@ "t10", "t11", "ra", "t12", "at", "gp", "sp", "zero" } +/* Dyntrans definitions: */ + #define ALPHA_N_IC_ARGS 3 #define ALPHA_INSTR_ALIGNMENT_SHIFT 2 #define ALPHA_IC_ENTRIES_SHIFT 11 @@ -103,7 +112,13 @@ DYNTRANS_MISC64_DECLARATIONS(alpha,ALPHA,uint8_t) +#define ALPHA_PAGESHIFT 13 + + struct alpha_cpu { + struct alpha_cpu_type_def cpu_type; + + /* * General Purpose Registers: */ @@ -119,9 +134,13 @@ uint64_t load_linked_addr; int ll_flag; - /* PALcode specific: */ - uint64_t wrvptptr; + /* OSF1 PALcode specific: */ + uint64_t vptptr; /* Virtual Page Table Ptr */ uint64_t sysvalue; + uint64_t kgp; /* Kernel GP */ + uint64_t kentry[N_ALPHA_KENTRY]; + uint64_t ctx; /* Ptr to current PCB (?) */ + struct alpha_pcb pcb; /* Process Control Block */ /* @@ -140,6 +159,7 @@ void alpha_invalidate_translation_caches(struct cpu *cpu, uint64_t, int); void alpha_invalidate_code_translation(struct cpu *cpu, uint64_t, int); void alpha_init_64bit_dummy_tables(struct cpu *cpu); +int alpha_run_instr(struct cpu *cpu); int alpha_memory_rw(struct cpu *cpu, struct memory *mem, uint64_t vaddr, unsigned char *data, size_t len, int writeflag, int cache_flags); int alpha_userland_memory_rw(struct cpu *cpu, struct memory *mem, @@ -155,4 +175,5 @@ int alpha_translate_v2p(struct cpu *cpu, uint64_t vaddr, uint64_t *return_addr, int flags); + #endif /* CPU_ALPHA_H */