/[gxemul]/trunk/src/include/cpu_sh.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/include/cpu_sh.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 18 by dpavlin, Mon Oct 8 16:19:11 2007 UTC revision 24 by dpavlin, Mon Oct 8 16:19:56 2007 UTC
# Line 2  Line 2 
2  #define CPU_SH_H  #define CPU_SH_H
3    
4  /*  /*
5   *  Copyright (C) 2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2005-2006  Anders Gavare.  All rights reserved.
6   *   *
7   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
8   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 28  Line 28 
28   *  SUCH DAMAGE.   *  SUCH DAMAGE.
29   *   *
30   *   *
31   *  $Id: cpu_sh.h,v 1.7 2005/10/27 14:01:15 debug Exp $   *  $Id: cpu_sh.h,v 1.16 2006/02/24 00:20:42 debug Exp $
32   */   */
33    
34  #include "misc.h"  #include "misc.h"
# Line 46  struct cpu_family; Line 46  struct cpu_family;
46  #define SH_ADDR_TO_PAGENR(a)            ((a) >> (SH_IC_ENTRIES_SHIFT \  #define SH_ADDR_TO_PAGENR(a)            ((a) >> (SH_IC_ENTRIES_SHIFT \
47                                          + SH_INSTR_ALIGNMENT_SHIFT))                                          + SH_INSTR_ALIGNMENT_SHIFT))
48    
49  struct sh_instr_call {  #define SH_L2N          17
50          void    (*f)(struct cpu *, struct sh_instr_call *);  #define SH_L3N          18
         size_t  arg[SH_N_IC_ARGS];  
 };  
51    
52  /*  Translation cache struct for each physical page:  */  DYNTRANS_MISC_DECLARATIONS(sh,SH,uint64_t)
53  struct sh_tc_physpage {  DYNTRANS_MISC64_DECLARATIONS(sh,SH,uint8_t)
         struct sh_instr_call ics[SH_IC_ENTRIES_PER_PAGE + 1];  
         uint32_t        next_ofs;       /*  or 0 for end of chain  */  
         int             flags;  
         uint64_t        physaddr;  
 };  
54    
55  #define SH_N_VPH_ENTRIES                1048576  #define SH_MAX_VPH_TLB_ENTRIES          128
56    
 #define SH_MAX_VPH_TLB_ENTRIES          256  
 struct sh_vpg_tlb_entry {  
         int             valid;  
         int             writeflag;  
         int64_t         timestamp;  
         unsigned char   *host_page;  
         uint64_t        vaddr_page;  
         uint64_t        paddr_page;  
 };  
57    
58  struct sh_cpu {  struct sh_cpu {
59          int             bits;          int             bits;
# Line 79  struct sh_cpu { Line 63  struct sh_cpu {
63    
64    
65          /*          /*
66           *  Instruction translation cache:           *  Instruction translation cache and Virtual->Physical->Host
67           */           *  address translation:
   
         /*  cur_ic_page is a pointer to an array of SH_IC_ENTRIES_PER_PAGE  
             instruction call entries. next_ic points to the next such  
             call to be executed.  */  
         struct sh_tc_physpage   *cur_physpage;  
         struct sh_instr_call    *cur_ic_page;  
         struct sh_instr_call    *next_ic;  
   
   
         /*  
          *  Virtual -> physical -> host address translation:  
          *  
          *  host_load and host_store point to arrays of SH_N_VPH_ENTRIES  
          *  pointers (to host pages); phys_addr points to an array of  
          *  SH_N_VPH_ENTRIES uint32_t.  
68           */           */
69            DYNTRANS_ITC(sh)
70          struct sh_vpg_tlb_entry  vph_tlb_entry[SH_MAX_VPH_TLB_ENTRIES];          VPH_TLBS(sh,SH)
71          unsigned char            *host_load[SH_N_VPH_ENTRIES];          VPH32(sh,SH,uint64_t,uint8_t)
72          unsigned char            *host_store[SH_N_VPH_ENTRIES];          VPH64(sh,SH,uint8_t)
         uint32_t                 phys_addr[SH_N_VPH_ENTRIES];  
         struct sh_tc_physpage    *phys_page[SH_N_VPH_ENTRIES];  
   
         uint32_t                 phystranslation[SH_N_VPH_ENTRIES/32];  
73  };  };
74    
75    
# Line 117  void sh32_update_translation_table(struc Line 82  void sh32_update_translation_table(struc
82          unsigned char *host_page, int writeflag, uint64_t paddr_page);          unsigned char *host_page, int writeflag, uint64_t paddr_page);
83  void sh32_invalidate_translation_caches(struct cpu *cpu, uint64_t, int);  void sh32_invalidate_translation_caches(struct cpu *cpu, uint64_t, int);
84  void sh32_invalidate_code_translation(struct cpu *cpu, uint64_t, int);  void sh32_invalidate_code_translation(struct cpu *cpu, uint64_t, int);
85    void sh_init_64bit_dummy_tables(struct cpu *cpu);
86  int sh_memory_rw(struct cpu *cpu, struct memory *mem, uint64_t vaddr,  int sh_memory_rw(struct cpu *cpu, struct memory *mem, uint64_t vaddr,
87          unsigned char *data, size_t len, int writeflag, int cache_flags);          unsigned char *data, size_t len, int writeflag, int cache_flags);
88  int sh_cpu_family_init(struct cpu_family *);  int sh_cpu_family_init(struct cpu_family *);

Legend:
Removed from v.18  
changed lines
  Added in v.24

  ViewVC Help
Powered by ViewVC 1.1.26