/[qemu]/qemu/target-ppc/op.c
ViewVC logotype

Diff of /qemu/target-ppc/op.c

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

revision 1.17 by bellard, Sat Jun 4 22:19:02 2005 UTC revision 1.18 by bellard, Sat Jul 2 20:59:34 2005 UTC
# Line 1  Line 1 
1  /*  /*
2   *  PPC emulation micro-operations for qemu.   *  PowerPC emulation micro-operations for qemu.
3   *   *
4   *  Copyright (c) 2003 Jocelyn Mayer   *  Copyright (c) 2003-2005 Jocelyn Mayer
5   *   *
6   * This library is free software; you can redistribute it and/or   * This library is free software; you can redistribute it and/or
7   * modify it under the terms of the GNU Lesser General Public   * modify it under the terms of the GNU Lesser General Public
# Line 130  Line 130 
130  #define REG 31  #define REG 31
131  #include "op_template.h"  #include "op_template.h"
132    
133  /* PPC state maintenance operations */  /* PowerPC state maintenance operations */
134  /* set_Rc0 */  /* set_Rc0 */
135  PPC_OP(set_Rc0)  PPC_OP(set_Rc0)
136  {  {
# Line 223  PPC_OP(load_srin) Line 223  PPC_OP(load_srin)
223    
224  PPC_OP(store_srin)  PPC_OP(store_srin)
225  {  {
226      do_store_sr(T1 >> 28);      do_store_sr(env, ((uint32_t)T1 >> 28), T0);
227      RETURN();      RETURN();
228  }  }
229    
# Line 235  PPC_OP(load_sdr1) Line 235  PPC_OP(load_sdr1)
235    
236  PPC_OP(store_sdr1)  PPC_OP(store_sdr1)
237  {  {
238      regs->sdr1 = T0;      do_store_sdr1(env, T0);
239      RETURN();      RETURN();
240  }  }
241    
# Line 247  PPC_OP(exit_tb) Line 247  PPC_OP(exit_tb)
247  /* Load/store special registers */  /* Load/store special registers */
248  PPC_OP(load_cr)  PPC_OP(load_cr)
249  {  {
250      do_load_cr();      T0 = do_load_cr(env);
251      RETURN();      RETURN();
252  }  }
253    
254  PPC_OP(store_cr)  PPC_OP(store_cr)
255  {  {
256      do_store_cr(PARAM(1));      do_store_cr(env, T0, PARAM(1));
257      RETURN();      RETURN();
258  }  }
259    
# Line 279  PPC_OP(load_xer_bc) Line 279  PPC_OP(load_xer_bc)
279    
280  PPC_OP(load_xer)  PPC_OP(load_xer)
281  {  {
282      do_load_xer();      T0 = do_load_xer(env);
283      RETURN();      RETURN();
284  }  }
285    
286  PPC_OP(store_xer)  PPC_OP(store_xer)
287  {  {
288      do_store_xer();      do_store_xer(env, T0);
289      RETURN();      RETURN();
290  }  }
291    
292  PPC_OP(load_msr)  PPC_OP(load_msr)
293  {  {
294      do_load_msr();      T0 = do_load_msr(env);
295      RETURN();      RETURN();
296  }  }
297    
298  PPC_OP(store_msr)  PPC_OP(store_msr)
299  {  {
300      do_store_msr();      do_store_msr(env, T0);
301      RETURN();      RETURN();
302  }  }
303    
# Line 378  PPC_OP(load_ibat) Line 378  PPC_OP(load_ibat)
378      T0 = regs->IBAT[PARAM(1)][PARAM(2)];      T0 = regs->IBAT[PARAM(1)][PARAM(2)];
379  }  }
380    
381  PPC_OP(store_ibat)  void op_store_ibatu (void)
382  {  {
383      do_store_ibat(PARAM(1), PARAM(2));      do_store_ibatu(env, PARAM1, T0);
384        RETURN();
385    }
386    
387    void op_store_ibatl (void)
388    {
389    #if 1
390        env->IBAT[1][PARAM1] = T0;
391    #else
392        do_store_ibatl(env, PARAM1, T0);
393    #endif
394        RETURN();
395  }  }
396    
397  PPC_OP(load_dbat)  PPC_OP(load_dbat)
# Line 388  PPC_OP(load_dbat) Line 399  PPC_OP(load_dbat)
399      T0 = regs->DBAT[PARAM(1)][PARAM(2)];      T0 = regs->DBAT[PARAM(1)][PARAM(2)];
400  }  }
401    
402  PPC_OP(store_dbat)  void op_store_dbatu (void)
403    {
404        do_store_dbatu(env, PARAM1, T0);
405        RETURN();
406    }
407    
408    void op_store_dbatl (void)
409  {  {
410      do_store_dbat(PARAM(1), PARAM(2));  #if 1
411        env->DBAT[1][PARAM1] = T0;
412    #else
413        do_store_dbatl(env, PARAM1, T0);
414    #endif
415        RETURN();
416  }  }
417    
418  /* FPSCR */  /* FPSCR */
419  PPC_OP(load_fpscr)  PPC_OP(load_fpscr)
420  {  {
421      do_load_fpscr();      FT0 = do_load_fpscr(env);
422      RETURN();      RETURN();
423  }  }
424    
425  PPC_OP(store_fpscr)  PPC_OP(store_fpscr)
426  {  {
427      do_store_fpscr(PARAM(1));      do_store_fpscr(env, FT0, PARAM1);
428      RETURN();      RETURN();
429  }  }
430    
# Line 1362  PPC_OP(check_reservation) Line 1384  PPC_OP(check_reservation)
1384  /* Return from interrupt */  /* Return from interrupt */
1385  PPC_OP(rfi)  PPC_OP(rfi)
1386  {  {
1387      regs->nip = regs->spr[SRR0] & ~0x00000003;      regs->nip = regs->spr[SPR_SRR0] & ~0x00000003;
1388  #if 1 // TRY  #if 1 // TRY
1389      T0 = regs->spr[SRR1] & ~0xFFF00000;      T0 = regs->spr[SPR_SRR1] & ~0xFFF00000;
1390  #else  #else
1391      T0 = regs->spr[SRR1] & ~0xFFFF0000;      T0 = regs->spr[SPR_SRR1] & ~0xFFFF0000;
 #endif  
     do_store_msr();  
 #if defined (DEBUG_OP)  
     dump_rfi();  
1392  #endif  #endif
1393      //    do_tlbia();      do_store_msr(env, T0);
1394      do_raise_exception(EXCP_RFI);      do_raise_exception(EXCP_RFI);
1395      RETURN();      RETURN();
1396  }  }
# Line 1420  PPC_OP(tlbie) Line 1438  PPC_OP(tlbie)
1438      do_tlbie();      do_tlbie();
1439      RETURN();      RETURN();
1440  }  }
1441    
1442    void op_store_pir (void)
1443    {
1444        env->spr[SPR_PIR] = T0 & 0x0000000FUL;
1445        RETURN();
1446    }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26