This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

ARM Simulator: detect any attempt to install a SWI vector


Hi Guys,

  The ARM simulator detects when a SWI vector installed as part of
  loading the executable image, but not if the vector is installed by
  a running process.  The patch below fixes this, and eliminates the
  now redundant code in wrapper.c.

Cheers
	Nick

2001-01-31  Nick Clifton  <nickc@redhat.com>

	* armvirt.c (PutWord): Detect installation of SWI vector.
	(SWI_vector_installed): Define.
	* armos.c (ARMul_OsInit): Reset SWI_vector_installed.
	* armos.h (SWI_vector_installed): Declare.
	* wrapper.c (SWI_vector_installed): Remove definition.
	(sim_write): Remove check of SWI vector	installation

Index: sim/arm/armos.c
===================================================================
RCS file: /cvs/src//src/sim/arm/armos.c,v
retrieving revision 1.6
diff -p -r1.6 armos.c
*** armos.c	2000/12/11 03:08:17	1.6
--- armos.c	2001/02/01 00:10:32
*************** ARMul_OSInit (ARMul_State * state)
*** 171,176 ****
--- 171,178 ----
    for (i = ARMul_ResetV; i <= ARMFIQV; i += 4)
      ARMul_WriteWord (state, i, instr);	/* write hardware vectors */
    
+   SWI_vector_installed = 0;
+ 
    for (i = ARMul_ResetV; i <= ARMFIQV + 4; i += 4)
      {
        ARMul_WriteWord (state, ADDRSOFTVECTORS + i, SOFTVECTORCODE + i * 4);
*************** ARMul_OSHandleSWI (ARMul_State * state, 
*** 628,635 ****
      default:
        {
  	/* If there is a SWI vector installed use it.  */
- 	extern int SWI_vector_installed;
- 
  	if (state->is_XScale && saved_number != -1)
  	  number = saved_number;
  	    
--- 630,635 ----

Index: sim/arm/armos.h
===================================================================
RCS file: /cvs/src//src/sim/arm/armos.h,v
retrieving revision 1.1.1.2
diff -p -r1.1.1.2 armos.h
*** armos.h	2000/02/05 07:30:19	1.1.1.2
--- armos.h	2001/02/01 00:10:32
***************
*** 93,95 ****
--- 93,97 ----
  
  extern unsigned long fpecode[];
  extern unsigned long fpesize;
+ 
+ extern int SWI_vector_installed;

Index: sim/arm/armvirt.c
===================================================================
RCS file: /cvs/src//src/sim/arm/armvirt.c,v
retrieving revision 1.3
diff -p -r1.3 armvirt.c
*** armvirt.c	2000/07/04 08:00:19	1.3
--- armvirt.c	2001/02/01 00:10:32
*************** defined to generate aborts. */
*** 49,54 ****
--- 49,56 ----
  #define PAGEBITS 16
  #define OFFSETBITS 0xffff
  
+ int SWI_vector_installed = FALSE;
+ 
  /***************************************************************************\
  *        Get a Word from Virtual Memory, maybe allocating the page          *
  \***************************************************************************/
*************** PutWord (ARMul_State * state, ARMword ad
*** 110,115 ****
--- 112,120 ----
  
        *(pagetable + page) = pageptr;
      }
+ 
+   if (address == 0x8)
+     SWI_vector_installed = TRUE;
  
    *(pageptr + offset) = data;
  }

Index: sim/arm/wrapper.c
===================================================================
RCS file: /cvs/src//src/sim/arm/wrapper.c,v
retrieving revision 1.10
diff -p -r1.10 wrapper.c
*** wrapper.c	2000/11/30 01:55:12	1.10
--- wrapper.c	2001/02/01 00:10:32
*************** ARMul_Debug (ARMul_State * state ATTRIBU
*** 114,121 ****
    return 0;
  }
  
- int SWI_vector_installed = FALSE;
- 
  int
  sim_write (sd, addr, buffer, size)
       SIM_DESC sd ATTRIBUTE_UNUSED;
--- 114,119 ----
*************** sim_write (sd, addr, buffer, size)
*** 126,134 ****
    int i;
  
    init ();
- 
-   if ((addr <= 0x8) && ((addr + size) >= 0x8))
-     SWI_vector_installed = TRUE;
  
    for (i = 0; i < size; i++)
      ARMul_WriteByte (state, addr + i, buffer[i]);
--- 124,129 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]