power pc program interrupt

Hi,

my program generates a program interrupt, it jumps to vectors 0x700 and gets stuck there. Can anyone help me?

Reply to
eascheiber
Loading thread data ...

It is up to you to provide code at 0x700 (and other low addresses) to run when interrupts occur.

Reply to
David R Brooks

Yes, I was hoping for a snippet of code... also maybe some insight into why I even get this interrupt, which I should not get.

Reagrds, e

Reply to
eascheiber

Have you looked at the PowerPC manual?

E.g. PowerPC Microprocessor Family: The Programming Environents For 32-bit Microprocessors.

In my copy, Table 6-2 gives a brief list of the possible causes for this exception.

The exception handler for this condition depends upon the needs of your application / OS.

The cause, however, is likely a bug in your code. (Illegal instruction, priveleged instruction, etc.)

--
Michael N. Moran           (h) 770 516 7918
5009 Old Field Ct.         (c) 678 521 5460
Kennesaw, GA, USA 30144    http://mnmoran.org

"So often times it happens, that we live our lives in chains
  and we never even know we have the key."
The Eagles, "Already Gone"

The Beatles were wrong: 1 & 1 & 1 is 1
Reply to
Michael N. Moran

The thing is write my code in C, so I thought the compiler will generate only correct instructions. And secondly it does not seem to behave deterministically, sometimes there isn't any exception. Just wondering, if someone stumbled upon smth similar...

Thanks, e

Reply to
eascheiber

Oh, my. New to this C thing are we?

There is a multitude of ways you can write C that the compiler is perfectly happy to translate that will result in code that will end up triggering exceptions. Wild pointers, alignments issues etc... And all without the compiler producing a single invalid instruction. And yes you can even get invalid instruction exceptions that way.

Remember above all "If you lie to the compiler it will get its revenge."

Henry Spencer if I recall correctly.

Robert

--
Posted via a free Usenet account from http://www.teranews.com
Reply to
Robert Adsett

Hi,

i have not found a way to make the powerpc-eabi-gcc to compile an interrupt service routine nowhere on the web.

Here are a few more details about how my program fails. First the memory mapping: section, .text: 0xf0800000-0xf0800a80 section, .init: 0xf0800a80-0xf0800aa4 section, .fini: 0xf0800aa4-0xf0800ac4 section, .boot0: 0xf08018b0-0xf08018c0 section, .boot: 0xf087fff0-0xf087fff4 section, .rodata: 0xf0800ac4-0xf0800d4e section, .sdata2: 0xf0800d50-0xf0800d50 section, .sbss2: 0xf0800d50-0xf0800d50 section, .data: 0xf0800d50-0xf0801048 section, .got: 0xf0801048-0xf0801048 section, .got1: 0xf0801048-0xf0801048 section, .got2: 0xf0801048-0xf0801064 section, .ctors: 0xf0801064-0xf080106c section, .dtors: 0xf080106c-0xf0801074 section, .fixup: 0xf0801074-0xf0801074 section, .eh_frame: 0xf0801074-0xf080107c section, .jcr: 0xf080107c-0xf0801080 section, .gcc_except_table: 0xf0801080-0xf0801080 section, .sdata: 0xf0801080-0xf0801088 section, .sbss: 0xf0801088-0xf0801088 section, .bss: 0xf0801088-0xf08010a4 section, .stack: 0xf08010a4-0xf08014b0 section, .heap: 0xf08014b0-0xf08018b0

Now the register states in the blocked state: pc: f08007e8 msr: 00000000 cr: 59000035 lr: f08007e8 ctr: 00000000 xer: e000007f fpscr: 00000000 pvr: 200108a0 sprg0: f0802b64 sprg1: f0802b64 sprg2: f0802b64 sprg3: f0802b64 srr0: 0000003c srr1: 00000000 tbl: 676f2376 tbu: 00000002 icdbdr: 55000000 esr: 08000000 dear: 00000000 evpr: f0800000 tsr: fc000000 tcr: 00000000 pit: 00000000 srr2: 00000000 srr3: 00000000 dbsr: 00000000 dbcr0: 81000000 iac1: f0802b64 iac2: f0802b64 dac1: f0802b64 dac2: f0802b64 dccr: 00000000 iccr: 00000000 zpr: 00000000 pid: 00000000 sgr: ffffffff dcwr: 00000000 ccr0: 50700000 dbcr1: 00000000 dvc1: f0802b64 dvc2: f0802b64 iac3: f0802b64 iac4: f0802b64 sler: 00000000 sprg4: f0802b64 sprg5: f0802b64 sprg6: f0802b64 sprg7: f0802b64 su0r: 00000000 usprg0: f0802b64

So it gets blocked around f08007e8 , in the program interrupt. An the value of srr0 is 0000003c. This is supposed to be the value of the address of the instruction that caused the interrupt. I don't have any code at

0x0000003c.

Regards, e

Reply to
eascheiber

Looks like your code jumps to $3c where it finds an illegal opcode and traps.

Using C or another HLL may be useful on a PPC platform if your only other option is native PPC assembly; however, in order to be able to do real work using a PPC (or another CPU, for that) you do need to understand and master to some extent the native assembly.

Dimiter

------------------------------------------------------ Dimiter Popoff Transgalactic Instruments

formatting link

------------------------------------------------------

Reply to
Didi

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.