initial changes
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
#ifndef __ALT_FLAG_H__
|
||||
#define __ALT_FLAG_H__
|
||||
|
||||
/******************************************************************************
|
||||
* *
|
||||
* License Agreement *
|
||||
* *
|
||||
* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the "Software"), *
|
||||
* to deal in the Software without restriction, including without limitation *
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
|
||||
* and/or sell copies of the Software, and to permit persons to whom the *
|
||||
* Software is furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in *
|
||||
* all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
|
||||
* DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* This agreement shall be governed in all respects by the laws of the State *
|
||||
* of California and by the laws of the United States of America. *
|
||||
* *
|
||||
* Altera does not recommend, suggest or require that this reference design *
|
||||
* file be used in conjunction or combination with any other product. *
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* *
|
||||
* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* This header provides macro definitions that can be used to create and use
|
||||
* uc/OS-II style event flags. These macros can be used in both a uC/OS-II based
|
||||
* environment, and a single threaded HAL based environment.
|
||||
*
|
||||
* The motivation for these macros is to allow code to be developed which is
|
||||
* thread safe under uC/OS-II, but incurs no additional overhead when used in a
|
||||
* single threaded HAL environment.
|
||||
*
|
||||
* In the case of a single threaded HAL environment, they compile to
|
||||
* "do nothing" directives, which ensures they do not contribute to the final
|
||||
* executable.
|
||||
*
|
||||
* The following macros are available:
|
||||
*
|
||||
* ALT_FLAG_GRP - Create a flag group instance.
|
||||
* ALT_EXTERN_FLAG_GRP - Create a reference to an external flag group instance.
|
||||
* ALT_STATIC_FLAG_GRP - Create a static flag group instance.
|
||||
* ALT_FLAG_CREATE - Initialise a flag group.
|
||||
* ALT_FLAG_PEND - Pend on a flag group.
|
||||
* ALT_FLAG_POST - Set a flag condition.
|
||||
|
||||
*
|
||||
* Input arguments and return codes are all consistant with the equivalent
|
||||
* uC/OS-II function.
|
||||
*
|
||||
* It's important to be careful in the use of the macros: ALT_FLAG_GRP,
|
||||
* ALT_EXTERN_FLAG_GRP, and ALT_STATIC_FLAG_GRP. In these three cases the
|
||||
* semi-colon is included in the macro definition; so, for example, you should
|
||||
* use:
|
||||
*
|
||||
* ALT_FLAG_GRP(mygroup)
|
||||
*
|
||||
* not:
|
||||
*
|
||||
* ALT_FLAG_GRP(mygroup);
|
||||
*
|
||||
* The inclusion of the semi-colon has been necessary to ensure the macros can
|
||||
* compile with no warnings when used in a single threaded HAL environment.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "priv/alt_no_error.h"
|
||||
|
||||
#define ALT_FLAG_GRP(group)
|
||||
#define ALT_EXTERN_FLAG_GRP(group)
|
||||
#define ALT_STATIC_FLAG_GRP(group)
|
||||
|
||||
#define ALT_FLAG_CREATE(group, flags) alt_no_error ()
|
||||
#define ALT_FLAG_PEND(group, flags, wait_type, timeout) alt_no_error ()
|
||||
#define ALT_FLAG_POST(group, flags, opt) alt_no_error ()
|
||||
|
||||
#ifndef ALT_SINGLE_THREADED
|
||||
#define ALT_SINGLE_THREADED
|
||||
#endif
|
||||
|
||||
#endif /* __ALT_FLAG_H__ */
|
||||
@@ -0,0 +1,61 @@
|
||||
#ifndef __ALT_HOOKS_H__
|
||||
#define __ALT_HOOKS_H__
|
||||
|
||||
/******************************************************************************
|
||||
* *
|
||||
* License Agreement *
|
||||
* *
|
||||
* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the "Software"), *
|
||||
* to deal in the Software without restriction, including without limitation *
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
|
||||
* and/or sell copies of the Software, and to permit persons to whom the *
|
||||
* Software is furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in *
|
||||
* all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
|
||||
* DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* This agreement shall be governed in all respects by the laws of the State *
|
||||
* of California and by the laws of the United States of America. *
|
||||
* *
|
||||
* Altera does not recommend, suggest or require that this reference design *
|
||||
* file be used in conjunction or combination with any other product. *
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* *
|
||||
* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* This header provides "do-nothing" macro definitions for operating system
|
||||
* hooks within the HAL. The O/S component can override these to provide it's
|
||||
* own implementation.
|
||||
*/
|
||||
|
||||
#define ALT_OS_TIME_TICK() while(0)
|
||||
#define ALT_OS_INIT() while(0)
|
||||
#define ALT_OS_STOP() while(0)
|
||||
|
||||
/* Call from assembly code */
|
||||
#define ALT_OS_INT_ENTER_ASM
|
||||
#define ALT_OS_INT_EXIT_ASM
|
||||
|
||||
/* Call from C code */
|
||||
#define ALT_OS_INT_ENTER() while(0)
|
||||
#define ALT_OS_INT_EXIT() while(0)
|
||||
|
||||
|
||||
#endif /* __ALT_HOOKS_H__ */
|
||||
@@ -0,0 +1,96 @@
|
||||
#ifndef __ALT_SEM_H__
|
||||
#define __ALT_SEM_H__
|
||||
|
||||
/******************************************************************************
|
||||
* *
|
||||
* License Agreement *
|
||||
* *
|
||||
* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the "Software"), *
|
||||
* to deal in the Software without restriction, including without limitation *
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
|
||||
* and/or sell copies of the Software, and to permit persons to whom the *
|
||||
* Software is furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in *
|
||||
* all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
|
||||
* DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* This agreement shall be governed in all respects by the laws of the State *
|
||||
* of California and by the laws of the United States of America. *
|
||||
* *
|
||||
* Altera does not recommend, suggest or require that this reference design *
|
||||
* file be used in conjunction or combination with any other product. *
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* *
|
||||
* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* This header provides macro definitions that can be used to create and use
|
||||
* semaphores. These macros can be used in both a uC/OS-II based environment,
|
||||
* and a single threaded HAL based environment.
|
||||
*
|
||||
* The motivation for these macros is to allow code to be developed which is
|
||||
* thread safe under uC/OS-II, but incurs no additional overhead when used in a
|
||||
* single threaded HAL environment.
|
||||
*
|
||||
* In the case of a single threaded HAL environment, they compile to
|
||||
* "do nothing" directives, which ensures they do not contribute to the final
|
||||
* executable.
|
||||
*
|
||||
* The following macros are available:
|
||||
*
|
||||
* ALT_SEM - Create a semaphore instance.
|
||||
* ALT_EXTERN_SEM - Create a reference to an external semaphore instance.
|
||||
* ALT_STATIC_SEM - Create a static semaphore instance.
|
||||
* ALT_SEM_CREATE - Initialise a semaphore.
|
||||
* ALT_SEM_PEND - Pend on a semaphore.
|
||||
* ALT_SEM_POST - Increment a semaphore.
|
||||
*
|
||||
* Input arguments and return codes are all consistant with the equivalent
|
||||
* uC/OS-II function.
|
||||
*
|
||||
* It's important to be careful in the use of the macros: ALT_SEM,
|
||||
* ALT_EXTERN_SEM, and ALT_STATIC_SEM. In these three cases the semi-colon is
|
||||
* included in the macro definition; so, for example, you should use:
|
||||
*
|
||||
* ALT_SEM(mysem)
|
||||
*
|
||||
* not:
|
||||
*
|
||||
* ALT_SEM(mysem);
|
||||
*
|
||||
* The inclusion of the semi-colon has been necessary to ensure the macros can
|
||||
* compile with no warnings when used in a single threaded HAL environment.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "priv/alt_no_error.h"
|
||||
|
||||
#define ALT_SEM(sem)
|
||||
#define ALT_EXTERN_SEM(sem)
|
||||
#define ALT_STATIC_SEM(sem)
|
||||
|
||||
#define ALT_SEM_CREATE(sem, value) alt_no_error ()
|
||||
#define ALT_SEM_PEND(sem, timeout) alt_no_error ()
|
||||
#define ALT_SEM_POST(sem) alt_no_error ()
|
||||
|
||||
#ifndef ALT_SINGLE_THREADED
|
||||
#define ALT_SINGLE_THREADED
|
||||
#endif
|
||||
|
||||
#endif /* __ALT_SEM_H__ */
|
||||
@@ -0,0 +1,75 @@
|
||||
#ifndef __ALT_SYSCALL_H__
|
||||
#define __ALT_SYSCALL_H__
|
||||
|
||||
/******************************************************************************
|
||||
* *
|
||||
* License Agreement *
|
||||
* *
|
||||
* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the "Software"), *
|
||||
* to deal in the Software without restriction, including without limitation *
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
|
||||
* and/or sell copies of the Software, and to permit persons to whom the *
|
||||
* Software is furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in *
|
||||
* all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
|
||||
* DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* This agreement shall be governed in all respects by the laws of the State *
|
||||
* of California and by the laws of the United States of America. *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* The macros defined in this file are used to provide the function names used
|
||||
* for the HAL 'UNIX style' interface, e.g. read(), write() etc.
|
||||
*
|
||||
* Operating systems which are ported to the HAL can provide their own
|
||||
* version of this file, which will be used in preference. This allows
|
||||
* the operating system to provide it's own implementation of the top level
|
||||
* system calls, while retaining the HAL functions under a different name,
|
||||
* for example, alt_read(), alt_write() etc.
|
||||
*/
|
||||
|
||||
#define ALT_CLOSE close
|
||||
#define ALT_ENVIRON environ
|
||||
#define ALT_EXECVE execve
|
||||
#define ALT_EXIT _exit
|
||||
#define ALT_FCNTL fcntl
|
||||
#define ALT_FORK fork
|
||||
#define ALT_FSTAT fstat
|
||||
#define ALT_GETPID getpid
|
||||
#define ALT_GETTIMEOFDAY gettimeofday
|
||||
#define ALT_IOCTL ioctl
|
||||
#define ALT_ISATTY isatty
|
||||
#define ALT_KILL kill
|
||||
#define ALT_LINK link
|
||||
#define ALT_LSEEK lseek
|
||||
#define ALT_OPEN open
|
||||
#define ALT_READ read
|
||||
#define ALT_RENAME _rename
|
||||
#define ALT_SBRK sbrk
|
||||
#define ALT_SETTIMEOFDAY settimeofday
|
||||
#define ALT_STAT stat
|
||||
#define ALT_UNLINK unlink
|
||||
#define ALT_USLEEP usleep
|
||||
#define ALT_WAIT wait
|
||||
#define ALT_WRITE write
|
||||
#define ALT_TIMES times
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* __ALT_SYSCALL_H__ */
|
||||
Reference in New Issue
Block a user