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

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [sw/] [support/] [support.c] - Diff between revs 36 and 53

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

Rev 36 Rev 53
Line 2... Line 2...
 
 
#ifndef OR32
#ifndef OR32
#include <sys/time.h>
#include <sys/time.h>
#endif
#endif
 
 
#include "spr_defs.h"
#include "or1200.h"
#include "support.h"
#include "support.h"
#include "int.h"
#include "int.h"
 
 
#ifdef UART_PRINTF
#ifdef UART_PRINTF
//#include "snprintf.h"
#include "../drivers/uart.h"
#include "vfnprintf.h"
 
#include "uart.h"
 
#endif
#endif
 
 
#if OR32
#if OR32
void int_main();
void int_main();
 
 
Line 78... Line 76...
  __asm__ __volatile__ ("  l.addi\tr3,%1,0\n \
  __asm__ __volatile__ ("  l.addi\tr3,%1,0\n \
                           l.addi\tr4,%2,0\n \
                           l.addi\tr4,%2,0\n \
                           l.nop %0": :"K" (NOP_PRINTF), "r" (fmt), "r"  (args));
                           l.nop %0": :"K" (NOP_PRINTF), "r" (fmt), "r"  (args));
}
}
 
 
/*
 
void *memcpy (void *__restrict dstvoid,
 
              __const void *__restrict srcvoid, size_t length)
 
{
 
  char *dst = dstvoid;
 
  const char *src = (const char *) srcvoid;
 
 
 
  while (length--)
 
    *dst++ = *src++;
 
  return dst;
 
}
 
*/
 
#endif
#endif
 
 
 
 
 
 
 
 
Line 113... Line 99...
/* start_TIMER                    */
/* start_TIMER                    */
void start_timer(int x)
void start_timer(int x)
{
{
}
}
 
 
/* read_TIMER                    */
 
/*  Returns a value since started in uS */
 
unsigned int read_timer(int x)
 
{
 
  unsigned long count = 0;
 
 
 
  /* Read the Time Stamp Counter */
 
/*        asm("simrdtsc %0" :"=r" (count)); */
 
  /*asm("l.sys 201"); */
 
  return count;
 
}
 
 
 
/* For writing into SPR. */
/* For writing into SPR. */
void mtspr(unsigned long spr, unsigned long value)
void mtspr(unsigned long spr, unsigned long value)
{
{
  asm("l.mtspr\t\t%0,%1,0": : "r" (spr), "r" (value));
  asm("l.mtspr\t\t%0,%1,0": : "r" (spr), "r" (value));
}
}
Line 145... Line 119...
void report(unsigned long value)
void report(unsigned long value)
{
{
  printf("report(0x%x);\n", (unsigned) value);
  printf("report(0x%x);\n", (unsigned) value);
}
}
 
 
/* start_TIMER                    */
 
void start_timer(int tmrnum)
 
{
 
}
 
 
 
/* read_TIMER                    */
 
/*  Returns a value since started in uS */
 
unsigned int read_timer(int tmrnum)
 
{
 
  struct timeval tv;
 
  struct timezone tz;
 
 
 
  gettimeofday(&tv, &tz);
 
 
 
  return(tv.tv_sec*1000000+tv.tv_usec);
 
}
 
 
 
#endif
#endif
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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