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

Subversion Repositories minsoc

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

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 2 Rev 36
/* Support file for or32 tests.  This file should is included
/* Support file for or32 tests.  This file should is included
   in each test. It calls main() function and add support for
   in each test. It calls main() function and add support for
   basic functions */
   basic functions */
 
 
#ifndef SUPPORT_H
#ifndef SUPPORT_H
#define SUPPORT_H
#define SUPPORT_H
 
 
#include <stdarg.h>
#include <stdarg.h>
#include <stddef.h>
#include <stddef.h>
#include <limits.h>
#include <limits.h>
#define OR1K 1  //ME added
#define OR1K 1  //ME added
#if OR1K
#if OR1K
 
 
/* Register access macros */
/* Register access macros */
#define REG8(add) *((volatile unsigned char *)(add))
#define REG8(add) *((volatile unsigned char *)(add))
#define REG16(add) *((volatile unsigned short *)(add))
#define REG16(add) *((volatile unsigned short *)(add))
#define REG32(add) *((volatile unsigned long *)(add))
#define REG32(add) *((volatile unsigned long *)(add))
 
 
void printf(const char *fmt, ...);
void or32_printf(const char *fmt, ...);
 
 
/* For writing into SPR. */
/* For writing into SPR. */
void mtspr(unsigned long spr, unsigned long value);
void mtspr(unsigned long spr, unsigned long value);
 
 
/* For reading SPR. */
/* For reading SPR. */
unsigned long mfspr(unsigned long spr);
unsigned long mfspr(unsigned long spr);
 
 
#else /* OR1K */
#else /* OR1K */
 
 
#include <stdio.h>
#include <stdio.h>
 
 
#endif /* OR1K */
#endif /* OR1K */
 
 
 
#define printf  or32_printf
 
 
/* Function to be called at entry point - not defined here.  */
/* Function to be called at entry point - not defined here.  */
int main ();
int main ();
 
 
/* Prints out a value */
/* Prints out a value */
void report(unsigned long value);
void report(unsigned long value);
 
 
/* return value by making a syscall */
/* return value by making a syscall */
extern void or32_exit (int i) __attribute__ ((__noreturn__));
extern void or32_exit (int i) __attribute__ ((__noreturn__));
 
 
/* memcpy clone */
/* memcpy clone */
/*
/*
extern void *memcpy (void *__restrict __dest,
extern void *memcpy (void *__restrict __dest,
                     __const void *__restrict __src, size_t __n);
                     __const void *__restrict __src, size_t __n);
*/
*/
 
 
/* Timer functions */
/* Timer functions */
extern void start_timer(int);
extern void start_timer(int);
extern unsigned int read_timer(int);
extern unsigned int read_timer(int);
 
 
extern unsigned long excpt_buserr;
extern unsigned long excpt_buserr;
extern unsigned long excpt_dpfault;
extern unsigned long excpt_dpfault;
extern unsigned long excpt_ipfault;
extern unsigned long excpt_ipfault;
extern unsigned long excpt_tick;
extern unsigned long excpt_tick;
extern unsigned long excpt_align;
extern unsigned long excpt_align;
extern unsigned long excpt_illinsn;
extern unsigned long excpt_illinsn;
extern unsigned long excpt_int;
extern unsigned long excpt_int;
extern unsigned long excpt_dtlbmiss;
extern unsigned long excpt_dtlbmiss;
extern unsigned long excpt_itlbmiss;
extern unsigned long excpt_itlbmiss;
extern unsigned long excpt_range;
extern unsigned long excpt_range;
extern unsigned long excpt_syscall;
extern unsigned long excpt_syscall;
extern unsigned long excpt_break;
extern unsigned long excpt_break;
extern unsigned long excpt_trap;
extern unsigned long excpt_trap;
 
 
#endif
 
 
#endif /* SUPPORT_H */
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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