ARM VERSION 1.2 Guide de l'utilisateur Page 54

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 133
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 53
/* instruction to cause long branch to address in `location'. */
/* Function return value is original contents of 'vector'. */
{ unsigned vec, oldvec;
vec = ((unsigned)location - (unsigned)vector - 0x8) | 0xe59ff000
oldvec = *vector;
*vector = vec;
return (oldvec);
}
The following code calls this to install an IRQ handler:
unsigned *irqvec = (unsigned *)0x18;
static unsigned pIRQ_Handler = (unsigned)IRQ_handler
Install_Handler (&pIRQHandler, irqvec);
Again in this example the returned, original contents of the IRQ vector are discarded, but they could be used to
create a chain of handlers. See Chaining exception handlers for more information.
Note
If you are using a processor with separate instruction and data caches, such as StrongARM®, or ARM940T, you
must ensure that cache coherence problems do not prevent the new contents of the vectors from being used.
The data cache (or at least the entries containing the modified vectors) must be cleaned to ensure the new vector
contents are written to main memory. You must then flush the instruction cache to ensure that the new vector
contents are read from main memory.
For details of cache clean and flush operations, see the technical reference manual for your target processor.
Handling Processor Exceptions
Copyright ?1999 2001 ARM Limited 5-7
Vue de la page 53
1 2 ... 49 50 51 52 53 54 55 56 57 58 59 ... 132 133

Commentaires sur ces manuels

Pas de commentaire