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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [testsuite/] [test-code-or1k/] [cache/] [cache.c] - Diff between revs 90 and 346

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 90 Rev 346
Line 166... Line 166...
 
 
void dummy();
void dummy();
 
 
void jump_and_link(void)
void jump_and_link(void)
{
{
        asm("_jalr:");
        asm("jalr:");
  asm("l.jr\tr9");
  asm("l.jr\tr9");
  asm("l.nop");
  asm("l.nop");
}
}
 
 
void jump(void)
void jump(void)
{
{
        asm("_jr:");
        asm("jr:");
        /* Read and increment index */
        /* Read and increment index */
        asm("l.lwz\t\tr3,0(r11)");
        asm("l.lwz\t\tr3,0(r11)");
        asm("l.addi\t\tr3,r3,4");
        asm("l.addi\t\tr3,r3,4");
        asm("l.sw\t\t0(r11),r3");
        asm("l.sw\t\t0(r11),r3");
        /* Load next executin address from table */
        /* Load next executin address from table */
Line 193... Line 193...
        memcpy((void *)add, (void *)&jr, 24);
        memcpy((void *)add, (void *)&jr, 24);
}
}
 
 
void call(unsigned long add)
void call(unsigned long add)
{
{
  asm("l.movhi\tr11,hi(_jump_indx)" : :);
  asm("l.movhi\tr11,hi(jump_indx)" : :);
  asm("l.ori\tr11,r11,lo(_jump_indx)" : :);
  asm("l.ori\tr11,r11,lo(jump_indx)" : :);
        asm("l.jalr\t\t%0" : : "r" (add) : "r11", "r9");
        asm("l.jalr\t\t%0" : : "r" (add) : "r11", "r9");
        asm("l.nop" : :);
        asm("l.nop" : :);
}
}
 
 
int dc_test(void)
int dc_test(void)

powered by: WebSVN 2.1.0

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