OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [sw/] [tests/] [or1200/] [sim/] [or1200-ticksyscall.S] - Diff between revs 477 and 671

Show entire file | Details | Blame | View Log

Rev 477 Rev 671
Line 354... Line 354...
        /* r7 and r8 hold actual real ESR and EPCR, respectively */
        /* r7 and r8 hold actual real ESR and EPCR, respectively */
        /* We'll restore them now */
        /* We'll restore them now */
        l.mtspr r0, r7, SPR_ESR_BASE /* SR before syscall */
        l.mtspr r0, r7, SPR_ESR_BASE /* SR before syscall */
        l.mtspr r0, r8, SPR_EPCR_BASE
        l.mtspr r0, r8, SPR_EPCR_BASE
        l.add r16, r16, r3 /* Add syscall number to our counter */
        l.add r16, r16, r3 /* Add syscall number to our counter */
        l.movhi r4, hi(0x01000000) /* 16MB mark of memory */
        l.movhi r4, hi(0x00400000) /* 4MB mark of memory */
        /* Ensure memory access OK */
        /* Ensure memory access OK */
        l.slli r3, r3, 2 /* Turn syscall number into a word address (<< 2) */
        l.slli r3, r3, 2 /* Turn syscall number into a word address (<< 2) */
        l.add r4, r4, r3 /* Access this offset from 16MB mark */
        l.add r4, r4, r3 /* Access this offset from 4MB mark */
        l.sw 0(r4), r16 /* Do a write to memory */
        l.sw 0(r4), r16 /* Do a write to memory */
        l.lwz r16, 0(r4) /* Do a read from memory */
        l.lwz r16, 0(r4) /* Do a read from memory */
        /* Report running value of syscall counter */
        /* Report running value of syscall counter */
        l.or r3, r0, r16
        l.or r3, r0, r16
        l.nop 2
        l.nop 2

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.