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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [orpmon/] [include/] [support.h] - Blame information for rev 1775

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 809 simons
/* Support file for or32 tests.  This file should is included
2
   in each test. It calls main() function and add support for
3
   basic functions */
4
 
5
#ifndef SUPPORT_H
6
#define SUPPORT_H
7
 
8
#include <stdarg.h>
9
#include <stddef.h>
10
#include <limits.h>
11
 
12 921 rherveille
#include "string.h"
13
 
14 809 simons
/* Register access macros */
15
#define REG8(add) *((volatile unsigned char *)(add))
16
#define REG16(add) *((volatile unsigned short *)(add))
17
#define REG32(add) *((volatile unsigned long *)(add))
18
 
19
/* For writing into SPR. */
20
void mtspr(unsigned long spr, unsigned long value);
21
 
22
/* For reading SPR. */
23
unsigned long mfspr(unsigned long spr);
24
 
25
/* Function to be called at entry point - not defined here.  */
26
int main (int, char **);
27
 
28
/* Prints out a value */
29
void report(unsigned long value);
30
 
31 818 markom
/* Calculates a 32-bit CRC */
32
unsigned long crc32 (unsigned long crc, const unsigned char *buf, unsigned long len);
33
 
34 809 simons
/* return value by making a syscall */
35
extern void exit (int i) __attribute__ ((__noreturn__));
36
 
37 816 markom
/* some stdlib functions */
38 921 rherveille
 
39
/* defined in 'string.h'
40 816 markom
extern void *memcpy (void *dest, const void *src, unsigned long n);
41
extern void *memmove (void *dest, const void *src, unsigned long n);
42
int memcmp (void *dstvoid, const void *srcvoid, unsigned long length);
43 858 markom
extern void *memset (void * dstvoid, const char data, unsigned long length);
44
extern void *memchr(const void *s, int c, unsigned long n);
45 816 markom
extern int strlen (const char *src);
46 809 simons
extern int strcmp (const char *s1, const char *s2);
47
extern char *strcpy (char *dst0, char *src0);
48 921 rherveille
*/
49 1312 jurem
unsigned long strtoul (const char *str, char **endptr, int base);
50 809 simons
 
51 878 rherveille
/* defined in 'ctype.h'
52 816 markom
#define isspace(c) ((c) == ' ' || (c) == '\t')
53 878 rherveille
*/
54 816 markom
 
55 833 simons
extern volatile unsigned long timestamp;
56 809 simons
extern void reset_timer (void);
57
extern unsigned long get_timer (unsigned long base);
58
extern void set_timer (unsigned long t);
59 878 rherveille
extern void sleep(unsigned long sleep_time);
60 809 simons
 
61
#endif

powered by: WebSVN 2.1.0

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