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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [kernel/] [current/] [include/] [ktypes.h] - Blame information for rev 851

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

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_KERNEL_KTYPES_H
2
#define CYGONCE_KERNEL_KTYPES_H
3
 
4
//==========================================================================
5
//
6
//      ktypes.h
7
//
8
//      Standard types used in the kernel and its interfaces
9
//
10
//==========================================================================
11
// ####ECOSGPLCOPYRIGHTBEGIN####                                            
12
// -------------------------------------------                              
13
// This file is part of eCos, the Embedded Configurable Operating System.   
14
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
15
//
16
// eCos is free software; you can redistribute it and/or modify it under    
17
// the terms of the GNU General Public License as published by the Free     
18
// Software Foundation; either version 2 or (at your option) any later      
19
// version.                                                                 
20
//
21
// eCos is distributed in the hope that it will be useful, but WITHOUT      
22
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
23
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
24
// for more details.                                                        
25
//
26
// You should have received a copy of the GNU General Public License        
27
// along with eCos; if not, write to the Free Software Foundation, Inc.,    
28
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
29
//
30
// As a special exception, if other files instantiate templates or use      
31
// macros or inline functions from this file, or you compile this file      
32
// and link it with other works to produce a work based on this file,       
33
// this file does not by itself cause the resulting work to be covered by   
34
// the GNU General Public License. However the source code for this file    
35
// must still be made available in accordance with section (3) of the GNU   
36
// General Public License v2.                                               
37
//
38
// This exception does not invalidate any other reasons why a work based    
39
// on this file might be covered by the GNU General Public License.         
40
// -------------------------------------------                              
41
// ####ECOSGPLCOPYRIGHTEND####                                              
42
//==========================================================================
43
//#####DESCRIPTIONBEGIN####
44
//
45
// Author(s):   nickg from an original by hmt
46
// Contributors:  nickg
47
// Date:        1997-09-08
48
// Purpose:     Define kernel specific types
49
// Description: Kernel specific types
50
// Usage:       #include <cyg/kernel/ktypes.h>
51
//              ...
52
//              cyg_priority priority; // etc
53
//              
54
//####DESCRIPTIONEND####
55
//
56
//==========================================================================
57
 
58
// -------------------------------------------------------------------------
59
// Check that a configuration file is present.
60
 
61
#ifndef CYGONCE_PKGCONF_KERNEL_H
62
#error "No Configuration file included"
63
#endif
64
 
65
// -------------------------------------------------------------------------
66
 
67
#include <cyg/infra/cyg_type.h>
68
#include <stddef.h>              // for size_t
69
 
70
// -------------------------------------------------------------------------
71
// Integer types:
72
 
73
typedef cyg_int32       cyg_code;       // General return/error/status code
74
 
75
typedef cyg_count32     cyg_priority;   // priority value
76
 
77
typedef cyg_uint32      cyg_vector;     // vector number/descriptor
78
 
79
typedef cyg_uint64      cyg_tick_count; // clock tick count value
80
 
81
// -------------------------------------------------------------------------
82
// Predefinitions of various kernel classes
83
 
84
#ifdef __cplusplus
85
 
86
class Cyg_Scheduler;
87
class Cyg_Scheduler_Implementation;
88
 
89
class Cyg_HardwareThread;
90
class Cyg_SchedThread;
91
class Cyg_SchedThread_Implementation;
92
class Cyg_Thread;
93
 
94
class Cyg_ThreadQueue;
95
class Cyg_ThreadQueue_Implementation;
96
 
97
#endif
98
 
99
 
100
// -------------------------------------------------------------------------
101
// Class and structure conversion macros.
102
// CYG_CLASSFROMFIELD translates a pointer to a field of a struct or
103
// class into a pointer to the class.
104
// CYG_OFFSETOFBASE yields the offset of a base class of a derived
105
// class.
106
// CYG_CLASSFROMBASE translates a pointer to a base class into a pointer
107
// to a selected derived class. The base class object _must_ be part of
108
// the specified derived class. This is essentially a poor mans version
109
// of the RTTI dynamic_cast operator.
110
// Caveat: These macros do not work for virtual base classes.
111
 
112
#define CYG_CLASSFROMFIELD(_type_,_member_,_ptr_)\
113
    ((_type_ *)((char *)(_ptr_)-((char *)&(((_type_ *)0)->_member_))))
114
 
115
#ifdef __cplusplus
116
 
117
#define CYG_OFFSETOFBASE(_type_,_base_)\
118
    ((char *)((_base_ *)((_type_ *)4)) - (char *)4)
119
 
120
# define CYG_CLASSFROMBASE(_class_,_base_,_ptr_)\
121
    ((_class_ *)((char *)(_ptr_) - CYG_OFFSETOFBASE(_class_,_base_)))
122
 
123
#endif
124
 
125
// -------------------------------------------------------------------------
126
#endif // CYGONCE_KERNEL_KTYPES_H
127
// EOF ktypes.h
128
 

powered by: WebSVN 2.1.0

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