User Tools

Site Tools


musiccode

This is an old revision of the document!


Make sure to set the magic value in vector table :

#include <stdint.h>

attribute1) attribute2)) void doNothing(void) { /*asm volatile (“nop”);*/ }

attribute3) attribute4) attribute5)) void halt(void) { while(1); } #define RESERVED halt

Vector table laid out according to SH7021 datasheet tables 4.2, 5.3. attribute6) void (* const vector_table[])(void) = { /* Reset vectors */ /* Never used, BIOS has its own at address 0 */ Power-on reset

  RESERVED, RESERVED,
  // Manual reset
  RESERVED, RESERVED,

/* CPU interrupts */ /* Always active, except User Break masked at level 15 */

  // General illegal instruction
  halt,
  // (Reserved for system use)
  RESERVED,
  // Illegal slot instruction
  halt,
  // (Reserved for system use)
  RESERVED, RESERVED,
  // CPU address error
  halt,
  // DMA address error
  halt,
  // NMI
  doNothing,
  // User Break
  doNothing,
  // (Reserved for system use)
  RESERVED, RESERVED, RESERVED, RESERVED,
  RESERVED, RESERVED, RESERVED, RESERVED,
  RESERVED, RESERVED, RESERVED, RESERVED,
  RESERVED, RESERVED, RESERVED, RESERVED,
  RESERVED, RESERVED, RESERVED,
  // Trap instruction (user vectors)
  doNothing, doNothing, doNothing, doNothing,
  doNothing, doNothing, doNothing, doNothing,
  doNothing, doNothing, doNothing, doNothing,
  doNothing, doNothing, doNothing, doNothing,
  doNothing, doNothing, doNothing, doNothing,
  doNothing, doNothing, doNothing, doNothing,
  doNothing, doNothing, doNothing, doNothing,
  doNothing, doNothing, doNothing, doNothing,

/* IRQ and on-chip module interrupts */ /* Set nonzero, nonmasked priority in IPRA-IPRB to enable */

  // IRQ0..IRQ7
  doNothing, doNothing, doNothing, doNothing,
  doNothing, doNothing, doNothing, doNothing,
  // DMAC0..DMAC3 (DEI, Reserved)
  doNothing, RESERVED,
  doNothing, RESERVED,
  doNothing, RESERVED,
  doNothing, RESERVED,
  // ITU0..ITU4 (IMIA, IMIB, OVI, Reserved)
  ((const void (*)(void))0x648C), doNothing, doNothing, RESERVED,
  doNothing, doNothing, doNothing, RESERVED,
  doNothing, doNothing, doNothing, RESERVED,
  doNothing, doNothing, doNothing, RESERVED,
  doNothing, doNothing, doNothing, RESERVED,
  // SCI0..SCI1 (ERI, RxI, TxI, TEI)
  serial_ERI0, serial_RxI0, doNothing, doNothing,
  doNothing, doNothing, doNothing, doNothing,
  // PRT PEI
  doNothing,
  // Reserved
  RESERVED, RESERVED, RESERVED,
  // WDT
  halt,
  // REF CMI
  halt,
  // Reserved
  RESERVED, RESERVED

};

1) , 4)
interrupt_handler
2) , 5)
section(“.smallfunc”
3)
noreturn
6)
section (“.vectors”), used
musiccode.1738023328.txt.gz · Last modified: 2025/01/28 00:15 by gbb

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki