/[gxemul]/trunk/src/include/cpu_avr.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_avr.h

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

revision 20 by dpavlin, Mon Oct 8 16:19:23 2007 UTC revision 22 by dpavlin, Mon Oct 8 16:19:37 2007 UTC
# Line 2  Line 2 
2  #define CPU_AVR_H  #define CPU_AVR_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_avr.h,v 1.10 2005/11/16 21:15:19 debug Exp $   *  $Id: cpu_avr.h,v 1.14 2006/02/09 22:40:27 debug Exp $
32   */   */
33    
34  #include "misc.h"  #include "misc.h"
# Line 38  struct cpu_family; Line 38  struct cpu_family;
38    
39  #define N_AVR_REGS              32  #define N_AVR_REGS              32
40    
41  #define AVR_N_IC_ARGS                   2  #define AVR_N_IC_ARGS                   3
42  #define AVR_INSTR_ALIGNMENT_SHIFT       1  #define AVR_INSTR_ALIGNMENT_SHIFT       1
43  #define AVR_IC_ENTRIES_SHIFT            11  #define AVR_IC_ENTRIES_SHIFT            11
44  #define AVR_IC_ENTRIES_PER_PAGE         (1 << AVR_IC_ENTRIES_SHIFT)  #define AVR_IC_ENTRIES_PER_PAGE         (1 << AVR_IC_ENTRIES_SHIFT)
# Line 47  struct cpu_family; Line 47  struct cpu_family;
47  #define AVR_ADDR_TO_PAGENR(a)           ((a) >> (AVR_IC_ENTRIES_SHIFT \  #define AVR_ADDR_TO_PAGENR(a)           ((a) >> (AVR_IC_ENTRIES_SHIFT \
48                                          + AVR_INSTR_ALIGNMENT_SHIFT))                                          + AVR_INSTR_ALIGNMENT_SHIFT))
49    
50  struct avr_instr_call {  DYNTRANS_MISC_DECLARATIONS(avr,AVR,uint64_t)
         void    (*f)(struct cpu *, struct avr_instr_call *);  
         int     len;  
         size_t  arg[AVR_N_IC_ARGS];  
 };  
   
 /*  Translation cache struct for each physical page:  */  
 struct avr_tc_physpage {  
         struct avr_instr_call ics[AVR_IC_ENTRIES_PER_PAGE + 1];  
         uint32_t        next_ofs;       /*  or 0 for end of chain  */  
         uint32_t        physaddr;  
         int             flags;  
 };  
   
   
 #define AVR_N_VPH_ENTRIES       1048576  
51    
52  #define AVR_MAX_VPH_TLB_ENTRIES         256  #define AVR_MAX_VPH_TLB_ENTRIES         128
 struct avr_vpg_tlb_entry {  
         unsigned char   valid;  
         unsigned char   writeflag;  
         uint32_t        vaddr_page;  
         uint32_t        paddr_page;  
         unsigned char   *host_page;  
 };  
53    
54    
55  #define SREG_NAMES      "cznvshti"  #define SREG_NAMES      "cznvshti"
# Line 109  struct avr_cpu { Line 87  struct avr_cpu {
87          /*          /*
88           *  Instruction translation cache:           *  Instruction translation cache:
89           */           */
90            DYNTRANS_ITC(avr)
         /*  cur_ic_page is a pointer to an array of AVR_IC_ENTRIES_PER_PAGE  
             instruction call entries. next_ic points to the next such  
             call to be executed.  */  
         struct avr_tc_physpage  *cur_physpage;  
         struct avr_instr_call   *cur_ic_page;  
         struct avr_instr_call   *next_ic;  
   
         void                    (*combination_check)(struct cpu *,  
                                     struct avr_instr_call *, int low_addr);  
91    
92          /*          /*
93           *  Virtual -> physical -> host address translation:           *  32-bit virtual -> physical -> host address translation:
94           *           *
95           *  host_load and host_store point to arrays of AVR_N_VPH_ENTRIES           *  (All 32 bits are not really needed on AVRs.)
          *  pointers (to host pages); phys_addr points to an array of  
          *  AVR_N_VPH_ENTRIES uint32_t.  
96           */           */
97            VPH_TLBS(avr,AVR)
98          struct avr_vpg_tlb_entry        vph_tlb_entry[AVR_MAX_VPH_TLB_ENTRIES];          VPH32(avr,AVR,uint32_t,uint8_t)
         unsigned char                   *host_load[AVR_N_VPH_ENTRIES];  
         unsigned char                   *host_store[AVR_N_VPH_ENTRIES];  
         uint32_t                        phys_addr[AVR_N_VPH_ENTRIES];  
         struct avr_tc_physpage          *phys_page[AVR_N_VPH_ENTRIES];  
   
         uint32_t                        phystranslation[AVR_N_VPH_ENTRIES/32];  
         uint8_t                         vaddr_to_tlbindex[AVR_N_VPH_ENTRIES];  
99  };  };
100    
101    

Legend:
Removed from v.20  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.26