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

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable_0_2_0_rc2/] [or1ksim/] [cpu/] [or32/] [op_i386.h] - Diff between revs 1452 and 1481

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

Rev 1452 Rev 1481
Line 23... Line 23...
 
 
#define FORCE_RET asm volatile ("")
#define FORCE_RET asm volatile ("")
 
 
/* Handles the scheduler and PC updateing.  Yes, useing MMX is a requirement. It
/* Handles the scheduler and PC updateing.  Yes, useing MMX is a requirement. It
 * just won't change.  This must be as compact as possible */
 * just won't change.  This must be as compact as possible */
static inline void handle_sched(void)
#define HANDLE_SCHED(func, jmp) asm("paddd %%mm1, %%mm0\n" \
{
                                    "\tmovd %%mm0, %%eax\n" \
  asm("paddd %%mm1, %%mm0\n"
                                    "\ttestl %%eax, %%eax\n" \
      "\tmovd %%mm0, %%eax\n"
                                    "\tjg ." jmp "\n" \
      "\ttestl %%eax, %%eax\n"
                                    "\tcall "#func"\n" \
      "\tjg .no_need_run_sched\n"
                                    "\t." jmp ":" : : )
      "\tcall do_sched_wrap\n"
 
      "\t.no_need_run_sched:" : : );
 
}
 
 
 
static inline int32_t do_cycles(void)
static inline int32_t do_cycles(void)
{
{
  register uint32_t cycles;
  register uint32_t cycles;
 
 
Line 53... Line 50...
                "\tpaddd %%mm2, %%mm0"
                "\tpaddd %%mm2, %%mm0"
                : : "m" (runtime.sim.mem_cycles));
                : : "m" (runtime.sim.mem_cycles));
  runtime.sim.mem_cycles = 0;
  runtime.sim.mem_cycles = 0;
}
}
 
 
 
static inline void or_longjmp(void *loc) __attribute__((noreturn));
 
static inline void or_longjmp(void *loc)
 
{
 
  /* We push a trampoline address (dyn_ret_stack_prot) onto the stack to be able
 
   * to detect if any ret instructions found their way into an operation. */
 
  asm("\tmovl %0, %%eax\n"
 
      "\tmovl %1, %%esp\n"
 
      "\tmovl $%2, %%ebp\n"
 
      "\tpush $dyn_ret_stack_prot\n"
 
      "\tpush $dyn_ret_stack_prot\n"
 
      "\tpush $dyn_ret_stack_prot\n"
 
      "\tjmp *%%eax\n"
 
      :
 
      : "m" (loc),
 
        "m" (rec_stack_base),
 
        "m" (cpu_state));
 
}
 
 
 
 
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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