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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [sw/] [lib/] [include/] [lib-utils.h] - Blame information for rev 855

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

Line No. Rev Author Line
1 393 julius
#ifndef _LIB_UTILS_H_
2
#define _LIB_UTILS_H_
3
 
4
// null from stddef.h
5
#define NULL ((void *)0)
6
// valist stuff from stddef.h
7
typedef __builtin_va_list __gnuc_va_list;
8
typedef __gnuc_va_list va_list;
9
#define va_start(v,l)   __builtin_va_start(v,l)
10
#define va_end(v)       __builtin_va_end(v)
11
#define va_arg(v,l)     __builtin_va_arg(v,l)
12
#define va_copy(d,s)    __builtin_va_copy(d,s)
13
 
14
// size_t and wchar definitions
15
typedef unsigned int size_t;
16
// wchar def
17
#ifndef __WCHAR_TYPE__
18
#define __WCHAR_TYPE__ int
19
#endif
20
#ifndef __cplusplus
21
typedef __WCHAR_TYPE__ wchar_t;
22
#endif
23
 
24
/* memcpy */
25
void* memcpy( void* s1, void* s2, size_t n);
26
 
27
/* strlen */
28
size_t strlen(const char*s);
29
 
30
/* memchr */
31
void *memchr(const void *s, int c, size_t n);
32
 
33
/* Seed for LFSR function used in rand() */
34
/* This seed was derived from running the LFSR with a seed of 1 - helps skip the
35
   first iterations which outputs the value shifting through. */
36
#define RAND_LFSR_SEED 0x14b6bc3c
37
/* Pseudo-random number generation */
38
unsigned long int rand ();
39
 
40
#endif

powered by: WebSVN 2.1.0

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