forked from Imagelibrary/rtems
2007-12-10 Ralf Corsepius <ralf.corsepius@rtems.org>
* address.h, address.inl, chain.c, chain.h, system.h: Eliminate unsigned8, unsigned16, unsigned32. Use size_t, ptrdiff_t, intptr_t for 64bit compliance. * chain.c: Reflect removal of isr.h. * isr.h: Remove. * Makefile.am: Remove isr.h.
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
2007-12-10 Ralf Corsepius <ralf.corsepius@rtems.org>
|
||||
|
||||
* address.h, address.inl, chain.c, chain.h, system.h:
|
||||
Eliminate unsigned8, unsigned16, unsigned32.
|
||||
Use size_t, ptrdiff_t, intptr_t for 64bit compliance.
|
||||
* chain.c: Reflect removal of isr.h.
|
||||
* isr.h: Remove.
|
||||
* Makefile.am: Remove isr.h.
|
||||
|
||||
2003-12-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* Makefile.am: Cosmetics.
|
||||
|
||||
@@ -8,5 +8,5 @@
|
||||
|
||||
noinst_PROGRAMS = bmenu2
|
||||
|
||||
bmenu2_SOURCES = address.h chain.c isr.h address.inl chain.h bmenu2.c base.h \
|
||||
bmenu2_SOURCES = address.h chain.c address.inl chain.h bmenu2.c base.h \
|
||||
chain.inl system.h
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#ifndef __ADDRESSES_h
|
||||
#define __ADDRESSES_h
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/*
|
||||
* _Addresses_Add_offset
|
||||
*
|
||||
@@ -25,83 +27,7 @@
|
||||
|
||||
STATIC INLINE void *_Addresses_Add_offset (
|
||||
void *base,
|
||||
unsigned32 offset
|
||||
);
|
||||
|
||||
/*
|
||||
* _Addresses_Subtract_offset
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function is used to subtract an offset from a base
|
||||
* address. It returns the resulting address. This address is
|
||||
* typically converted to an access type before being used further.
|
||||
*/
|
||||
|
||||
STATIC INLINE void *_Addresses_Subtract_offset(
|
||||
void *base,
|
||||
unsigned32 offset
|
||||
);
|
||||
|
||||
/*
|
||||
* _Addresses_Add
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function is used to add two addresses. It returns the
|
||||
* resulting address. This address is typically converted to an
|
||||
* access type before being used further.
|
||||
*/
|
||||
|
||||
STATIC INLINE void *_Addresses_Add (
|
||||
void *left,
|
||||
void *right
|
||||
);
|
||||
|
||||
/*
|
||||
* _Addresses_Subtract
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function is used to subtract two addresses. It returns the
|
||||
* resulting offset.
|
||||
*/
|
||||
|
||||
STATIC INLINE unsigned32 _Addresses_Subtract (
|
||||
void *left,
|
||||
void *right
|
||||
);
|
||||
|
||||
/*
|
||||
* _Addresses_Is_aligned
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function returns TRUE if the given address is correctly
|
||||
* aligned for this processor and FALSE otherwise. Proper alignment
|
||||
* is based on correctness and efficiency.
|
||||
*/
|
||||
|
||||
STATIC INLINE boolean _Addresses_Is_aligned (
|
||||
void *address
|
||||
);
|
||||
|
||||
/*
|
||||
* _Addresses_Is_in_range
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function returns TRUE if the given address is within the
|
||||
* memory range specified and FALSE otherwise. base is the address
|
||||
* of the first byte in the memory range and limit is the address
|
||||
* of the last byte in the memory range. The base address is
|
||||
* assumed to be lower than the limit address.
|
||||
*/
|
||||
|
||||
STATIC INLINE boolean _Addresses_Is_in_range (
|
||||
void *address,
|
||||
void *base,
|
||||
void *limit
|
||||
size_t offset
|
||||
);
|
||||
|
||||
#include "address.inl"
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#ifndef __INLINE_ADDRESSES_inl
|
||||
#define __INLINE_ADDRESSES_inl
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _Addresses_Add_offset
|
||||
@@ -21,85 +23,11 @@
|
||||
|
||||
STATIC INLINE void *_Addresses_Add_offset (
|
||||
void *base,
|
||||
unsigned32 offset
|
||||
size_t offset
|
||||
)
|
||||
{
|
||||
return (base + offset);
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _Addresses_Subtract_offset
|
||||
*
|
||||
*/
|
||||
|
||||
STATIC INLINE void *_Addresses_Subtract_offset (
|
||||
void *base,
|
||||
unsigned32 offset
|
||||
)
|
||||
{
|
||||
return (base - offset);
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _Addresses_Add
|
||||
*
|
||||
* NOTE: The cast of an address to an unsigned32 makes this code
|
||||
* dependent on an addresses being thirty two bits.
|
||||
*/
|
||||
|
||||
STATIC INLINE void *_Addresses_Add (
|
||||
void *left,
|
||||
void *right
|
||||
)
|
||||
{
|
||||
return (left + (unsigned32)right);
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _Addresses_Subtract
|
||||
*
|
||||
* NOTE: The cast of an address to an unsigned32 makes this code
|
||||
* dependent on an addresses being thirty two bits.
|
||||
*/
|
||||
|
||||
STATIC INLINE unsigned32 _Addresses_Subtract (
|
||||
void *left,
|
||||
void *right
|
||||
)
|
||||
{
|
||||
return (left - right);
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _Addresses_Is_aligned
|
||||
*
|
||||
*/
|
||||
|
||||
STATIC INLINE boolean _Addresses_Is_aligned (
|
||||
void *address
|
||||
)
|
||||
{
|
||||
return ( ( (unsigned32)address % 4 ) == 0 );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _Addresses_Is_aligned
|
||||
*
|
||||
*/
|
||||
|
||||
STATIC INLINE boolean _Addresses_Is_in_range (
|
||||
void *address,
|
||||
void *base,
|
||||
void *limit
|
||||
)
|
||||
{
|
||||
return ( address >= base && address <= limit );
|
||||
}
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "system.h"
|
||||
#include "address.h"
|
||||
#include "chain.h"
|
||||
#include "isr.h"
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
@@ -31,11 +30,11 @@
|
||||
void _Chain_Initialize(
|
||||
Chain_Control *the_chain,
|
||||
void *starting_address,
|
||||
unsigned32 number_nodes,
|
||||
unsigned32 node_size
|
||||
size_t number_nodes,
|
||||
size_t node_size
|
||||
)
|
||||
{
|
||||
unsigned32 count;
|
||||
size_t count;
|
||||
Chain_Node *current;
|
||||
Chain_Node *next;
|
||||
|
||||
@@ -76,14 +75,11 @@ Chain_Node *_Chain_Get(
|
||||
Chain_Control *the_chain
|
||||
)
|
||||
{
|
||||
ISR_Level level;
|
||||
Chain_Node *return_node;
|
||||
|
||||
return_node = NULL;
|
||||
_ISR_Disable( level );
|
||||
if ( !_Chain_Is_empty( the_chain ) )
|
||||
return_node = _Chain_Get_first_unprotected( the_chain );
|
||||
_ISR_Enable( level );
|
||||
return return_node;
|
||||
}
|
||||
|
||||
@@ -108,11 +104,7 @@ void _Chain_Append(
|
||||
Chain_Node *node
|
||||
)
|
||||
{
|
||||
ISR_Level level;
|
||||
|
||||
_ISR_Disable( level );
|
||||
_Chain_Append_unprotected( the_chain, node );
|
||||
_ISR_Enable( level );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
@@ -134,11 +126,7 @@ void _Chain_Extract(
|
||||
Chain_Node *node
|
||||
)
|
||||
{
|
||||
ISR_Level level;
|
||||
|
||||
_ISR_Disable( level );
|
||||
_Chain_Extract_unprotected( node );
|
||||
_ISR_Enable( level );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
@@ -163,11 +151,7 @@ void _Chain_Insert(
|
||||
Chain_Node *node
|
||||
)
|
||||
{
|
||||
ISR_Level level;
|
||||
|
||||
_ISR_Disable( level );
|
||||
_Chain_Insert_unprotected( after_node, node );
|
||||
_ISR_Enable( level );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#ifndef __CHAIN_h
|
||||
#define __CHAIN_h
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "address.h"
|
||||
|
||||
/*
|
||||
@@ -66,8 +68,8 @@ typedef struct {
|
||||
void _Chain_Initialize(
|
||||
Chain_Control *the_chain,
|
||||
void *starting_address,
|
||||
unsigned32 number_nodes,
|
||||
unsigned32 node_size
|
||||
size_t number_nodes,
|
||||
size_t node_size
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1988-2002.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* All rights reserved.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __ISR_h
|
||||
#define __ISR_h
|
||||
|
||||
typedef unsigned32 ISR_Level;
|
||||
|
||||
#define _ISR_Disable
|
||||
#define _ISR_Enable
|
||||
|
||||
#endif
|
||||
@@ -9,10 +9,6 @@
|
||||
#ifndef __SYSTEM_h
|
||||
#define __SYSTEM_h
|
||||
|
||||
typedef unsigned int unsigned32;
|
||||
typedef unsigned short unsigned16;
|
||||
typedef unsigned char unsigned8;
|
||||
|
||||
#define STATIC static
|
||||
#define INLINE inline
|
||||
|
||||
|
||||
Reference in New Issue
Block a user