URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/or1k/trunk/ecos-2.0/packages/net/tcpip/v2_0/include/machine
- from Rev 1254 to Rev 1765
- ↔ Reverse comparison
Rev 1254 → Rev 1765
/signal.h
0,0 → 1,33
//========================================================================== |
// |
// include/machine/signal.h |
// |
// Architecture specific 'signal' support |
// |
//========================================================================== |
//####BSDCOPYRIGHTBEGIN#### |
// |
// ------------------------------------------- |
// |
// Portions of this software may have been derived from OpenBSD or other sources, |
// and are covered by the appropriate copyright disclaimers included herein. |
// |
// ------------------------------------------- |
// |
//####BSDCOPYRIGHTEND#### |
//========================================================================== |
//#####DESCRIPTIONBEGIN#### |
// |
// Author(s): gthomas |
// Contributors: gthomas |
// Date: 2000-01-10 |
// Purpose: |
// Description: |
// |
// |
//####DESCRIPTIONEND#### |
// |
//========================================================================== |
|
|
// None defined |
/param.h
0,0 → 1,141
//========================================================================== |
// |
// include/machine/param.h |
// |
// Architecture/platform specific parameters |
// |
//========================================================================== |
//####BSDCOPYRIGHTBEGIN#### |
// |
// ------------------------------------------- |
// |
// Portions of this software may have been derived from OpenBSD or other sources, |
// and are covered by the appropriate copyright disclaimers included herein. |
// |
// ------------------------------------------- |
// |
//####BSDCOPYRIGHTEND#### |
//========================================================================== |
//#####DESCRIPTIONBEGIN#### |
// |
// Author(s): gthomas |
// Contributors: gthomas |
// Date: 2000-01-10 |
// Purpose: |
// Description: |
// |
// |
//####DESCRIPTIONEND#### |
// |
//========================================================================== |
|
|
#ifndef _MACHINE_PARAM_H_ |
#define _MACHINE_PARAM_H_ |
|
#include <pkgconf/net.h> |
|
/* |
* Constants related to network buffer management. |
* MCLBYTES must be no larger than CLBYTES (the software page size), and, |
* on machines that exchange pages of input or output buffers with mbuf |
* clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple |
* of the hardware page size. |
*/ |
#define MSIZE 128 /* size of an mbuf */ |
#define MCLSHIFT 11 /* convert bytes to m_buf clusters */ |
#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */ |
#define MCLOFSET (MCLBYTES - 1) /* offset within a m_buf cluster */ |
#define CLBYTES 4096 /* size of actual cluster */ |
|
/* |
* Round p (pointer or byte index) up to a correctly-aligned value |
* for all data types (int, long, ...). The result is u_int and |
* must be cast to any desired pointer type. |
*/ |
#define ALIGNBYTES (sizeof(int) - 1) |
#define ALIGN(p) (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES) |
|
// These symbols are used in the IPV6 stuff |
// (be more defensive about external setup) |
#ifdef __linux__ |
#undef __linux__ |
#endif |
#ifdef __bsdi__ |
#undef __bsdi__ |
#endif |
#ifdef __FreeBSD__ |
#undef __FreeBSD__ |
#endif |
#ifdef __OpenBSD__ |
#undef __OpenBSD__ |
#endif |
#ifdef __NetBSD__ |
#undef __NetBSD__ |
#endif |
|
|
#define __linux__ 0 |
#define __bsdi__ 0 |
#define __FreeBSD__ 0 |
#define __OpenBSD__ 1 |
#define __NetBSD__ 0 |
|
// These definitions here to avoid needing <sys/systm.h> |
// This probably doesn't belong here, but we need these definitions |
#include <lib/libkern/libkern.h> |
#define SCARG(p,k) ((p)->k.datum) /* get arg from args pointer */ |
#include <stdarg.h> |
|
// TEMP |
|
#include <cyg/infra/diag.h> |
#include <cyg/hal/hal_intr.h> |
#include <cyg/kernel/kapi.h> |
#include <cyg/io/file.h> |
|
struct net_stats { |
int count; |
cyg_uint32 min_time, max_time, total_time; |
}; |
|
#ifdef CYGDBG_NET_TIMING_STATS |
#define START_STATS() \ |
cyg_uint32 start_time, end_time, elapsed_time; \ |
HAL_CLOCK_READ(&start_time); |
#define FINISH_STATS(stats) \ |
HAL_CLOCK_READ(&end_time); \ |
if (end_time < start_time) { \ |
elapsed_time = (end_time+CYGNUM_KERNEL_COUNTERS_RTC_PERIOD) - start_time; \ |
} else { \ |
elapsed_time = end_time - start_time; \ |
} \ |
if (stats.min_time == 0) { \ |
stats.min_time = 0x7FFFFFFF; \ |
} \ |
if (elapsed_time < stats.min_time) \ |
stats.min_time = elapsed_time; \ |
if (elapsed_time > stats.max_time) \ |
stats.max_time = elapsed_time; \ |
stats.total_time += elapsed_time; \ |
stats.count++; |
#else |
#define START_STATS() |
#define FINISH_STATS(X) |
#endif |
|
// timeout support |
typedef void (timeout_fun)(void *); |
extern cyg_uint32 timeout(timeout_fun *fun, void *arg, cyg_int32 delta); |
extern void untimeout(timeout_fun *fun, void *arg); |
extern int uiomove(caddr_t cp, int n, struct uio *uio); |
extern int copyout(const void *s, void *d, size_t len); |
extern int copyin(const void *s, void *d, size_t len); |
extern void ovbcopy(const void *s, void *d, size_t len); |
extern void get_mono_time(void); |
extern int arc4random(void); |
extern void get_random_bytes(void *buf, size_t len); |
|
extern void *hashinit(int elements, int type, int flags, u_long *hashmask); |
|
#endif // _MACHINE_PARAM_H_ |
/limits.h
0,0 → 1,38
//========================================================================== |
// |
// include/machine/limits.h |
// |
// Architecture/platform specific limits |
// |
//========================================================================== |
//####BSDCOPYRIGHTBEGIN#### |
// |
// ------------------------------------------- |
// |
// Portions of this software may have been derived from OpenBSD or other sources, |
// and are covered by the appropriate copyright disclaimers included herein. |
// |
// ------------------------------------------- |
// |
//####BSDCOPYRIGHTEND#### |
//========================================================================== |
//#####DESCRIPTIONBEGIN#### |
// |
// Author(s): gthomas |
// Contributors: gthomas |
// Date: 2000-01-10 |
// Purpose: |
// Description: |
// |
// |
//####DESCRIPTIONEND#### |
// |
//========================================================================== |
|
|
#ifndef _MACHINE_LIMITS_H_ |
#define _MACHINE_LIMITS_H_ |
|
#include <limits.h> // Compiler provided |
|
#endif /* _MACHINE_LIMITS_H_ */ |
/cdefs.h
0,0 → 1,36
//========================================================================== |
// |
// include/machine/cdefs.h |
// |
// Architecture/platform specific parameters |
// |
//========================================================================== |
//####BSDCOPYRIGHTBEGIN#### |
// |
// ------------------------------------------- |
// |
// Portions of this software may have been derived from OpenBSD or other sources, |
// and are covered by the appropriate copyright disclaimers included herein. |
// |
// ------------------------------------------- |
// |
//####BSDCOPYRIGHTEND#### |
//========================================================================== |
//#####DESCRIPTIONBEGIN#### |
// |
// Author(s): gthomas |
// Contributors: gthomas |
// Date: 2000-01-10 |
// Purpose: |
// Description: |
// |
// |
//####DESCRIPTIONEND#### |
// |
//========================================================================== |
|
|
#ifndef _MACHINE_CDEFS_H_ |
#define _MACHINE_CDEFS_H_ |
|
#endif // _MACHINE_CDEFS_H_ |
/stdarg.h
0,0 → 1,34
//========================================================================== |
// |
// include/machine/stdarg.h |
// |
// Architecture/compiler specifics |
// |
//========================================================================== |
//####BSDCOPYRIGHTBEGIN#### |
// |
// ------------------------------------------- |
// |
// Portions of this software may have been derived from OpenBSD or other sources, |
// and are covered by the appropriate copyright disclaimers included herein. |
// |
// ------------------------------------------- |
// |
//####BSDCOPYRIGHTEND#### |
//========================================================================== |
//#####DESCRIPTIONBEGIN#### |
// |
// Author(s): gthomas |
// Contributors: gthomas |
// Date: 2000-01-10 |
// Purpose: |
// Description: |
// |
// |
//####DESCRIPTIONEND#### |
// |
//========================================================================== |
|
|
// Get this from the compiler |
#include <stdarg.h> |
/types.h
0,0 → 1,87
//========================================================================== |
// |
// include/machine/types.h |
// |
// Architecture/platform specific support for data types |
// |
//========================================================================== |
//####BSDCOPYRIGHTBEGIN#### |
// |
// ------------------------------------------- |
// |
// Portions of this software may have been derived from OpenBSD or other sources, |
// and are covered by the appropriate copyright disclaimers included herein. |
// |
// ------------------------------------------- |
// |
//####BSDCOPYRIGHTEND#### |
//========================================================================== |
//#####DESCRIPTIONBEGIN#### |
// |
// Author(s): gthomas |
// Contributors: gthomas |
// Date: 2000-01-10 |
// Purpose: |
// Description: |
// |
// |
//####DESCRIPTIONEND#### |
// |
//========================================================================== |
|
|
#ifndef _MACHINE_TYPES_H_ |
#define _MACHINE_TYPES_H_ |
|
#include <sys/cdefs.h> |
#include <cyg/infra/cyg_type.h> |
#include <cyg/hal/hal_arch.h> |
|
#define __BIT_TYPES_DEFINED__ |
typedef __signed char int8_t; |
typedef unsigned char u_int8_t; |
typedef unsigned char uint8_t; |
typedef short int16_t; |
typedef unsigned short u_int16_t; |
typedef unsigned short uint16_t; |
typedef int int32_t; |
typedef unsigned int u_int32_t; |
typedef unsigned int uint32_t; |
typedef long long int64_t; |
typedef unsigned long long u_int64_t; |
typedef unsigned long long uint64_t; |
|
// Types inherited from HAL |
|
typedef CYG_ADDRESS vaddr_t; |
typedef CYG_ADDRWORD vsize_t; |
typedef CYG_ADDRESS paddr_t; |
typedef CYG_ADDRWORD psize_t; |
|
typedef CYG_ADDRESS vm_offset_t; |
typedef CYG_ADDRWORD vm_size_t; |
|
// No good HAL definition for this |
|
typedef CYG_ADDRWORD register_t; |
|
|
// From <arch/ansi.h> |
/* |
* Types which are fundamental to the implementation and may appear in |
* more than one standard header are defined here. Standard headers |
* then use: |
* #ifdef _BSD_SIZE_T_ |
* typedef _BSD_SIZE_T_ size_t; |
* #undef _BSD_SIZE_T_ |
* #endif |
*/ |
#define _BSD_SSIZE_T_ int /* byte count or error */ |
#define _BSD_CLOCKID_T_ int |
#define _BSD_TIMER_T_ int |
#ifndef __time_t_defined // As defined/used by eCos libc |
#define _BSD_CLOCK_T_ cyg_int64 /* clock() */ |
#define _BSD_TIME_T_ cyg_count32 /* time() */ |
#endif |
|
#endif // _MACHINE_TYPES_H_ |
/cpu.h
0,0 → 1,36
//========================================================================== |
// |
// include/machine/cpu.h |
// |
// Architecture/platform specific parameters |
// |
//========================================================================== |
//####BSDCOPYRIGHTBEGIN#### |
// |
// ------------------------------------------- |
// |
// Portions of this software may have been derived from OpenBSD or other sources, |
// and are covered by the appropriate copyright disclaimers included herein. |
// |
// ------------------------------------------- |
// |
//####BSDCOPYRIGHTEND#### |
//========================================================================== |
//#####DESCRIPTIONBEGIN#### |
// |
// Author(s): gthomas |
// Contributors: gthomas |
// Date: 2000-01-10 |
// Purpose: |
// Description: |
// |
// |
//####DESCRIPTIONEND#### |
// |
//========================================================================== |
|
|
#ifndef _MACHINE_CPU_H_ |
#define _MACHINE_CPU_H_ |
|
#endif // _MACHINE_CPU_H_ |