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

Subversion Repositories minsoc

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

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

Rev 2 Rev 36
Line 13... Line 13...
#include "vfnprintf.h"
#include "vfnprintf.h"
#include "uart.h"
#include "uart.h"
#endif
#endif
 
 
#if OR32
#if OR32
void excpt_dummy();
 
void int_main();
void int_main();
 
 
unsigned long excpt_buserr = (unsigned long) excpt_dummy;
void ext_except()
unsigned long excpt_dpfault = (unsigned long) excpt_dummy;
 
unsigned long excpt_ipfault = (unsigned long) excpt_dummy;
 
unsigned long excpt_tick = (unsigned long) excpt_dummy;
 
unsigned long excpt_align = (unsigned long) excpt_dummy;
 
unsigned long excpt_illinsn = (unsigned long) excpt_dummy;
 
unsigned long excpt_int = (unsigned long) int_main;
 
unsigned long excpt_dtlbmiss = (unsigned long) excpt_dummy;
 
unsigned long excpt_itlbmiss = (unsigned long) excpt_dummy;
 
unsigned long excpt_range = (unsigned long) excpt_dummy;
 
unsigned long excpt_syscall = (unsigned long) excpt_dummy;
 
unsigned long excpt_break = (unsigned long) excpt_dummy;
 
unsigned long excpt_trap = (unsigned long) excpt_dummy;
 
 
 
void hpint_except()
 
{
{
        int_main();
        int_main();
}
}
 
 
/* Start function, called by reset exception handler.  */
/* Start function, called by reset exception handler.  */
Line 57... Line 42...
static int uart_init_done = 0;
static int uart_init_done = 0;
 
 
#define PRINTFBUFFER_SIZE 512
#define PRINTFBUFFER_SIZE 512
char PRINTFBUFFER[PRINTFBUFFER_SIZE]; // Declare a global printf buffer
char PRINTFBUFFER[PRINTFBUFFER_SIZE]; // Declare a global printf buffer
 
 
void printf(const char *fmt, ...)
void minsoc_printf(const char *fmt, ...)
{
{
  // init uart if not done already
  // init uart if not done already
  if (!uart_init_done)
  if (!uart_init_done)
    {
    {
      uart_init();
      uart_init();
Line 80... Line 65...
  // now print each char via the UART
  // now print each char via the UART
  while (c < str_l)
  while (c < str_l)
    uart_putc(PRINTFBUFFER[c++]);
    uart_putc(PRINTFBUFFER[c++]);
 
 
  va_end(args);
  va_end(args);
 
 
}
}
 
 
#else
#else
/* activate printf support in simulator */
/* activate printf support in simulator */
void printf(const char *fmt, ...)
void minsoc_printf(const char *fmt, ...)
{
{
  va_list args;
  va_list args;
  va_start(args, fmt);
  va_start(args, fmt);
  __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 \
Line 180... Line 164...
  return(tv.tv_sec*1000000+tv.tv_usec);
  return(tv.tv_sec*1000000+tv.tv_usec);
}
}
 
 
#endif
#endif
 
 
 
 
void excpt_dummy() {}
 
 
 
 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.