forked from Imagelibrary/rtems
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8cffa05ff7 |
343
COPYING
343
COPYING
@@ -1,343 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
12
INSTALL
12
INSTALL
@@ -2,10 +2,14 @@
|
||||
# $Id$
|
||||
#
|
||||
|
||||
Building RTEMS
|
||||
==============
|
||||
See the file README.configure.
|
||||
NOTE: The string <release> should be replaced with
|
||||
the appropriate release number of RTEMS.
|
||||
|
||||
This file only discusses the installation of .tgz files.
|
||||
For more detailed information on the installation of RTEMS,
|
||||
refer to the Release Notes manual in the file
|
||||
/pub/rtems/releases/<release>/doc/c_or_ada/relnotes.tgz on
|
||||
lancelot.gcs.redstone.army.mil.
|
||||
|
||||
UNCOMPRESSING .tgz FILES
|
||||
===========================
|
||||
@@ -49,4 +53,4 @@ NOTES:
|
||||
is the name and version of the tool in question. For example,
|
||||
gcc-2.5.8.tgz will extract its contents into the subdirectory
|
||||
gcc-2.5.8.
|
||||
|
||||
|
||||
|
||||
129
LICENSE
129
LICENSE
@@ -3,21 +3,116 @@
|
||||
#
|
||||
LICENSE INFORMATION
|
||||
|
||||
RTEMS is free software; you can redistribute it and/or modify it under
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version. RTEMS is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details. You should have received
|
||||
a copy of the GNU General Public License along with RTEMS; see
|
||||
file COPYING. If not, write to the Free Software Foundation, 675
|
||||
Mass Ave, Cambridge, MA 02139, USA.
|
||||
For the purposes of this document the Real Time Executive for
|
||||
Missile Systems (RTEMS) is defined to include all source code,
|
||||
documentation, shell utilities developed by On-Line Applications
|
||||
Research Corporation (OAR) under contract of the U.S. Army
|
||||
Missile Command. OAR obtained the copyright for RTEMS and
|
||||
subsequently assigned ownership of said copyright to the
|
||||
U.S. Government. As part of this transfer, OAR waived all
|
||||
claims of ownership for RTEMS. Since OAR no longer makes claims
|
||||
of ownership of RTEMS, OAR in no event shall be held liable
|
||||
for damages including any general, special, incidental or
|
||||
consequential damages arising out of the use or inability
|
||||
to use the RTEMS software or documentation or of the support
|
||||
services provided (including but not limited to loss of data or
|
||||
data being rendered inaccurate or losses sustained by you or
|
||||
third parties or a failure of the program to operate with any
|
||||
other programs), even if advised of the possibility of such damages.
|
||||
|
||||
Simply stated any file containing the U.S. Government
|
||||
copyright notice or relocatables derived from one or more of
|
||||
these files are covered by this agreement.
|
||||
|
||||
RTEMS may be reproduced by or for the U.S. Government pursuant
|
||||
to the copyright license under the clause at DFARS 252.227-7013.
|
||||
The following notice must appear in all copies of RTEMS and its
|
||||
derivatives:
|
||||
|
||||
COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||
On-Line Applications Research Corporation (OAR).
|
||||
All rights assigned to U.S. Government, 1994.
|
||||
|
||||
This material may be reproduced by or for the U.S. Government
|
||||
pursuant to the copyright license under the clause at DFARS
|
||||
252.227-7013. This notice must appear in all copies of this
|
||||
material and its derivatives.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code and documentation must retain the
|
||||
above copyright notice, this list of conditions and the following
|
||||
disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
Redistributions in binary form must contain or make available the
|
||||
RTEMS source code.
|
||||
|
||||
3. All advertising materials mentioning features or use of this software
|
||||
must display the following acknowledgement:
|
||||
This product includes software developed for the U.S. Government
|
||||
by On-Line Applications Research Corp.
|
||||
|
||||
4. Neither the name of the author nor the U.S. Government may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
|
||||
RTEMS is provided "AS IS" without warranty of any kind, either
|
||||
expressed or implied, including, but not limited to, the implied
|
||||
warranties of merchantability, title and fitness for a
|
||||
particular purpose. The U.S. Government does not warrant that
|
||||
the RTEMS software or documentation will satisfy your requirements
|
||||
or that the software and documentation are without defect or error
|
||||
or that the operation of the software will be uninterrupted.
|
||||
|
||||
The U.S. Government shall in no event shall be held liable for
|
||||
damages including any general, special, incidental or consequential
|
||||
damages arising out of the use or inability to use the RTEMS software
|
||||
or documentation or of the support services provided (including
|
||||
but not limited to loss of data or data being rendered
|
||||
inaccurate or losses sustained by you or third parties or a
|
||||
failure of the program to operate with any other programs), even
|
||||
if the U.S. Government has been advised of the possibility of such damages.
|
||||
|
||||
The U.S. Government reserves the right to revise this material
|
||||
and to make changes from time to time in the content hereof without
|
||||
obligation to notify anyone or any organization of such revision
|
||||
or changes.
|
||||
|
||||
OAR remains the sole organization authorized by contract to
|
||||
distribute or provide support and training for the Real-Time
|
||||
Executive for Multiprocessor Systems (RTEMS).
|
||||
|
||||
In order to promote future research activities within the U.S.
|
||||
Government, we request that potential users of RTEMS notify us
|
||||
as to the systems that RTEMS is being utilized. This will allow
|
||||
us to publicize our Dual-Use / Reuse capabilities in support of
|
||||
the current administration's goals. This can be accomplished by
|
||||
calling the RTEMS phone numbers published in the documentation
|
||||
or by electronic mail to "rtems@redstone.army.mil". Your
|
||||
cooperation is greatly appreciated. Again, thank you for using
|
||||
RTEMS.
|
||||
|
||||
RTEMS
|
||||
U.S. ARMY Missile Command
|
||||
ATTN: AMSMI-RD-GC-S
|
||||
Redstone Arsenal, AL 35898-5254
|
||||
Voice: (205) 842-6906
|
||||
FAX: (205) 842-6917
|
||||
EMAIL: rtems@redstone.army.mil
|
||||
|
||||
|
||||
On-Line Applications Research Corporation.
|
||||
2227 Drake Avenue SW
|
||||
Suite 10-F
|
||||
Huntsville, AL 35805
|
||||
(205) 883-0131
|
||||
|
||||
|
||||
|
||||
|
||||
As a special exception, including RTEMS header files in a file,
|
||||
instantiating RTEMS generics or templates, or linking other files
|
||||
with RTEMS objects to produce an executable application, does not
|
||||
by itself cause the resulting executable application to be covered
|
||||
by the GNU General Public License. This exception does not
|
||||
however invalidate any other reasons why the executable file might be
|
||||
covered by the GNU Public License.
|
||||
|
||||
76
Makefile.in
76
Makefile.in
@@ -1,76 +0,0 @@
|
||||
#
|
||||
# top level directory for RTEMS build tree
|
||||
#
|
||||
# Modified by Jiri to implement autoconf and cygnus one-tree build
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
includedir = @includedir@
|
||||
target = @target@
|
||||
manext = 1
|
||||
mandir = @mandir@/man$(manext)
|
||||
program_prefix = @program_prefix@
|
||||
|
||||
export bindir
|
||||
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
VPATH=@srcdir@
|
||||
|
||||
ifeq ($(RTEMS_BSP),)
|
||||
RTEMS_BSP = @RTEMS_BSP_LIST@
|
||||
endif
|
||||
|
||||
include $(RTEMS_ROOT)/make/main.cfg
|
||||
|
||||
MTARGETS = pre_install_src all install $(TARGET_VARIANTS) $(TARGET_VARIANTS:%=%_all) \
|
||||
$(TARGET_VARIANTS:%=%_install) $(TARGET_VARIANTS:%=%_tests) \
|
||||
clean_wrapup distclean clean_dirs clean_tools tests clean depend
|
||||
|
||||
EXIT_CMD = exit 1
|
||||
|
||||
# Don't pass flags from previous make - especially NOT CFLAGS
|
||||
# NOTE: Previous versions overrode MAKEFLAGS, but this also disables
|
||||
# a lot of useful features
|
||||
# override MAKEFLAGS=
|
||||
|
||||
$(MTARGETS):
|
||||
BASEDIR=`pwd`; \
|
||||
for bsp in $(RTEMS_BSP) xxx; \
|
||||
do if [ $$bsp != xxx ] ; then \
|
||||
cd $$BASEDIR; \
|
||||
cmd="cd c; $(MAKE) RTEMS_BSP=$$bsp $(FLAGS_TO_PASS) \
|
||||
$@" ; \
|
||||
eval $$cmd || $(EXIT_CMD); \
|
||||
fi; done;
|
||||
|
||||
## Configuration stuff
|
||||
|
||||
ACLOCAL = aclocal -I aclocal
|
||||
AUTOCONF = autoconf
|
||||
|
||||
ACLOCAL_FILES := $(wildcard $(srcdir)/aclocal/*.m4)
|
||||
ACLOCAL_M4 = aclocal.m4
|
||||
|
||||
$(ACLOCAL_M4): configure.in $(ACLOCAL_FILES)
|
||||
-cd $(RTEMS_ROOT) && $(ACLOCAL)
|
||||
|
||||
Makefile: Makefile.in config.status
|
||||
CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
config.status: $(RTEMS_ROOT)/configure
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(RTEMS_ROOT)/configure: $(RTEMS_ROOT)/configure.in $(ACLOCAL_M4)
|
||||
-cd $(RTEMS_ROOT) && $(AUTOCONF)
|
||||
|
||||
.PRECIOUS: $(ACLOCAL_M4) configure Makefile config.status
|
||||
|
||||
4
README
4
README
@@ -2,10 +2,6 @@
|
||||
# $Id$
|
||||
#
|
||||
|
||||
Building RTEMS
|
||||
==============
|
||||
See the file README.configure.
|
||||
|
||||
Directory Overview
|
||||
==================
|
||||
|
||||
|
||||
259
README.configure
259
README.configure
@@ -1,259 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
1. Autoconf support
|
||||
===================
|
||||
|
||||
This version of RTEMS is configured with GNU autoconf. RTEMS can be
|
||||
configured and built either standalone or together with the compiler
|
||||
tools in the Cygnus one-tree structure. Using autoconf also means
|
||||
that RTEMS now can be built in a separate build directory.
|
||||
|
||||
2. Installation
|
||||
===============
|
||||
|
||||
2.1 Standalone build
|
||||
|
||||
To configure RTEMS for a specific target, run configure in the build
|
||||
directory. In addition to the standard configure options, the following
|
||||
RTEMS-specific option are supported:
|
||||
|
||||
--disable-rtems-inlines
|
||||
--disable-posix
|
||||
--disable-tests
|
||||
--disable-networking
|
||||
--enable-cxx
|
||||
--enable-bare-cpu-model=<MODEL>
|
||||
--enable-bare-cpu-cflags=<FLAGS>
|
||||
--enable-gcc28 (also use enable-libcdir when disabled)
|
||||
--enable-gmake-print-directory
|
||||
--enable-libcdir=<DIRECTORY> (do not use if gcc 2.8 is enabled)
|
||||
--enable-rtemsbsp="bsp1 bsp2 ..."
|
||||
|
||||
In addition, the following standard autoconf options are frequently
|
||||
used when configuring RTEMS installations:
|
||||
|
||||
--prefix=INSTALL_DIRECTORY
|
||||
--program-prefix=
|
||||
|
||||
By default, the RTEMS posix interface is built for targets that support
|
||||
it. It can be disabled with the --disable-posix option.
|
||||
|
||||
By default, the RTEMS networking support is built for targets which
|
||||
support it. It can be specifically disabled for those targets
|
||||
with the --disable-networking option.
|
||||
|
||||
By default, the RTEMS support of C++ is disabled. It can be enabled
|
||||
with the --enable-cxx option. If the rtems++ C++ library is installed
|
||||
it will also be build.
|
||||
|
||||
By default, the RTEMS test suites are configured. The --disable-tests
|
||||
will not configure the RTEMS test suite. This is used only to speed-up
|
||||
configuration in case building the tests are not necessary.
|
||||
|
||||
By default, RTEMS is built using arguments and build rules which are
|
||||
compatible with gcc 2.7.2.2. This requires that the user specify
|
||||
the location of the Standard C Library with the --enable-libcdir
|
||||
option. If using a gcc which supports the -specs option, then
|
||||
the --enable-gcc28 option may be used to enable this feature.
|
||||
You should use the --enable-gcc28 option when using either the
|
||||
egcs source tree, testgcc snapshots, or gcc 2.8.0 or newer.
|
||||
|
||||
By default, all bsps for a target are built. The bare BSP is not built
|
||||
unless directlty specified. There are two ways of changing this:
|
||||
|
||||
+ use the --enable-rtemsbsp otion which will set the specified
|
||||
bsps as the default bsps, or
|
||||
+ set the RTEMS_BSP variable during make (see below).
|
||||
|
||||
The --enable-rtemsbsp= option configures RTEMS for a specific target
|
||||
architecture. The following targets are supported:
|
||||
|
||||
(none) will build the host-based version on Linux,
|
||||
Solaris and HPUX.
|
||||
|
||||
a29k-rtems only standalone, uses non-gnu compiler
|
||||
i386-rtems
|
||||
i386-go32-rtems see notes
|
||||
i960-rtems
|
||||
hppa1.1-rtems
|
||||
m68k-rtems
|
||||
mips64orion-rtems
|
||||
no_cpu-rtems
|
||||
powerpc-rtems
|
||||
sparc-rtems
|
||||
bare see notes
|
||||
|
||||
The cross-compiler is set to $(target)-gcc by default. This can be
|
||||
overriden by:
|
||||
|
||||
+ using the --program-prefix option to configure to specify the
|
||||
string which will prepended to the tool names. Be sure to include
|
||||
a trailing "-". For example, to use a m68k-coff toolset, use the
|
||||
--program-prefix=m68k-coff- option.
|
||||
|
||||
To build, run make in the build directory. To specify which bsps to build,
|
||||
add the RTEMS_BSP="bsp1 bsp2 .." to the make command. Specifying multiple
|
||||
BSPs to build only works from the top level build directory.
|
||||
|
||||
Installation is done under $(prefix)/rtems.
|
||||
|
||||
As an example, to build and install the mvme136 and dmv152 bsps for m68k do:
|
||||
|
||||
(path_to_rtems_src)/configure --target=m68k-rtems
|
||||
|
||||
make RTEMS_BSP="mvme136 dmv152"
|
||||
|
||||
make install RTEMS_BSP="mvme136 dmv152"
|
||||
|
||||
The sample tests are built by 'make all', do a 'make test' to build the full
|
||||
test suite.
|
||||
|
||||
2.2 Build with Cygnus one-tree release
|
||||
|
||||
To build and install RTEMS with the one-tree structure, just copy the rtems
|
||||
directory to the tree. The one-tree configure.in and Makefile.in has to be
|
||||
replaced with the RTEMS-aware versions. The build options are the same as
|
||||
for the standalone build.
|
||||
|
||||
2.3 Target Dependent Notes
|
||||
|
||||
i386-go32-rtems:
|
||||
|
||||
1. This is based on djgpp v1.xx. It needs to be updated to v2.xx.
|
||||
2. This cannot be built one-tree style since RTEMS requires some
|
||||
files which must be obtained from the binary distribution of the
|
||||
djgpp library. DJGPP can be obtained from
|
||||
http://www.delorie.com/djgpp/dl/ofc.
|
||||
3. You will need to manually install a number of files from the
|
||||
binary distribution of the DJGPP library doing something
|
||||
like the following:
|
||||
|
||||
# unzip the djgpp distribution
|
||||
cd include
|
||||
cp dpmi.h INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2/include
|
||||
cp go32.h INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2/include
|
||||
cp dos.h INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2/include
|
||||
cp pc.h INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2/include
|
||||
|
||||
cd ../lib
|
||||
cp crt* INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2
|
||||
cp libpc* INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2
|
||||
|
||||
# Make sure about destination on the next lines. It keeps the newlib
|
||||
# libc.a and the binary djgpp libc.a from conflicting.
|
||||
cp libc.a INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2/libcgo32.a
|
||||
cp libc_p.a INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2/libcgo32_p.a
|
||||
|
||||
bare:
|
||||
|
||||
1. See the README in the bare bsp source directory. This should
|
||||
contain all info you need.
|
||||
2. The bare bsp source contains a script to show how to build it.
|
||||
3. The configure flags must be used to get the bare bsp to work.
|
||||
The --enable-bare-cpu-model and --enable-bare-cpu-cflags are the
|
||||
only pieces of information. The module is usually a gcc module
|
||||
such as m68302 or mcpu32. The flags are passed directly to gcc.
|
||||
Use "" if more than one option is specified.
|
||||
|
||||
3. To use the installed RTEMS library
|
||||
=====================================
|
||||
|
||||
To use the installed RTEMS bsps to build applications, the application
|
||||
makefile has to include a bsp-specific makefile that will define the
|
||||
RTEMS variables necessary to find include files and libraries. The
|
||||
bsp-specific makefile is installed at
|
||||
|
||||
$(RTEMS_MAKEFILE_PATH)/Makefile.inc
|
||||
|
||||
For the erc32 bsp installed at /usr/local/cross, the environment
|
||||
variable RTEMS_MAKEFILE_PATH would be set as follows to the
|
||||
following:
|
||||
|
||||
/usr/local/cross/sparc-rtems/rtems/erc32/Makefile.inc
|
||||
|
||||
4. Supported target bsps
|
||||
========================
|
||||
|
||||
The following bsps are supported:
|
||||
|
||||
host-based : posix (on linux, solaris and hpux)
|
||||
|
||||
a29k : portsw
|
||||
i386 : force386 i386ex pc386
|
||||
i386-go32 : go32 go32_p5
|
||||
i960 : cvme961
|
||||
hppa1.1 : simhppa
|
||||
m68k : dmv152 efi332 efi68k gen68302 gen68340 gen68360
|
||||
gen68360_040 idp mvme136 mvme147 mvme147s mvme162 ods68302
|
||||
no_cpu : no_bsp
|
||||
mips64orion : p4600 p4650 (p4000 port with either R4600 or R4650)
|
||||
powerpc : papyrus psim helas403
|
||||
sh : gensh1
|
||||
sparc : erc32
|
||||
any : bare
|
||||
|
||||
5. Makefile structure
|
||||
=====================
|
||||
|
||||
The makefiles have been re-organised. Most gnu-based bsps now use three
|
||||
main makefiles:
|
||||
+ custom/default.cfg,
|
||||
+ custom/bsp.cfg and
|
||||
+ ompilers/gcc-target-default.cfg.
|
||||
|
||||
Default.cfg sets the deafult values of certain common build options.
|
||||
|
||||
Bsp.cfg set bsp-specific build options and can also override the
|
||||
default settings.
|
||||
|
||||
Gcc-target-default.cfg contains the common gcc definitions. Some targets
|
||||
(a29k, no_cpu, and posix) still use the old structure.
|
||||
|
||||
6. Adding a bsp
|
||||
===============
|
||||
|
||||
The top-level configure.in has to be modified if a new target is added
|
||||
or if a new bsp is to be built by default. The additions required is
|
||||
basically to add which makefiles are to be created by configure and
|
||||
to add the target to the selection statement. To re-generate
|
||||
configure, autoconf-2.12 is needed.
|
||||
|
||||
7. Tested configurations
|
||||
========================
|
||||
|
||||
All gnu-based bsps have been built on Linux.
|
||||
The native (posix) ports have been built and run only on Linux.
|
||||
|
||||
The following configurations have NOT been tested:
|
||||
|
||||
+ Anything on Nextstep, HPUX and Irix.
|
||||
+ The a29k port.
|
||||
|
||||
8. Pre-requisites
|
||||
=================
|
||||
|
||||
Gawk version 2 or higher.
|
||||
GNU make version 3.72 or higher.
|
||||
Bash.
|
||||
gcc version ???
|
||||
|
||||
TODO
|
||||
====
|
||||
|
||||
The install-if-change script requires bash. On solaris systems, this should
|
||||
be changed to ksh, since ksh is provided with solaris (bash not).
|
||||
|
||||
A fairly rescent version of gawk is needed to build RTEMS. This should be
|
||||
changed so that a plain vanilla awk also works. [NOTE: This dependency
|
||||
should disappear when the "gcc 2.8 -specs" is finished.]
|
||||
|
||||
'make install' should only install necessary files, not the full
|
||||
PROJECT_RELEASE directory as now.
|
||||
|
||||
Posix port on solaris-2.5 fails due to undefined built-in functions
|
||||
(gcc-2.7.2, might be my installation).
|
||||
|
||||
Improve support for 'make CFLAGS=xxx'.
|
||||
|
||||
27
SUPPORT
27
SUPPORT
@@ -2,24 +2,17 @@
|
||||
# $Id$
|
||||
#
|
||||
|
||||
RTEMS was developed by On-Line Applications Research Corporation (OAR)
|
||||
for the U.S. Army Missile Command. OAR offers support, customization,
|
||||
and training for RTEMS. Custom RTEMS development services includes
|
||||
porting RTEMS to new processors and the development of custom board
|
||||
support packages and device drivers. In addition, OAR is available
|
||||
to assist in the development of your real-time embedded application.
|
||||
For support and training contact:
|
||||
|
||||
For more information, email Mark Johannes at mark@OARcorp.com
|
||||
or contact OAR at:
|
||||
|
||||
On-Line Applications Research Corporation
|
||||
4910-L Corporate Drive
|
||||
On-Line Applications Research
|
||||
2227 Drake Avenue SW Suite 10-F
|
||||
Huntsville AL 35805
|
||||
Voice: (205) 722-9985
|
||||
Fax: (205 722-0985
|
||||
(205) 883-0131
|
||||
|
||||
In the past, RTEMS maintainance and enhancements were primarily funded
|
||||
by the development contracts sponsored by the U.S. Army. Now RTEMS
|
||||
is funded solely by RTEMS users. The future of RTEMS depends on
|
||||
its user base.
|
||||
OAR offers support and classes for RTEMS as well as custom
|
||||
development services such as ports to new processors and
|
||||
the development of custom board support packages and device
|
||||
drivers.
|
||||
|
||||
OAR developed RTEMS under contract to the U.S. Army Missile Command.
|
||||
|
||||
|
||||
614
aclocal.m4
vendored
614
aclocal.m4
vendored
@@ -1,614 +0,0 @@
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.2
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
dnl macro to detect mkdir
|
||||
AC_DEFUN(RTEMS_PATH_MKDIR,
|
||||
[AC_PATH_PROG(MKDIR,mkdir)
|
||||
])
|
||||
|
||||
dnl macro to check for mkdir -p
|
||||
AC_DEFUN(RTEMS_PROG_MKDIR_P,
|
||||
[
|
||||
AC_REQUIRE([RTEMS_PATH_MKDIR])
|
||||
AC_MSG_CHECKING([for working $MKDIR -p])
|
||||
AC_CACHE_VAL(rtems_cv_prog_mkdir_p,
|
||||
[rm -rf conftestdata
|
||||
if $MKDIR -p conftestdata 2>/dev/null ;then
|
||||
rtems_cv_prog_MKDIR_P="yes"
|
||||
else
|
||||
rtems_cv_prog_MKDIR_P="no"
|
||||
fi])dnl
|
||||
rm -rf conftestdata
|
||||
AC_MSG_RESULT($rtems_cv_prog_MKDIR_P)
|
||||
])
|
||||
|
||||
dnl macro to check for mkdir -m 0755
|
||||
AC_DEFUN(RTEMS_PROG_MKDIR_M,
|
||||
[
|
||||
AC_REQUIRE([RTEMS_PATH_MKDIR])
|
||||
AC_MSG_CHECKING([for working $MKDIR -m 0755])
|
||||
AC_CACHE_VAL(rtems_cv_prog_MKDIR_P,
|
||||
[rm -rf conftestdata
|
||||
if $MKDIR -m 0775 conftestdata 2>/dev/null; then
|
||||
rtems_cv_prog_MKDIR_M="yes"
|
||||
else
|
||||
rtems_cv_prog_MKDIR_M="no"
|
||||
fi])dnl
|
||||
rm -rf conftestdata
|
||||
AC_MSG_RESULT($rtems_cv_prog_MKDIR_M)
|
||||
])
|
||||
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
dnl canonicalize target name
|
||||
dnl NOTE: Most rtems targets do not fullfil autoconf's
|
||||
dnl target naming conventions "processor-vendor-os"
|
||||
dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
|
||||
dnl and we have to fix it for rtems ourselves
|
||||
|
||||
AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU,
|
||||
[AC_MSG_CHECKING(rtems target cpu)
|
||||
changequote(<<, >>)dnl
|
||||
target_cpu=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'`
|
||||
changequote([, ])dnl
|
||||
AC_MSG_RESULT($target_cpu)
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Set program_prefix
|
||||
dnl
|
||||
dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||
dnl Extracted from configure
|
||||
|
||||
AC_DEFUN(RTEMS_TOOL_PREFIX,
|
||||
[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
|
||||
if [[ "${program_prefix}" = "NONE" ]] ; then
|
||||
if [[ "${target}" = "${host}" ]] ; then
|
||||
program_prefix=
|
||||
else
|
||||
program_prefix=${target}-
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Check for target gcc
|
||||
dnl
|
||||
dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||
dnl Completely reworked
|
||||
|
||||
AC_DEFUN(RTEMS_PROG_CC,
|
||||
[
|
||||
AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
||||
AC_BEFORE([$0], [AC_PROG_CC])dnl
|
||||
AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
|
||||
|
||||
dnl Only accept gcc and cc
|
||||
dnl NOTE: This might be too restrictive for native compilation
|
||||
AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
|
||||
test -z "$CC_FOR_TARGET" \
|
||||
&& AC_MSG_ERROR([no acceptable cc found in \$PATH])
|
||||
|
||||
dnl backup
|
||||
rtems_save_CC=$CC
|
||||
rtems_save_CFLAGS=$CFLAGS
|
||||
|
||||
dnl temporarily set CC
|
||||
CC=$CC_FOR_TARGET
|
||||
|
||||
AC_PROG_CC_WORKS
|
||||
AC_PROG_CC_GNU
|
||||
|
||||
if test $ac_cv_prog_gcc = yes; then
|
||||
GCC=yes
|
||||
dnl Check whether -g works, even if CFLAGS is set, in case the package
|
||||
dnl plays around with CFLAGS (such as to build both debugging and
|
||||
dnl normal versions of a library), tasteless as that idea is.
|
||||
ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS=
|
||||
AC_PROG_CC_G
|
||||
if test "$ac_test_CFLAGS" = set; then
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
elif test $ac_cv_prog_cc_g = yes; then
|
||||
CFLAGS="-g -O2"
|
||||
else
|
||||
CFLAGS="-O2"
|
||||
fi
|
||||
else
|
||||
GCC=
|
||||
test "${CFLAGS+set}" = set || CFLAGS="-g"
|
||||
fi
|
||||
|
||||
rtems_cv_prog_gcc=$ac_cv_prog_gcc
|
||||
rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
|
||||
rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
|
||||
rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
|
||||
|
||||
dnl restore initial values
|
||||
CC=$rtems_save_CC
|
||||
CFLAGS=$rtems_save_CFLAGS
|
||||
|
||||
unset ac_cv_prog_gcc
|
||||
unset ac_cv_prog_cc_g
|
||||
unset ac_cv_prog_cc_works
|
||||
unset ac_cv_prog_cc_cross
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Check whether the target compiler accepts -specs
|
||||
dnl
|
||||
dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de
|
||||
dnl
|
||||
|
||||
AC_DEFUN(RTEMS_GCC_SPECS,
|
||||
[AC_REQUIRE([RTEMS_PROG_CC])
|
||||
AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
|
||||
[
|
||||
rtems_cv_gcc_specs=no
|
||||
if test "$rtems_cv_prog_gcc" = "yes"; then
|
||||
touch confspec
|
||||
echo 'void f(){}' >conftest.c
|
||||
if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
|
||||
rtems_cv_gcc_specs=yes
|
||||
fi
|
||||
fi
|
||||
rm -f confspec conftest*
|
||||
])])
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Check whether the target compiler accepts -pipe
|
||||
dnl
|
||||
dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de
|
||||
dnl
|
||||
|
||||
AC_DEFUN(RTEMS_GCC_PIPE,
|
||||
[AC_REQUIRE([RTEMS_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
|
||||
[
|
||||
rtems_cv_gcc_pipe=no
|
||||
if test "$rtems_cv_prog_gcc" = "yes"; then
|
||||
case "$host_os" in
|
||||
cygwin32*)
|
||||
;;
|
||||
*)
|
||||
echo 'void f(){}' >conftest.c
|
||||
if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
|
||||
rtems_cv_gcc_pipe=yes
|
||||
fi
|
||||
rm -f conftest*
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Check for target g++
|
||||
dnl
|
||||
dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||
dnl Completely reworked
|
||||
|
||||
AC_DEFUN(RTEMS_PROG_CXX,
|
||||
[
|
||||
AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
|
||||
AC_BEFORE([$0], [AC_PROG_CXX])dnl
|
||||
AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
|
||||
|
||||
dnl Only accept g++ and c++
|
||||
dnl NOTE: This might be too restrictive for native compilation
|
||||
AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++)
|
||||
test -z "$CXX_FOR_TARGET" \
|
||||
&& AC_MSG_ERROR([no acceptable c++ found in \$PATH])
|
||||
|
||||
dnl backup
|
||||
rtems_save_CXX=$CXX
|
||||
rtems_save_CXXFLAGS=$CXXFLAGS
|
||||
|
||||
dnl temporarily set CXX
|
||||
CXX=$CXX_FOR_TARGET
|
||||
|
||||
AC_PROG_CXX_WORKS
|
||||
AC_PROG_CXX_GNU
|
||||
|
||||
if test $ac_cv_prog_gxx = yes; then
|
||||
GXX=yes
|
||||
dnl Check whether -g works, even if CXXFLAGS is set, in case the package
|
||||
dnl plays around with CXXFLAGS (such as to build both debugging and
|
||||
dnl normal versions of a library), tasteless as that idea is.
|
||||
ac_test_CXXFLAGS="${CXXFLAGS+set}"
|
||||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS=
|
||||
AC_PROG_CXX_G
|
||||
if test "$ac_test_CXXFLAGS" = set; then
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
elif test $ac_cv_prog_cxx_g = yes; then
|
||||
CXXFLAGS="-g -O2"
|
||||
else
|
||||
CXXFLAGS="-O2"
|
||||
fi
|
||||
else
|
||||
GXX=
|
||||
test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
|
||||
fi
|
||||
|
||||
rtems_cv_prog_gxx=$ac_cv_prog_gxx
|
||||
rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g
|
||||
rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works
|
||||
rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross
|
||||
|
||||
CXX=$rtems_save_CXX
|
||||
CXXFLAGS=$rtems_save_CXXFLAGS
|
||||
|
||||
dnl restore initial values
|
||||
unset ac_cv_prog_gxx
|
||||
unset ac_cv_prog_cc_g
|
||||
unset ac_cv_prog_cxx_works
|
||||
unset ac_cv_prog_cxx_cross
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Set target tools
|
||||
dnl
|
||||
dnl 98/06/23 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||
dnl fixing cache/environment variable handling
|
||||
dnl adding checks for cygwin/egcs '\\'-bug
|
||||
dnl adding checks for ranlib/ar -s problem
|
||||
dnl
|
||||
dnl 98/02/12 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||
dnl
|
||||
|
||||
AC_DEFUN(RTEMS_GCC_PRINT,
|
||||
[ case $host_os in
|
||||
*cygwin32*)
|
||||
dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/'
|
||||
dnl Should be removed once cygwin/egcs reports '/' only
|
||||
$1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' `
|
||||
;;
|
||||
*)
|
||||
$1=`$CC_FOR_TARGET --print-prog-name=$2`
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
AC_DEFUN(RTEMS_PATH_TOOL,
|
||||
[
|
||||
AC_MSG_CHECKING([target's $2])
|
||||
AC_CACHE_VAL(ac_cv_path_$1,:)
|
||||
AC_MSG_RESULT([$ac_cv_path_$1])
|
||||
|
||||
if test -n "$ac_cv_path_$1"; then
|
||||
dnl retrieve the value from the cache
|
||||
$1=$ac_cv_path_$1
|
||||
else
|
||||
dnl the cache was not set
|
||||
if test -z "[$]$1" ; then
|
||||
if test "$rtems_cv_prog_gcc" = "yes"; then
|
||||
# We are using gcc, ask it about its tool
|
||||
# NOTE: Necessary if gcc was configured to use the target's
|
||||
# native tools or uses prefixes for gnutools (e.g. gas instead of as)
|
||||
RTEMS_GCC_PRINT($1,$2)
|
||||
fi
|
||||
else
|
||||
# The user set an environment variable.
|
||||
# Check whether it is an absolute path, otherwise AC_PATH_PROG
|
||||
# will override the environment variable, which isn't what the user
|
||||
# intends
|
||||
AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
|
||||
case "[$]$1" in
|
||||
/*) # valid
|
||||
AC_MSG_RESULT("yes")
|
||||
;;
|
||||
*) # invalid for AC_PATH_PROG
|
||||
AC_MSG_RESULT("no")
|
||||
AC_MSG_ERROR([***]
|
||||
[Environment variable $1 should ether]
|
||||
[be unset (preferred) or contain an absolute path])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
AC_PATH_PROG($1,"$program_prefix"$2,$3)
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
|
||||
[AC_REQUIRE([RTEMS_PROG_CC])dnl
|
||||
|
||||
dnl FIXME: What shall be done if these tools are not available?
|
||||
RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
|
||||
RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
|
||||
RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
|
||||
RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
|
||||
|
||||
dnl special treatment of ranlib
|
||||
RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
|
||||
if test "$RANLIB_FOR_TARGET" = "no"; then
|
||||
# ranlib wasn't found; check if ar -s is available
|
||||
RTEMS_AR_FOR_TARGET_S
|
||||
if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
|
||||
dnl override RANLIB_FOR_TARGET's cache
|
||||
ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
|
||||
RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
|
||||
else
|
||||
AC_MSG_ERROR([***]
|
||||
[Can't figure out how to build a library index]
|
||||
[Nether ranlib nor ar -s seem to be available] )
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl NOTE: These may not be available if not using gnutools
|
||||
RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
|
||||
RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
|
||||
[
|
||||
AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
|
||||
rtems_cv_AR_FOR_TARGET_S,
|
||||
[
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
int foo( int b )
|
||||
{ return b; }
|
||||
EOF
|
||||
if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
|
||||
&& AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
|
||||
&& test -s conftest.a ; \
|
||||
then
|
||||
rtems_cv_AR_FOR_TARGET_S="yes"
|
||||
else
|
||||
rtems_cv_AR_FOR_TARGET_S="no"
|
||||
fi
|
||||
rm -f conftest*
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
dnl check for i386 gas supporting 16 bit mode
|
||||
dnl - binutils 2.9.1.0.7 and higher
|
||||
|
||||
AC_DEFUN(RTEMS_I386_GAS_CODE16,
|
||||
if test "${target_cpu}" = "i386"; then
|
||||
AC_CACHE_CHECK([for 16 bit mode assembler support],
|
||||
rtems_cv_prog_gas_code16,
|
||||
[cat > conftest.s << EOF
|
||||
.code16
|
||||
data32
|
||||
addr32
|
||||
lgdt 0
|
||||
EOF
|
||||
if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then
|
||||
rtems_cv_prog_gas_code16=yes
|
||||
else
|
||||
rtems_cv_prog_gas_code16=no
|
||||
fi])
|
||||
RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16"
|
||||
fi
|
||||
)
|
||||
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Detect the Cygwin32 environment (unix under Win32)
|
||||
dnl
|
||||
dnl 98/06/16 David Fiddes (D.J.Fiddes@hw.ac.uk)
|
||||
dnl Hacked from automake-1.3
|
||||
|
||||
# Check to see if we're running under Cygwin32, without using
|
||||
# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
|
||||
# Otherwise set it to "no".
|
||||
|
||||
dnl RTEMS_CYGWIN32()
|
||||
AC_DEFUN(RTEMS_CYGWIN32,
|
||||
[AC_CACHE_CHECK(for Cygwin32 environment, rtems_cv_cygwin32,
|
||||
[AC_TRY_COMPILE(,[return __CYGWIN32__;],
|
||||
rtems_cv_cygwin32=yes, rtems_cv_cygwin32=no)
|
||||
rm -f conftest*])
|
||||
CYGWIN32=
|
||||
test "$rtems_cv_cygwin32" = yes && CYGWIN32=yes])
|
||||
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Set the EXE extension
|
||||
dnl
|
||||
dnl 98/06/16 David Fiddes (D.J.Fiddes@hw.ac.uk)
|
||||
dnl Hacked from automake-1.3
|
||||
|
||||
# Check to see if we're running under Win32, without using
|
||||
# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
|
||||
# Otherwise set it to "".
|
||||
|
||||
dnl RTEMS_EXEEXT()
|
||||
dnl This knows we add .exe if we're building in the Cygwin32
|
||||
dnl environment. But if we're not, then it compiles a test program
|
||||
dnl to see if there is a suffix for executables.
|
||||
AC_DEFUN(RTEMS_EXEEXT,
|
||||
[AC_REQUIRE([RTEMS_CYGWIN32])
|
||||
AC_MSG_CHECKING([for executable suffix])
|
||||
AC_CACHE_VAL(rtems_cv_exeext,
|
||||
[if test "$CYGWIN32" = yes; then
|
||||
rtems_cv_exeext=.exe
|
||||
else
|
||||
cat > rtems_c_test.c << 'EOF'
|
||||
int main() {
|
||||
/* Nothing needed here */
|
||||
}
|
||||
EOF
|
||||
${CC-cc} -o rtems_c_test $CFLAGS $CPPFLAGS $LDFLAGS rtems_c_test.c $LIBS 1>&5
|
||||
rtems_cv_exeext=`echo rtems_c_test.* | grep -v rtems_c_test.c | sed -e s/rtems_c_test//`
|
||||
rm -f rtems_c_test*])
|
||||
test x"${rtems_cv_exeext}" = x && rtems_cv_exeext=no
|
||||
fi
|
||||
EXEEXT=""
|
||||
test x"${rtems_cv_exeext}" != xno && EXEEXT=${rtems_cv_exeext}
|
||||
AC_MSG_RESULT(${rtems_cv_exeext})
|
||||
AC_SUBST(EXEEXT)])
|
||||
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Check for System V IPC calls used by Unix simulators
|
||||
dnl
|
||||
dnl 98/07/17 Dario Alcocer alcocer@netcom.com
|
||||
dnl Ralf Corsepius corsepiu@faw.uni-ulm.de
|
||||
dnl
|
||||
dnl Note: $host_os should probably *not* ever be used here to
|
||||
dnl determine if host supports System V IPC calls, since some
|
||||
dnl (e.g. FreeBSD 2.x) are configured by default to include only
|
||||
dnl a subset of the System V IPC calls. Therefore, to make sure
|
||||
dnl all of the required calls are found, test for each call explicitly.
|
||||
dnl
|
||||
dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally
|
||||
dnl modify any existing key sets. See the man pages for semget, shmget,
|
||||
dnl msgget, semctl, shmctl and msgctl for details.
|
||||
|
||||
AC_DEFUN(RTEMS_SYSV_SEM,
|
||||
[AC_REQUIRE([RTEMS_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores,
|
||||
rtems_cv_sysv_sem,
|
||||
[
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/sem.h>
|
||||
int main () {
|
||||
#if !defined(sun)
|
||||
union semun arg ;
|
||||
#else
|
||||
union semun {
|
||||
int val;
|
||||
struct semid_ds *buf;
|
||||
ushort *array;
|
||||
} arg;
|
||||
#endif
|
||||
int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
|
||||
if (id == -1)
|
||||
exit(1);
|
||||
arg.val = 0; /* avoid implicit type cast to union */
|
||||
if (semctl(id, 0, IPC_RMID, arg) == -1)
|
||||
exit(1);
|
||||
exit(0);
|
||||
}
|
||||
],
|
||||
rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN(RTEMS_SYSV_SHM,
|
||||
[AC_REQUIRE([RTEMS_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory,
|
||||
rtems_cv_sysv_shm,
|
||||
[
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
int main () {
|
||||
int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
|
||||
if (id == -1)
|
||||
exit(1);
|
||||
if (shmctl(id, IPC_RMID, 0) == -1)
|
||||
exit(1);
|
||||
exit(0);
|
||||
}
|
||||
],
|
||||
rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN(RTEMS_SYSV_MSG,
|
||||
[AC_REQUIRE([RTEMS_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages,
|
||||
rtems_cv_sysv_msg,
|
||||
[
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/msg.h>
|
||||
int main () {
|
||||
int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
|
||||
if (id == -1)
|
||||
exit(1);
|
||||
if (msgctl(id, IPC_RMID, 0) == -1)
|
||||
exit(1);
|
||||
exit(0);
|
||||
}
|
||||
],
|
||||
rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :)
|
||||
])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
dnl RTEMS_CHECK_MAKEFILE(path)
|
||||
dnl Search for Makefile.in's within the directory starting
|
||||
dnl at path and append an entry for Makefile to global variable
|
||||
dnl "makefiles" (from configure.in) for each Makefile.in found
|
||||
dnl
|
||||
AC_DEFUN(RTEMS_CHECK_MAKEFILE,
|
||||
[RTEMS_CHECK_FILES_IN($1,Makefile,makefiles)
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
dnl RTEMS_CHECK_FILES_IN(path,file,var)
|
||||
dnl path .. path relative to srcdir, where to start searching for files
|
||||
dnl file .. name of the files to search for
|
||||
dnl var .. shell variable to append files found
|
||||
|
||||
AC_DEFUN(RTEMS_CHECK_FILES_IN,
|
||||
[
|
||||
AC_MSG_CHECKING(for $2.in in $1)
|
||||
if test -d $srcdir/$1; then
|
||||
rtems_av_save_dir=`pwd`;
|
||||
cd $srcdir;
|
||||
rtems_av_tmp=`find $1 -name "$2.in" -print | sed "s/$2\.in/%/" | sort | sed "s/%/$2/"`
|
||||
$3="$$3 $rtems_av_tmp";
|
||||
cd $rtems_av_save_dir;
|
||||
AC_MSG_RESULT(done)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
|
||||
[
|
||||
AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
|
||||
rtems_cv_AR_FOR_TARGET_S,
|
||||
[
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
int foo( int b )
|
||||
{ return b; }
|
||||
EOF
|
||||
if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
|
||||
&& AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
|
||||
&& test -s conftest.a ; \
|
||||
then
|
||||
rtems_cv_AR_FOR_TARGET_S="yes"
|
||||
else
|
||||
rtems_cv_AR_FOR_TARGET_S="no"
|
||||
fi
|
||||
rm -f conftest*
|
||||
])
|
||||
])
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
dnl canonicalize target name
|
||||
dnl NOTE: Most rtems targets do not fullfil autoconf's
|
||||
dnl target naming conventions "processor-vendor-os"
|
||||
dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
|
||||
dnl and we have to fix it for rtems ourselves
|
||||
|
||||
AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU,
|
||||
[AC_MSG_CHECKING(rtems target cpu)
|
||||
changequote(<<, >>)dnl
|
||||
target_cpu=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'`
|
||||
changequote([, ])dnl
|
||||
AC_MSG_RESULT($target_cpu)
|
||||
])
|
||||
@@ -1,96 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Set target tools
|
||||
dnl
|
||||
dnl 98/06/23 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||
dnl fixing cache/environment variable handling
|
||||
dnl adding checks for cygwin/egcs '\\'-bug
|
||||
dnl adding checks for ranlib/ar -s problem
|
||||
dnl
|
||||
dnl 98/02/12 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||
dnl
|
||||
|
||||
AC_DEFUN(RTEMS_GCC_PRINT,
|
||||
[ case $host_os in
|
||||
*cygwin32*)
|
||||
dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/'
|
||||
dnl Should be removed once cygwin/egcs reports '/' only
|
||||
$1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' `
|
||||
;;
|
||||
*)
|
||||
$1=`$CC_FOR_TARGET --print-prog-name=$2`
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
AC_DEFUN(RTEMS_PATH_TOOL,
|
||||
[
|
||||
AC_MSG_CHECKING([target's $2])
|
||||
AC_CACHE_VAL(ac_cv_path_$1,:)
|
||||
AC_MSG_RESULT([$ac_cv_path_$1])
|
||||
|
||||
if test -n "$ac_cv_path_$1"; then
|
||||
dnl retrieve the value from the cache
|
||||
$1=$ac_cv_path_$1
|
||||
else
|
||||
dnl the cache was not set
|
||||
if test -z "[$]$1" ; then
|
||||
if test "$rtems_cv_prog_gcc" = "yes"; then
|
||||
# We are using gcc, ask it about its tool
|
||||
# NOTE: Necessary if gcc was configured to use the target's
|
||||
# native tools or uses prefixes for gnutools (e.g. gas instead of as)
|
||||
RTEMS_GCC_PRINT($1,$2)
|
||||
fi
|
||||
else
|
||||
# The user set an environment variable.
|
||||
# Check whether it is an absolute path, otherwise AC_PATH_PROG
|
||||
# will override the environment variable, which isn't what the user
|
||||
# intends
|
||||
AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
|
||||
case "[$]$1" in
|
||||
/*) # valid
|
||||
AC_MSG_RESULT("yes")
|
||||
;;
|
||||
*) # invalid for AC_PATH_PROG
|
||||
AC_MSG_RESULT("no")
|
||||
AC_MSG_ERROR([***]
|
||||
[Environment variable $1 should ether]
|
||||
[be unset (preferred) or contain an absolute path])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
AC_PATH_PROG($1,"$program_prefix"$2,$3)
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
|
||||
[AC_REQUIRE([RTEMS_PROG_CC])dnl
|
||||
|
||||
dnl FIXME: What shall be done if these tools are not available?
|
||||
RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
|
||||
RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
|
||||
RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
|
||||
RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
|
||||
|
||||
dnl special treatment of ranlib
|
||||
RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
|
||||
if test "$RANLIB_FOR_TARGET" = "no"; then
|
||||
# ranlib wasn't found; check if ar -s is available
|
||||
RTEMS_AR_FOR_TARGET_S
|
||||
if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
|
||||
dnl override RANLIB_FOR_TARGET's cache
|
||||
ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
|
||||
RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
|
||||
else
|
||||
AC_MSG_ERROR([***]
|
||||
[Can't figure out how to build a library index]
|
||||
[Nether ranlib nor ar -s seem to be available] )
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl NOTE: These may not be available if not using gnutools
|
||||
RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
|
||||
RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
|
||||
])
|
||||
@@ -1,24 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
dnl RTEMS_CHECK_FILES_IN(path,file,var)
|
||||
dnl path .. path relative to srcdir, where to start searching for files
|
||||
dnl file .. name of the files to search for
|
||||
dnl var .. shell variable to append files found
|
||||
|
||||
AC_DEFUN(RTEMS_CHECK_FILES_IN,
|
||||
[
|
||||
AC_MSG_CHECKING(for $2.in in $1)
|
||||
if test -d $srcdir/$1; then
|
||||
rtems_av_save_dir=`pwd`;
|
||||
cd $srcdir;
|
||||
rtems_av_tmp=`find $1 -name "$2.in" -print | sed "s/$2\.in/%/" | sort | sed "s/%/$2/"`
|
||||
$3="$$3 $rtems_av_tmp";
|
||||
cd $rtems_av_save_dir;
|
||||
AC_MSG_RESULT(done)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
dnl RTEMS_CHECK_MAKEFILE(path)
|
||||
dnl Search for Makefile.in's within the directory starting
|
||||
dnl at path and append an entry for Makefile to global variable
|
||||
dnl "makefiles" (from configure.in) for each Makefile.in found
|
||||
dnl
|
||||
AC_DEFUN(RTEMS_CHECK_MAKEFILE,
|
||||
[RTEMS_CHECK_FILES_IN($1,Makefile,makefiles)
|
||||
])
|
||||
@@ -1,21 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Detect the Cygwin32 environment (unix under Win32)
|
||||
dnl
|
||||
dnl 98/06/16 David Fiddes (D.J.Fiddes@hw.ac.uk)
|
||||
dnl Hacked from automake-1.3
|
||||
|
||||
# Check to see if we're running under Cygwin32, without using
|
||||
# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
|
||||
# Otherwise set it to "no".
|
||||
|
||||
dnl RTEMS_CYGWIN32()
|
||||
AC_DEFUN(RTEMS_CYGWIN32,
|
||||
[AC_CACHE_CHECK(for Cygwin32 environment, rtems_cv_cygwin32,
|
||||
[AC_TRY_COMPILE(,[return __CYGWIN32__;],
|
||||
rtems_cv_cygwin32=yes, rtems_cv_cygwin32=no)
|
||||
rm -f conftest*])
|
||||
CYGWIN32=
|
||||
test "$rtems_cv_cygwin32" = yes && CYGWIN32=yes])
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Set the EXE extension
|
||||
dnl
|
||||
dnl 98/06/16 David Fiddes (D.J.Fiddes@hw.ac.uk)
|
||||
dnl Hacked from automake-1.3
|
||||
|
||||
# Check to see if we're running under Win32, without using
|
||||
# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
|
||||
# Otherwise set it to "".
|
||||
|
||||
dnl RTEMS_EXEEXT()
|
||||
dnl This knows we add .exe if we're building in the Cygwin32
|
||||
dnl environment. But if we're not, then it compiles a test program
|
||||
dnl to see if there is a suffix for executables.
|
||||
AC_DEFUN(RTEMS_EXEEXT,
|
||||
[AC_REQUIRE([RTEMS_CYGWIN32])
|
||||
AC_MSG_CHECKING([for executable suffix])
|
||||
AC_CACHE_VAL(rtems_cv_exeext,
|
||||
[if test "$CYGWIN32" = yes; then
|
||||
rtems_cv_exeext=.exe
|
||||
else
|
||||
cat > rtems_c_test.c << 'EOF'
|
||||
int main() {
|
||||
/* Nothing needed here */
|
||||
}
|
||||
EOF
|
||||
${CC-cc} -o rtems_c_test $CFLAGS $CPPFLAGS $LDFLAGS rtems_c_test.c $LIBS 1>&5
|
||||
rtems_cv_exeext=`echo rtems_c_test.* | grep -v rtems_c_test.c | sed -e s/rtems_c_test//`
|
||||
rm -f rtems_c_test*])
|
||||
test x"${rtems_cv_exeext}" = x && rtems_cv_exeext=no
|
||||
fi
|
||||
EXEEXT=""
|
||||
test x"${rtems_cv_exeext}" != xno && EXEEXT=${rtems_cv_exeext}
|
||||
AC_MSG_RESULT(${rtems_cv_exeext})
|
||||
AC_SUBST(EXEEXT)])
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Check whether the target compiler accepts -pipe
|
||||
dnl
|
||||
dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de
|
||||
dnl
|
||||
|
||||
AC_DEFUN(RTEMS_GCC_PIPE,
|
||||
[AC_REQUIRE([RTEMS_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
|
||||
[
|
||||
rtems_cv_gcc_pipe=no
|
||||
if test "$rtems_cv_prog_gcc" = "yes"; then
|
||||
case "$host_os" in
|
||||
cygwin32*)
|
||||
;;
|
||||
*)
|
||||
echo 'void f(){}' >conftest.c
|
||||
if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
|
||||
rtems_cv_gcc_pipe=yes
|
||||
fi
|
||||
rm -f conftest*
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
])
|
||||
@@ -1,22 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Check whether the target compiler accepts -specs
|
||||
dnl
|
||||
dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de
|
||||
dnl
|
||||
|
||||
AC_DEFUN(RTEMS_GCC_SPECS,
|
||||
[AC_REQUIRE([RTEMS_PROG_CC])
|
||||
AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
|
||||
[
|
||||
rtems_cv_gcc_specs=no
|
||||
if test "$rtems_cv_prog_gcc" = "yes"; then
|
||||
touch confspec
|
||||
echo 'void f(){}' >conftest.c
|
||||
if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
|
||||
rtems_cv_gcc_specs=yes
|
||||
fi
|
||||
fi
|
||||
rm -f confspec conftest*
|
||||
])])
|
||||
@@ -1,26 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
dnl check for i386 gas supporting 16 bit mode
|
||||
dnl - binutils 2.9.1.0.7 and higher
|
||||
|
||||
AC_DEFUN(RTEMS_I386_GAS_CODE16,
|
||||
if test "${target_cpu}" = "i386"; then
|
||||
AC_CACHE_CHECK([for 16 bit mode assembler support],
|
||||
rtems_cv_prog_gas_code16,
|
||||
[cat > conftest.s << EOF
|
||||
.code16
|
||||
data32
|
||||
addr32
|
||||
lgdt 0
|
||||
EOF
|
||||
if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then
|
||||
rtems_cv_prog_gas_code16=yes
|
||||
else
|
||||
rtems_cv_prog_gas_code16=no
|
||||
fi])
|
||||
RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16"
|
||||
fi
|
||||
)
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
dnl macro to detect mkdir
|
||||
AC_DEFUN(RTEMS_PATH_MKDIR,
|
||||
[AC_PATH_PROG(MKDIR,mkdir)
|
||||
])
|
||||
|
||||
dnl macro to check for mkdir -p
|
||||
AC_DEFUN(RTEMS_PROG_MKDIR_P,
|
||||
[
|
||||
AC_REQUIRE([RTEMS_PATH_MKDIR])
|
||||
AC_MSG_CHECKING([for working $MKDIR -p])
|
||||
AC_CACHE_VAL(rtems_cv_prog_mkdir_p,
|
||||
[rm -rf conftestdata
|
||||
if $MKDIR -p conftestdata 2>/dev/null ;then
|
||||
rtems_cv_prog_MKDIR_P="yes"
|
||||
else
|
||||
rtems_cv_prog_MKDIR_P="no"
|
||||
fi])dnl
|
||||
rm -rf conftestdata
|
||||
AC_MSG_RESULT($rtems_cv_prog_MKDIR_P)
|
||||
])
|
||||
|
||||
dnl macro to check for mkdir -m 0755
|
||||
AC_DEFUN(RTEMS_PROG_MKDIR_M,
|
||||
[
|
||||
AC_REQUIRE([RTEMS_PATH_MKDIR])
|
||||
AC_MSG_CHECKING([for working $MKDIR -m 0755])
|
||||
AC_CACHE_VAL(rtems_cv_prog_MKDIR_P,
|
||||
[rm -rf conftestdata
|
||||
if $MKDIR -m 0775 conftestdata 2>/dev/null; then
|
||||
rtems_cv_prog_MKDIR_M="yes"
|
||||
else
|
||||
rtems_cv_prog_MKDIR_M="no"
|
||||
fi])dnl
|
||||
rm -rf conftestdata
|
||||
AC_MSG_RESULT($rtems_cv_prog_MKDIR_M)
|
||||
])
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Check for target gcc
|
||||
dnl
|
||||
dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||
dnl Completely reworked
|
||||
|
||||
AC_DEFUN(RTEMS_PROG_CC,
|
||||
[
|
||||
AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
||||
AC_BEFORE([$0], [AC_PROG_CC])dnl
|
||||
AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
|
||||
|
||||
dnl Only accept gcc and cc
|
||||
dnl NOTE: This might be too restrictive for native compilation
|
||||
AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
|
||||
test -z "$CC_FOR_TARGET" \
|
||||
&& AC_MSG_ERROR([no acceptable cc found in \$PATH])
|
||||
|
||||
dnl backup
|
||||
rtems_save_CC=$CC
|
||||
rtems_save_CFLAGS=$CFLAGS
|
||||
|
||||
dnl temporarily set CC
|
||||
CC=$CC_FOR_TARGET
|
||||
|
||||
AC_PROG_CC_WORKS
|
||||
AC_PROG_CC_GNU
|
||||
|
||||
if test $ac_cv_prog_gcc = yes; then
|
||||
GCC=yes
|
||||
dnl Check whether -g works, even if CFLAGS is set, in case the package
|
||||
dnl plays around with CFLAGS (such as to build both debugging and
|
||||
dnl normal versions of a library), tasteless as that idea is.
|
||||
ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS=
|
||||
AC_PROG_CC_G
|
||||
if test "$ac_test_CFLAGS" = set; then
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
elif test $ac_cv_prog_cc_g = yes; then
|
||||
CFLAGS="-g -O2"
|
||||
else
|
||||
CFLAGS="-O2"
|
||||
fi
|
||||
else
|
||||
GCC=
|
||||
test "${CFLAGS+set}" = set || CFLAGS="-g"
|
||||
fi
|
||||
|
||||
rtems_cv_prog_gcc=$ac_cv_prog_gcc
|
||||
rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
|
||||
rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
|
||||
rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
|
||||
|
||||
dnl restore initial values
|
||||
CC=$rtems_save_CC
|
||||
CFLAGS=$rtems_save_CFLAGS
|
||||
|
||||
unset ac_cv_prog_gcc
|
||||
unset ac_cv_prog_cc_g
|
||||
unset ac_cv_prog_cc_works
|
||||
unset ac_cv_prog_cc_cross
|
||||
])
|
||||
@@ -1,65 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Check for target g++
|
||||
dnl
|
||||
dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||
dnl Completely reworked
|
||||
|
||||
AC_DEFUN(RTEMS_PROG_CXX,
|
||||
[
|
||||
AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
|
||||
AC_BEFORE([$0], [AC_PROG_CXX])dnl
|
||||
AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
|
||||
|
||||
dnl Only accept g++ and c++
|
||||
dnl NOTE: This might be too restrictive for native compilation
|
||||
AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++)
|
||||
test -z "$CXX_FOR_TARGET" \
|
||||
&& AC_MSG_ERROR([no acceptable c++ found in \$PATH])
|
||||
|
||||
dnl backup
|
||||
rtems_save_CXX=$CXX
|
||||
rtems_save_CXXFLAGS=$CXXFLAGS
|
||||
|
||||
dnl temporarily set CXX
|
||||
CXX=$CXX_FOR_TARGET
|
||||
|
||||
AC_PROG_CXX_WORKS
|
||||
AC_PROG_CXX_GNU
|
||||
|
||||
if test $ac_cv_prog_gxx = yes; then
|
||||
GXX=yes
|
||||
dnl Check whether -g works, even if CXXFLAGS is set, in case the package
|
||||
dnl plays around with CXXFLAGS (such as to build both debugging and
|
||||
dnl normal versions of a library), tasteless as that idea is.
|
||||
ac_test_CXXFLAGS="${CXXFLAGS+set}"
|
||||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS=
|
||||
AC_PROG_CXX_G
|
||||
if test "$ac_test_CXXFLAGS" = set; then
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
elif test $ac_cv_prog_cxx_g = yes; then
|
||||
CXXFLAGS="-g -O2"
|
||||
else
|
||||
CXXFLAGS="-O2"
|
||||
fi
|
||||
else
|
||||
GXX=
|
||||
test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
|
||||
fi
|
||||
|
||||
rtems_cv_prog_gxx=$ac_cv_prog_gxx
|
||||
rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g
|
||||
rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works
|
||||
rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross
|
||||
|
||||
CXX=$rtems_save_CXX
|
||||
CXXFLAGS=$rtems_save_CXXFLAGS
|
||||
|
||||
dnl restore initial values
|
||||
unset ac_cv_prog_gxx
|
||||
unset ac_cv_prog_cc_g
|
||||
unset ac_cv_prog_cxx_works
|
||||
unset ac_cv_prog_cxx_cross
|
||||
])
|
||||
@@ -1,96 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Check for System V IPC calls used by Unix simulators
|
||||
dnl
|
||||
dnl 98/07/17 Dario Alcocer alcocer@netcom.com
|
||||
dnl Ralf Corsepius corsepiu@faw.uni-ulm.de
|
||||
dnl
|
||||
dnl Note: $host_os should probably *not* ever be used here to
|
||||
dnl determine if host supports System V IPC calls, since some
|
||||
dnl (e.g. FreeBSD 2.x) are configured by default to include only
|
||||
dnl a subset of the System V IPC calls. Therefore, to make sure
|
||||
dnl all of the required calls are found, test for each call explicitly.
|
||||
dnl
|
||||
dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally
|
||||
dnl modify any existing key sets. See the man pages for semget, shmget,
|
||||
dnl msgget, semctl, shmctl and msgctl for details.
|
||||
|
||||
AC_DEFUN(RTEMS_SYSV_SEM,
|
||||
[AC_REQUIRE([RTEMS_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores,
|
||||
rtems_cv_sysv_sem,
|
||||
[
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/sem.h>
|
||||
int main () {
|
||||
#if !defined(sun)
|
||||
union semun arg ;
|
||||
#else
|
||||
union semun {
|
||||
int val;
|
||||
struct semid_ds *buf;
|
||||
ushort *array;
|
||||
} arg;
|
||||
#endif
|
||||
int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
|
||||
if (id == -1)
|
||||
exit(1);
|
||||
arg.val = 0; /* avoid implicit type cast to union */
|
||||
if (semctl(id, 0, IPC_RMID, arg) == -1)
|
||||
exit(1);
|
||||
exit(0);
|
||||
}
|
||||
],
|
||||
rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN(RTEMS_SYSV_SHM,
|
||||
[AC_REQUIRE([RTEMS_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory,
|
||||
rtems_cv_sysv_shm,
|
||||
[
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
int main () {
|
||||
int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
|
||||
if (id == -1)
|
||||
exit(1);
|
||||
if (shmctl(id, IPC_RMID, 0) == -1)
|
||||
exit(1);
|
||||
exit(0);
|
||||
}
|
||||
],
|
||||
rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN(RTEMS_SYSV_MSG,
|
||||
[AC_REQUIRE([RTEMS_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages,
|
||||
rtems_cv_sysv_msg,
|
||||
[
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/msg.h>
|
||||
int main () {
|
||||
int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
|
||||
if (id == -1)
|
||||
exit(1);
|
||||
if (msgctl(id, IPC_RMID, 0) == -1)
|
||||
exit(1);
|
||||
exit(0);
|
||||
}
|
||||
],
|
||||
rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :)
|
||||
])
|
||||
])
|
||||
@@ -1,20 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Set program_prefix
|
||||
dnl
|
||||
dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
|
||||
dnl Extracted from configure
|
||||
|
||||
AC_DEFUN(RTEMS_TOOL_PREFIX,
|
||||
[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
|
||||
if [[ "${program_prefix}" = "NONE" ]] ; then
|
||||
if [[ "${target}" = "${host}" ]] ; then
|
||||
program_prefix=
|
||||
else
|
||||
program_prefix=${target}-
|
||||
fi
|
||||
fi
|
||||
])
|
||||
@@ -13,14 +13,14 @@ much better product.
|
||||
|
||||
The following persons/organizations have made contributions:
|
||||
|
||||
+ Dr. Mikhail (Misha) Savitski (mikhail.savitski@styrex.se) of the EISCAT
|
||||
Scientific Association submitted the BSP and other miscellaneous support
|
||||
for the Motorola MVME162 (M68040LC CPU) VMEbus single board computer.
|
||||
+ Dr. Mikhail (Misha) Savitski (mms@eiscathq.irf.se) of the EISCAT Scientific
|
||||
Association submitted the BSP and other miscellaneous support for the
|
||||
Motorola MVME162 (M68040LC CPU) VMEbus single board computer.
|
||||
|
||||
+ Division Inc. of Chapel Hill, NC for sponsoring On-Line Applications
|
||||
Research to port RTEMS to the Hewlett-Packard PA-RISC architecture (V1.1)
|
||||
and the addition of HP-UX as a development host. Tony Bennett
|
||||
(tbennett@chapelhill.hp.com) was assisted in this effort by Joel Sherrill
|
||||
(tbennett@divnc.com) was assisted in this effort by Joel Sherrill
|
||||
(joel@OARcorp.com). Tony also deserves a big pat on the back for
|
||||
contributing significantly to the overall organization of the development
|
||||
environment and directory structure. RTEMS is much easier to build
|
||||
@@ -47,7 +47,7 @@ The following persons/organizations have made contributions:
|
||||
+ Bryce Cogswell (cogswell@cs.uoregon.edu) submitted the support for MS-DOS
|
||||
as a development environment as well as djgpp/go32 as a target environment.
|
||||
|
||||
+ Andy Bray (andy@chaos.org.uk) of I-CUBED Ltd. in Cambridge U.K.
|
||||
+ Andy Bray (andy@i-cubed.demon.co.uk) of I-CUBED Ltd. in Cambridge U.K.
|
||||
for porting RTEMS to the PowerPC. This effort included support for the
|
||||
IBM 403 as well as the Motorola 601, 603, and 604 variants. A special
|
||||
thanks to Dom Latter (dom@i-cubed.demon.co.uk) for being an RTEMS
|
||||
@@ -77,64 +77,7 @@ The following persons/organizations have made contributions:
|
||||
|
||||
+ Dominique le Campion (Dominique.LECAMPION@enst-bretagne.fr), for
|
||||
Telecom Bretagne and T.N.I. (Brest, France) submitted the BSP for
|
||||
the Motorola MVME147 board (68030 CPU + 68881 FPU) and the MVME147s
|
||||
variant of this board.
|
||||
|
||||
+ Craig Lebakken (lebakken@minn.net) and Derrick Ostertag
|
||||
(ostertag@transition.com) of Transition Networks of Eden Prairie, MN
|
||||
for porting RTEMS to the MIPS and AMD 29K architectures. This submission
|
||||
includes complete support for the R4650 as well as partial support
|
||||
for the R4600.
|
||||
|
||||
+ Erik Ivanenko (ccms@utcc.utoronto.ca) of the University of Toronto
|
||||
for submitting the i386ex bsp.
|
||||
|
||||
+ Jiri Gaisler (jgais@wd.estec.esa.nl) converted RTEMS to using GNU
|
||||
autoconf. This effort is greatly appreciated.
|
||||
|
||||
+ Eric Norum (eric@skatter.usask.ca) of the Saskatchewan Accelerator
|
||||
Laboratory submitted a BSP for the m68360 when operating in companion
|
||||
mode with a m68040 and a port of the Motorola MC68040 Floating Point
|
||||
Support Package (FPSP) to RTEMS.
|
||||
|
||||
+ Eric Norum (eric@skatter.usask.ca) of the Saskatchewan Accelerator
|
||||
Laboratory submitted a port of the KA9Q TCP/IP stack to RTEMS as
|
||||
well as a network device driver for the gen68360 BSP. To address
|
||||
performance issues and licensing concerns, Eric followed this up
|
||||
by replacing the KA9Q TCP/IP stack with a port of the FreeBSD stack.
|
||||
|
||||
+ Chris Johns (cjohns@plessey.com.au) submitted the ods68302 BSP which
|
||||
offers easier configuration than its counterpart gen68302. Chris
|
||||
also submitted the RTEMS++ C++ class library and test code for
|
||||
that library.
|
||||
|
||||
+ Katsutoshi Shibuya (shibuya@mxb.meshnet.or.jp) of BU-Denken Co., Ltd.
|
||||
(Sapporo, Japan) submitted the extended console driver for the
|
||||
MVME162LX BSP and the POSIX tcsetattr() and tcgetattr() routines.
|
||||
This device driver supports four serial ports, cooked IO, and
|
||||
provides a portable base for Zilog 8530 based console drivers.
|
||||
|
||||
+ Eric Norum (eric@skatter.usask.ca) and Katsutoshi Shibuya
|
||||
(shibuya@mxb.meshnet.or.jp) jointly developed the termios support.
|
||||
|
||||
+ Ralf Corsepius (corsepiu@faw.uni-ulm.de) of the Research Institute for
|
||||
Applied Knowledge Processing at the University of Ulm (FAW), Germany,
|
||||
for numerous enhancements to the RTEMS autoconf support as well as
|
||||
for the Hitachi SH port.
|
||||
|
||||
+ Dario Alcocer <alcocer@connectnet.com> submitted a port of the
|
||||
RTEMS port to FreeBSD.
|
||||
|
||||
+ David Fiddes <D.J.Fiddes@hw.ac.uk>, Rod Barman (rodb@ptgrey.com) and
|
||||
Stewart Kingdon (kingdon@ptgrey.com) submitted Motorola ColdFire
|
||||
support. This work was supported in part by Real World Interface, Inc.
|
||||
|
||||
+ Geoffroy Montel (g_montel@yahoo.com), for CNET/DSM (Rennes, France),
|
||||
submitted the BSP for Motorola 68340/68349 based boards.
|
||||
|
||||
+ Thomas Doerfler (td@imd.m.isar.de) of IMD in
|
||||
Puchheim,Germany submitted some improvements to the PPC403
|
||||
support and added the helas403 BSP.
|
||||
the Motorola MVME147 board (68030 CPU + 68881 FPU).
|
||||
|
||||
Finally, the RTEMS project would like to thank those who have contributed
|
||||
to the other free software efforts which RTEMS utilizes. The primary RTEMS
|
||||
|
||||
133
c/Makefile.in
133
c/Makefile.in
@@ -1,133 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# top level directory for RTEMS build tree
|
||||
# This Makefile is *not* a good example of a directory Makefile.
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
includedir = @includedir@
|
||||
target = @target@
|
||||
manext = 1
|
||||
mandir = @mandir@/man$(manext)
|
||||
program_prefix = @program_prefix@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/directory.cfg
|
||||
|
||||
SUB_DIRS=build-tools src
|
||||
|
||||
# We only make the install point for the networking header files if needed.
|
||||
LIBNETWORKING_yes_V = lib/include/networking lib/include/networking/sys \
|
||||
lib/include/networking/machine lib/include/networking/rtems \
|
||||
lib/include/networking/vm lib/include/networking/net \
|
||||
lib/include/networking/netinet lib/include/networking/arpa \
|
||||
lib/include/networking/nfs
|
||||
LIBNETWORKING = $(LIBNETWORKING_$(HAS_NETWORKING)_V)
|
||||
|
||||
# We only make the rtems++ install point if it is enabled.
|
||||
LIBRTEMSCPLUSPLUS_yes_V = lib/include/rtems++
|
||||
LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V)
|
||||
|
||||
# directories to be created in install point
|
||||
CREATE_DIRS = \
|
||||
lib lib/include lib/include/sys lib/include/rtems \
|
||||
lib/include/rtems/score lib/include/rtems/rtems lib/include/rtems/posix \
|
||||
lib/include/libc lib/include/libc/sys \
|
||||
lib/include/motorola lib/include/zilog \
|
||||
$(LIBNETWORKING) \
|
||||
$(LIBRTEMSCPLUSPLUS) \
|
||||
bin samples \
|
||||
tests tests/screens tests/screens/sptests \
|
||||
tests/screens/psxtests tests/screens/mptests \
|
||||
tests/screens/mptests/node1 tests/screens/mptests/node2 \
|
||||
build-tools update-tools
|
||||
|
||||
# Make all/install must include 'env'
|
||||
# if something is added to TARGET_VARIANTS, then account for it here
|
||||
make_src_makefiles: Makefile.in Makefile
|
||||
-find . -name Makefile \
|
||||
-exec grep -l "^preinstall" {} \; > make_src_makefiles.tmp
|
||||
-grep tools make_src_makefiles.tmp > make_src_makefiles
|
||||
-grep -v tools make_src_makefiles.tmp >> make_src_makefiles
|
||||
-rm make_src_makefiles.tmp
|
||||
|
||||
|
||||
pre_install_src: env make_src_makefiles
|
||||
cd build-tools/scripts; $(MAKE)
|
||||
@echo "Order of preinstall directories"
|
||||
cat make_src_makefiles
|
||||
@echo
|
||||
CURRDIR=`pwd`; \
|
||||
for i in `cat make_src_makefiles` ; do \
|
||||
DIR=`dirname $$i`; \
|
||||
cd $$DIR; \
|
||||
$(MAKE) preinstall; \
|
||||
cd $$CURRDIR; \
|
||||
done
|
||||
all: pre_install_src env
|
||||
debug: pre_install_src env
|
||||
profile: pre_install_src env
|
||||
|
||||
install: all install_files
|
||||
debug_install: env debug install_files
|
||||
profile_install: env profile install_files
|
||||
|
||||
debug_all: debug
|
||||
profile_all: profile
|
||||
|
||||
# top level clean/clobber will delete the install points
|
||||
clean_WRAPUP = $(MAKE) clean_wrapup
|
||||
clobber_WRAPUP = $(MAKE) clean_wrapup
|
||||
|
||||
clean_wrapup: clean_tools clean_dirs clean_modules
|
||||
|
||||
.PHONY: dirs clean_wrapup clean_dirs clean_tools clean_modules env install
|
||||
|
||||
dirs:
|
||||
-$(MKDIR) ${CREATE_DIRS:%=$(PROJECT_ROOT)/$(RTEMS_BSP)/%}
|
||||
if test -d $(PROJECT_ROOT)/c/src/lib/libhwapi; then \
|
||||
(cd $(PROJECT_ROOT)/c/src/lib/libhwapi ; $(MAKE) mkdirs) \
|
||||
fi
|
||||
|
||||
distclean: clobber
|
||||
|
||||
clean_dirs:
|
||||
$(RM) -r $(PROJECT_RELEASE)
|
||||
|
||||
clean_tools:
|
||||
cd build-tools; $(MAKE) clean
|
||||
|
||||
$(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc: $(PROJECT_ROOT)/make/Templates/Makefile.inc
|
||||
echo "RTEMS_BSP = $(RTEMS_BSP)" > $@
|
||||
$(CAT) $< >> $@
|
||||
|
||||
# NOTE: The wildcard on the install should pick up everything except
|
||||
# the tests directory. This significantly minimizes the install size.
|
||||
|
||||
install_files: $(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc
|
||||
-$(MKDIR) $(prefix)/
|
||||
-$(MKDIR) $(prefix)/rtems
|
||||
-$(RM) -rf $(prefix)/rtems/$(RTEMS_BSP)
|
||||
cd ../; tar cf - $(RTEMS_BSP)/[bilsuM]* | \
|
||||
(cd $(prefix)/rtems; tar xpBf - )
|
||||
cd ../make; $(MAKE) RTEMS_BSP=$(RTEMS_BSP) install
|
||||
|
||||
tests:
|
||||
cd src/tests; $(MAKE) all
|
||||
|
||||
debug_tests: debug
|
||||
cd src/tests; $(MAKE) debug
|
||||
|
||||
profile_tests: profile
|
||||
cd src/tests; $(MAKE) profile
|
||||
|
||||
env: $(SRCS) dirs
|
||||
61
c/PROBLEMS
61
c/PROBLEMS
@@ -4,19 +4,23 @@
|
||||
|
||||
This is the list of outstanding problems in this release.
|
||||
|
||||
+ AMD 29k port is based on a non-GNU toolset.
|
||||
|
||||
+ The POSIX threads and real time extensions code in this tree does
|
||||
not work yet and is intentionally not in the normal build path.
|
||||
|
||||
+ The test spfatal is out of date and as a result will NOT execute
|
||||
correctly. The addition of POSIX and consequent ongoing initialization
|
||||
reorganization makes it pointless to fix this until the POSIX support
|
||||
is completely in place.
|
||||
|
||||
+ The m68k family has become quite large and an understanding of the
|
||||
compatibility of the peripherals on the various members of the 683xx
|
||||
family would allow someone to designate some of the drivers submitted
|
||||
for the gen683xx BSPs as useful on other members.
|
||||
+ The m68000 support is nearly complete now. The missing piece
|
||||
inside the executive proper is support for the software interrupt
|
||||
stack. Also, the m68k family has become quite large and an
|
||||
understanding of the compatibility of the peripherals on the various
|
||||
members of the 683xx family would allow someone to designate some
|
||||
of the drivers submitted for the gen683xx BSPs as useful on other
|
||||
members.
|
||||
|
||||
+ The only supported i960 family member is the CA. No support for the
|
||||
+ The only i960 family member tested is the CA. No support for the
|
||||
floating point support found in other family members is present.
|
||||
This also implies that RTEMS may "think" of something as generic
|
||||
across the i960 family when in fact it is specific to the CA.
|
||||
@@ -27,9 +31,14 @@ This is the list of outstanding problems in this release.
|
||||
It is better to define these in the linkcmds file. It is also nice
|
||||
to use the linkcmds file to place overlays for on-board hardware.
|
||||
|
||||
+ Not all of the BSP console drivers have been converted to termios.
|
||||
Look at the m68k/gen68360, sparc/erc32, and powerpc/psim BSPs for
|
||||
examples.
|
||||
+ The __read() system call in all of the BSPs using single
|
||||
character input/output needs to be smarter. The following
|
||||
issues need to be addressed:
|
||||
|
||||
+ echoing of characters on input
|
||||
+ CR/NL echoing
|
||||
+ backspaces
|
||||
+ tabs
|
||||
|
||||
+ UNIX port notes:
|
||||
|
||||
@@ -37,37 +46,21 @@ This is the list of outstanding problems in this release.
|
||||
|
||||
+ There are conflicts between the names of native library routines
|
||||
which MUST be used and those in the POSIX support. This must
|
||||
be addressed. The POSIX API cannot be used with this port as a
|
||||
result of this.
|
||||
|
||||
+ Someone suggested writing a mini-system call interface to
|
||||
include with RTEMS which would eliminate name conflicts. This
|
||||
would allow the RTEMS POSIX API to be tested in this configuration.
|
||||
be addressed.
|
||||
|
||||
+ Some of the tests may execute correctly and not produce the exact
|
||||
ordering of lines in the screen file. This appears to be a combination
|
||||
of a number of factors including buffering, processor speed, IO
|
||||
device overhead, and clock interrupt rate. The biggest problem is that
|
||||
some tests depend on polled IO with no unexpected context switches.
|
||||
These may not be resolvable while maintaining the spirit of the test.
|
||||
device overhead, and clock interrupt rate.
|
||||
|
||||
+ The compiler configuration files (c/make/gcc-XYZ.cfg) are largely
|
||||
the same when the different targets have the same CPU. It would
|
||||
be desirable to have a gcc-CPU.cfg or gcc-CPU_MODEL.cfg (e.g.
|
||||
gcc-m68k.cfg or gcc-m68020.cfg) and have the file gcc-TARGET.cfg
|
||||
include this and possibly override default settings.
|
||||
|
||||
+ The clock device drivers should really avoid doing the division
|
||||
by 1000 in the clock tick ISR to convert microseconds into
|
||||
milliseconds. This only applies to clock drivers which generate
|
||||
an ISR each millisecond and only call rtems_clock_tick every
|
||||
so many ISRs.
|
||||
|
||||
+ Cross-check configure --enable-* flags.
|
||||
+ warn/refuse to configure when --enable-libcdir and
|
||||
--enable-gcc28 are given.
|
||||
+ force --enable-libcdir when --disable-gcc28 is given
|
||||
|
||||
+ make profile does not currently work for a variety of reasons. Few
|
||||
BSPs include profile versions of the libraries in their bsp_specs
|
||||
file. There is no mechanism to sample data for gperf to process.
|
||||
All of this will need to be addressed before "make profile" is truly
|
||||
useful.
|
||||
|
||||
+ Bare BSP does not compile for all configurations yet. This is
|
||||
primarily due to libcpu support code assuming that the BSP has
|
||||
made something available which is not with a bare BSP.
|
||||
|
||||
10
c/README
10
c/README
@@ -5,10 +5,18 @@
|
||||
This is the top level of the RTEMS directory structure. The following
|
||||
is a description of the files and directories in this directory:
|
||||
|
||||
Makefile.in
|
||||
LICENSE
|
||||
Required legalese.
|
||||
|
||||
Makefile
|
||||
The top-level Make command file used to build the C implementation
|
||||
of RTEMS. [RTEMS assumes the use of GNU make.]
|
||||
|
||||
Modules
|
||||
Example Modules command files used to configure the user's environment
|
||||
for RTEMS. These require the Modules system administration package
|
||||
available from numerous ftp sites.
|
||||
|
||||
README
|
||||
This file.
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
1. The installation procedure assumes that "gcc" is installed
|
||||
and is in your path for the installation of local tools.
|
||||
|
||||
2. gcc 2.7.2 with crossgcc patches (ftp.cygnus.com:/pub/embedded/crossgcc)
|
||||
2. gcc 2.6.3 with crossgcc patches (ftp.cygnus.com:/pub/embedded)
|
||||
|
||||
3. binutils 2.6 with crossgcc patches.
|
||||
3. binutils 2.5.2
|
||||
|
||||
4. newlib with RTEMS configurations.
|
||||
|
||||
|
||||
98
c/TESTED
98
c/TESTED
@@ -2,73 +2,55 @@
|
||||
# $Id$
|
||||
#
|
||||
|
||||
This file is current for the 4.0.0 release.
|
||||
The RTEMS Project does not have all of the development computers or
|
||||
target boards included in the RTEMS distribution. Many of the BSPs
|
||||
are user supplied and we try to insure that they compile before each
|
||||
full release. This file describes the range of configurations the
|
||||
RTEMS project can internally test.
|
||||
|
||||
The RTEMS project uses Intel x86 based computers running the RedHat
|
||||
distribution of the Linux operating system internally for development.
|
||||
This release has been tested on the following Languages/CPUs/Targets using
|
||||
RedHat Linux 4.2 as the host environment:
|
||||
Host Development Systems
|
||||
========================
|
||||
|
||||
CPU CPU
|
||||
FAMILY MODEL TARGET SUITES
|
||||
======== ========= ======================= ===============
|
||||
m68k m68000 efi68k (note 1)
|
||||
m68k m68020 Motorola MVME136 (note 1, 6)
|
||||
m68k m68030 Motorola MVME147 (note 1)
|
||||
m68k m68030 Motorola MVME147s (note 1)
|
||||
m68k m68lc040 Motorola MVME162 (note 1)
|
||||
m68k m68lc040 Motorola MVME162LX (note 1)
|
||||
m68k m68ec040 Motorola IDP (note 1)
|
||||
m68k m68020 DY-4 DMV152 (note 1)
|
||||
m68k m68302 generic 68302 (note 1)
|
||||
m68k m68302 ods 68302 (note 1)
|
||||
m68k m68332 efi332 (note 1)
|
||||
m68k m68360 generic 68360 (note 1, 6)
|
||||
m68k m68360 68360 in companion mode (note 1, 6)
|
||||
i386 i386_fp Force CPU-386 (note 1, 7)
|
||||
i386 i386ex generic i386ex (note 1, 6)
|
||||
i386 ix86 bare PC (pc386) (note 1, 6)
|
||||
i386 i486 DJGPP/PC-AT (note 7)
|
||||
i386 pentium DJGPP/PC-AT (note 7)
|
||||
i960 i960ca Cyclone CVME961 (note 4)
|
||||
hppa hppa7100 simhppa (note 1)
|
||||
mips idt4600 p4000 (note 1)
|
||||
mips idt4650 p4000 (note 1)
|
||||
powerpc ppc403 helas403 (note 1, 6)
|
||||
powerpc ppc403 Papyrus (note 1)
|
||||
powerpc ppc403 psim (note 5)
|
||||
sh sh7032 generic sh1 (note 1)
|
||||
sparc erc32 generic erc32 ALL TESTS (note 5)
|
||||
a29k a29k port sw (note 2)
|
||||
UNIX NA Solaris 2 (SPARC) (note 2)
|
||||
UNIX NA Solaris 2 (SPARC) (note 2)
|
||||
UNIX NA Linux (i386) ALL TESTS (inlines)
|
||||
UNIX NA Linux (i386) ALL TESTS (macros)
|
||||
UNIX NA HPUX (PA-RISC) (note 2)
|
||||
no_cpu NA no_bsp (note 3)
|
||||
All RTEMS development is done on a Sun SPARCStation running Solaris 2.3 and
|
||||
all other host systems are not tested internally.
|
||||
|
||||
NOTES:
|
||||
Target Systems
|
||||
==============
|
||||
|
||||
"NOT TESTED" indicates that this was not tested in the testing cycle
|
||||
immediately preceding the snapshot.
|
||||
The following table describes the testability of each BSP by the RTEMS project:
|
||||
|
||||
CPU CPU
|
||||
FAMILY MODEL TARGET STATUS
|
||||
====== ========= =================== =================
|
||||
m68k m68000 efi68k (note 1)
|
||||
m68k m68020 Motorola MVME136 TESTED INTERNALLY
|
||||
m68k m68lc040 Motorola MVME162 (note 1)
|
||||
m68k m68ec040 Motorola IDP (note 1)
|
||||
m68k m68020 DY-4 DMV152 (note 1)
|
||||
m68k m68302 generic 68302 (note 1)
|
||||
m68k m68332 efi332 (note 1)
|
||||
i386 i386_fp Force CPU-386 TESTED INTERNALLY
|
||||
i386 i486 DJGPP/PC-AT TESTED INTERNALLY
|
||||
i386 pentium DJGPP/PC-AT TESTED INTERNALLY
|
||||
i960 i960ca Cyclone CVME961 (note 4)
|
||||
hppa hppa7100 simhppa (note 2)
|
||||
ppc 403 Papyrus (note 2)
|
||||
UNIX NA Solaris 2 (SPARC) TESTED INTERNALLY (inlines)
|
||||
UNIX NA Solaris 2 (SPARC) TESTED INTERNALLY (macros)
|
||||
UNIX NA Linux (i386) (note 5)
|
||||
UNIX NA HPUX (PA-RISC) (note 2)
|
||||
no_cpu NA no_bsp (note 3)
|
||||
|
||||
|
||||
(1) Target board is not owned by RTEMS Project. The target is known
|
||||
to compile and link with all appropriate tests successfully.
|
||||
If the target does not support multiprocessor configurations, then
|
||||
"ALL TESTS" does not include the multiprocessor tests.
|
||||
|
||||
|
||||
(2) RTEMS Project cannot internally compile or test this target.
|
||||
As of 4.0.0, the HP-UX is not recognized in the configure script
|
||||
The a29k does not use GNU tools and may suffer from bit rot.
|
||||
|
||||
|
||||
(3) Target is not intended to be executed. It is only an example.
|
||||
|
||||
(4) The RTEMS Project owns this board but it is broken at the moment.
|
||||
|
||||
(4) The board owned by the RTEMS Project is broken. The BSP is known
|
||||
to compile and link with all appropriate tests successfully.
|
||||
|
||||
(5) This BSP is tested on a CPU software simulator.
|
||||
|
||||
(6) This BSP was tested by an RTEMS volunteer and reported to work.
|
||||
|
||||
(7) The BSP is deprecated. For information on what would be
|
||||
required to update it contact rtems@OARcorp.com.
|
||||
(5) The RTEMS Project owns a Linux host but does not regularly test this BSP.
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/directory.cfg
|
||||
|
||||
SUB_DIRS=os scripts src
|
||||
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/directory.cfg
|
||||
|
||||
SUB_DIRS=$(wildcard $(RTEMS_HOST))
|
||||
@@ -1,39 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/leaf.cfg
|
||||
|
||||
DESTDIR=$(PROJECT_RELEASE)/build-tools
|
||||
|
||||
INSTALLED=$(DESTDIR)/ifc.exe \
|
||||
$(DESTDIR)/cklength.exe \
|
||||
$(DESTDIR)/fixtimer.exe
|
||||
|
||||
all: $(DESTDIR) $(PGMS) install
|
||||
|
||||
$(DESTDIR):
|
||||
@INSTALL@ $(INSTDIRFLAGS) $@
|
||||
|
||||
install: $(INSTALLED)
|
||||
|
||||
# Install the programs
|
||||
$(DESTDIR)/ifc.exe: ifc_exe.uue
|
||||
uudecode <ifc_exe.uue
|
||||
mv ifc.exe $(DESTDIR)/ifc.exe
|
||||
|
||||
$(DESTDIR)/cklength.exe: cklength.uue
|
||||
uudecode <cklength.uue
|
||||
mv cklength.exe $(DESTDIR)/cklength.exe
|
||||
|
||||
$(DESTDIR)/fixtimer.exe: fixtimer.uue
|
||||
uudecode <fixtimer.uue
|
||||
mv fixtimer.exe $(DESTDIR)/fixtimer.exe
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# RTEMS build tools
|
||||
# NOTE: of course we can't use any of these tools
|
||||
# in this Makefile. Most notably: install-if-change
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/leaf.cfg
|
||||
include $(RTEMS_ROOT)/make/rtems.cfg
|
||||
|
||||
DESTDIR=$(PROJECT_RELEASE)/build-tools
|
||||
|
||||
BUILD_PGMS=install-if-change rcs-clean lock-directory unlock-directory
|
||||
PGMS = $(BUILD_PGMS) search-id.sh
|
||||
|
||||
CLEAN_ADDITIONS += $(BUILD_PGMS)
|
||||
|
||||
INSTALLED_PGMS=$(PGMS:%=$(DESTDIR)/%)
|
||||
|
||||
all: $(DESTDIR) $(PGMS) install
|
||||
|
||||
$(DESTDIR):
|
||||
@INSTALL@ $(INSTDIRFLAGS) $@
|
||||
|
||||
$(INSTALLED_PGMS): $(PGMS)
|
||||
@INSTALL@ $(INSTBINFLAGS) $^ $(DESTDIR)
|
||||
|
||||
install: $(DESTDIR) $(INSTALLED_PGMS)
|
||||
@@ -22,3 +22,11 @@ unlock-directory
|
||||
Useful to keep people from accidentally overwriting
|
||||
"released" trees if they get confused about which
|
||||
module they have loaded.
|
||||
|
||||
rtems-glom
|
||||
glom together all the rtems libraries in order to simplify
|
||||
the link line used by applications.
|
||||
Produces rtems.rel.
|
||||
Not used by the RTEMS src tree at all.
|
||||
Strictly optional.
|
||||
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
#!@KSH@ -p
|
||||
#
|
||||
# Either bash or ksh will be ok for this; requires (( )) arithmetic
|
||||
# (-p above just says to not parse $ENV file; makes it faster for
|
||||
# those of us who set $ENV)
|
||||
#
|
||||
# install files if they have changed by running 'cmp', then 'install'
|
||||
# as necessary.
|
||||
#
|
||||
# Optionally, can append a suffix before last existing suffix (if any)
|
||||
#
|
||||
# NOTE
|
||||
# We avoid using typical install(1M) programs since they have
|
||||
# large variability across systems and we also need to support ou
|
||||
# -V option.
|
||||
# So we just copy and chmod by hand.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
progname=`basename $0`
|
||||
#progname=${0##*/} # fast basename hack for ksh, bash
|
||||
|
||||
USAGE=\
|
||||
"usage: $progname [ -vmV ] file [ file ... ] dest-directory-or-file
|
||||
-v -- verbose
|
||||
-V suffix -- suffix to append to targets (before any . suffix)
|
||||
eg: -V _g would change 'foo' to 'foo_g' and
|
||||
'libfoo.a' to 'libfoo_g.a'
|
||||
-m mode -- mode for new file(s)"
|
||||
|
||||
fatal() {
|
||||
if [ "$1" ]
|
||||
then
|
||||
echo $* >&2
|
||||
fi
|
||||
echo "$USAGE" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
#
|
||||
# process the options
|
||||
#
|
||||
|
||||
verbose=""
|
||||
suffix=""
|
||||
mode=""
|
||||
|
||||
while getopts vm:V: OPT
|
||||
do
|
||||
case "$OPT" in
|
||||
v)
|
||||
verbose="yes";;
|
||||
V)
|
||||
eval suffix=$OPTARG;;
|
||||
m)
|
||||
mode="$OPTARG";;
|
||||
*)
|
||||
fatal
|
||||
esac
|
||||
done
|
||||
|
||||
shiftcount=`expr $OPTIND - 1`
|
||||
shift $shiftcount
|
||||
|
||||
args=$*
|
||||
|
||||
#
|
||||
# Separate source file(s) from dest directory or file
|
||||
#
|
||||
|
||||
files=""
|
||||
dest=""
|
||||
for d in $args
|
||||
do
|
||||
files="$files $dest"
|
||||
dest=$d
|
||||
done
|
||||
|
||||
if [ ! "$files" ] || [ ! "$dest" ]
|
||||
then
|
||||
fatal "missing files or invalid destination"
|
||||
fi
|
||||
|
||||
#
|
||||
# Process the arguments
|
||||
#
|
||||
|
||||
targets=""
|
||||
for f in $files
|
||||
do
|
||||
# leaf=`basename $f`
|
||||
leaf=${f##*/} # fast basename hack for ksh, bash
|
||||
|
||||
target=$dest
|
||||
if [ -d $dest ]
|
||||
then
|
||||
# if we were given a suffix, then add it as appropriate
|
||||
if [ "$suffix" ]
|
||||
then
|
||||
case $f in
|
||||
*.*)
|
||||
# leaf=`echo $leaf |
|
||||
# /bin/sed "s/\([~\.]*\)\.\(.*\)$/\1$suffix.\2/"`
|
||||
# ksh,bash hack for above sed script
|
||||
leaf=${leaf%%.*}$suffix.${leaf#*.}
|
||||
|
||||
[ "$verbose" = "yes" ] &&
|
||||
echo "$progname: $f will be installed as $leaf"
|
||||
;;
|
||||
*)
|
||||
leaf=$leaf$suffix;;
|
||||
esac
|
||||
fi
|
||||
target=$target/$leaf
|
||||
fi
|
||||
|
||||
[ ! -r $f ] && fatal "can not read $f"
|
||||
|
||||
if cmp -s $f $target
|
||||
then
|
||||
[ "$verbose" = "yes" ] && echo "'$f' not newer than '$target'"
|
||||
else
|
||||
[ "$verbose" = "yes" ] && echo "rm -f $target"
|
||||
rm -f $target
|
||||
echo "cp -p $f $target"
|
||||
cp -p $f $target || exit 1
|
||||
targets="$targets $target" # keep list for chmod below
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$mode" -a "$targets" ]
|
||||
then
|
||||
[ "$verbose" = "yes" ] && echo "chmod $mode $targets"
|
||||
chmod $mode $targets
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables: ***
|
||||
# mode:ksh ***
|
||||
# End: ***
|
||||
@@ -1,43 +0,0 @@
|
||||
#!@KSH@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Make a directory write protected
|
||||
# Used to write protect the install point after a build
|
||||
# to prevent inadvertant overwriting.
|
||||
#
|
||||
|
||||
# is a particular command available on this machine?
|
||||
#
|
||||
cmd_avail()
|
||||
{
|
||||
set -- `type $1 2>&1`
|
||||
if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ]
|
||||
then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
lock_directory() {
|
||||
l_dir=$1/. # get any symlink out of the way using '.'
|
||||
if [ -d $l_dir ]
|
||||
then
|
||||
find $l_dir -type d -perm -0200 -print | $XARGS chmod -w
|
||||
fi
|
||||
}
|
||||
|
||||
# Use gnu xargs if available; faster, more reliable in general
|
||||
XARGS=xargs
|
||||
cmd_avail gxargs && XARGS=gxargs
|
||||
|
||||
for dir
|
||||
do
|
||||
lock_directory $dir
|
||||
done
|
||||
|
||||
# Local Variables: ***
|
||||
# mode:ksh ***
|
||||
# End: ***
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
#!@KSH@ -p
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Delete all files from the current directory that can be recreated
|
||||
# via RCS 'co' commonds
|
||||
# Used by 'make clobber'
|
||||
#
|
||||
|
||||
progname=${0##*/} # fast basename hack for ksh, bash
|
||||
|
||||
USAGE=\
|
||||
"usage: $progname [ -v ]"
|
||||
|
||||
fatal() {
|
||||
if [ "$1" ]
|
||||
then
|
||||
echo $* >&2
|
||||
fi
|
||||
echo "$USAGE" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
#
|
||||
# process the options
|
||||
#
|
||||
|
||||
verbose=""
|
||||
|
||||
while getopts v OPT
|
||||
do
|
||||
case "$OPT" in
|
||||
v)
|
||||
verbose="yes";;
|
||||
*)
|
||||
fatal
|
||||
esac
|
||||
done
|
||||
|
||||
let $((shiftcount = $OPTIND - 1))
|
||||
shift $shiftcount
|
||||
|
||||
args=$*
|
||||
[ "$args" ] && fatal
|
||||
|
||||
[ -d RCS/. ] || exit 0
|
||||
|
||||
# there is probably a better way to do this
|
||||
|
||||
rcs_files=`echo RCS/*,v | sed -e 's?RCS/??g' -e's/,v//g'`
|
||||
|
||||
kills=""
|
||||
for f in $rcs_files
|
||||
do
|
||||
# build list of all files in RCS/*,v that are *not* locked
|
||||
if [ -f $f ] && [ ! -w $f ] && [ -f RCS/$f,v ]
|
||||
then
|
||||
locked=`rlog -L -R $f`
|
||||
[ "$locked" = "" ] && kills="$kills $f"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$kills" ]
|
||||
then
|
||||
[ "$verbose" ] && echo rm -f $kills
|
||||
rm -f $kills
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables: ***
|
||||
# mode:ksh ***
|
||||
# End: ***
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
find $1 -type f -a ! -name "*.scn" -a ! -name "bsp_specs" -a \
|
||||
-print > /tmp/$$.0
|
||||
find $1 -type f -a ! -name "*.scn" -a ! -name "bsp_specs" -a \
|
||||
-exec grep -l '$Id' {} \; > /tmp/$$.1
|
||||
|
||||
diff /tmp/$$.0 /tmp/$$.1 > /tmp/$$.2
|
||||
|
||||
grep "<" /tmp/$$.2 | sed 's/< //' >&1
|
||||
|
||||
rm -f /tmp/$$*
|
||||
@@ -1,41 +0,0 @@
|
||||
#!@KSH@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Unlock a directory processed by lock_directory
|
||||
#
|
||||
|
||||
# is a particular command available on this machine?
|
||||
#
|
||||
cmd_avail()
|
||||
{
|
||||
set -- `type $1 2>&1`
|
||||
if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ]
|
||||
then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
unlock_directory() {
|
||||
ul_dir=$1/. # get any symlink out of the way using '.'
|
||||
if [ -d $ul_dir ]
|
||||
then
|
||||
find $ul_dir -type d ! -perm -0222 -print | $XARGS -t chmod +w
|
||||
fi
|
||||
}
|
||||
|
||||
# Use gnu xargs if available; faster, more reliable in general
|
||||
XARGS=xargs
|
||||
cmd_avail gxargs && XARGS=gxargs
|
||||
|
||||
for dir
|
||||
do
|
||||
unlock_directory $dir
|
||||
done
|
||||
|
||||
# Local Variables: ***
|
||||
# mode:ksh ***
|
||||
# End: ***
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
exec_prefix = @exec_prefix@
|
||||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
includedir = @includedir@
|
||||
manext = 1
|
||||
mandir = @mandir@/man$(manext)
|
||||
|
||||
# FIXME: $EXEEXT should be set in a central cfg-file used for native
|
||||
# compiling (e.g. gcc.cfg) instead of setting EXEEXE here.
|
||||
EXEEXT=@EXEEXT@
|
||||
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
# we use host compiler in this directory
|
||||
USE_HOST_COMPILER=yes
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=cklength eolstrip packhex unhex
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=$(ARCH)/%.o)
|
||||
|
||||
H_FILES=
|
||||
|
||||
SRCS=$(C_FILES) $(CC_FILES) $(H_FILES)
|
||||
OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
|
||||
|
||||
# FIXME: building into $(ARCH) doesn't make sense for host programs
|
||||
PGMS=$(ARCH)/cklength$(EXEEXT) $(ARCH)/eolstrip$(EXEEXT) \
|
||||
$(ARCH)/packhex$(EXEEXT) $(ARCH)/unhex$(EXEEXT)
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/leaf.cfg
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
DEFINES +=
|
||||
CPPFLAGS += -I.
|
||||
CFLAGS +=
|
||||
|
||||
LD_PATHS +=
|
||||
LD_LIBS +=
|
||||
LDFLAGS +=
|
||||
|
||||
#
|
||||
# Add your list of files to delete here. The config files
|
||||
# already know how to delete some stuff, so you may want
|
||||
# to just run 'make clean' first to see what gets missed.
|
||||
# 'make clobber' already includes 'make clean'
|
||||
#
|
||||
|
||||
CLEAN_ADDITIONS += $(HOST_ARCH)
|
||||
CLOBBER_ADDITIONS +=
|
||||
|
||||
DESTDIR=${PROJECT_RELEASE}/build-tools
|
||||
|
||||
$(DESTDIR):
|
||||
@INSTALL@ $(INSTDIRFLAGS) $@
|
||||
|
||||
all: $(ARCH) $(DESTDIR) $(SRCS) $(PGMS)
|
||||
@INSTALL@ $(INSTBINFLAGS) $(PGMS) $(DESTDIR)
|
||||
@@ -34,25 +34,6 @@ maximum line length. The default maximum line length is 80.\n\
|
||||
#include <string.h>
|
||||
#include <memory.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef VMS
|
||||
#ifndef HAVE_STRERROR
|
||||
extern int sys_nerr;
|
||||
extern char *sys_errlist[];
|
||||
|
||||
#define strerror( _err ) \
|
||||
((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
|
||||
|
||||
#else /* HAVE_STRERROR */
|
||||
char *strerror ();
|
||||
#endif
|
||||
#else /* VMS */
|
||||
char *strerror (int,...);
|
||||
#endif
|
||||
|
||||
|
||||
#define BUFFER_SIZE 512
|
||||
|
||||
@@ -86,6 +67,7 @@ int line_length = 80; /* maximum allowable line length */
|
||||
|
||||
extern char *optarg; /* getopt(3) control vars */
|
||||
extern int optind, opterr;
|
||||
extern int errno;
|
||||
|
||||
char *progname; /* for error() */
|
||||
|
||||
@@ -101,10 +83,8 @@ long getparm(char *s, long min, long max, char *msg);
|
||||
#define stol(p) strtol(p, (char **) NULL, 0)
|
||||
int Open(), Read(), Write();
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv
|
||||
)
|
||||
int
|
||||
main(int argc, char **argv, char **env)
|
||||
{
|
||||
register int c;
|
||||
int showusage = FALSE; /* usage error? */
|
||||
@@ -249,6 +229,8 @@ error(int error_flag, ...)
|
||||
{
|
||||
va_list arglist;
|
||||
register char *format;
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
int local_errno;
|
||||
|
||||
extern int errno;
|
||||
@@ -266,7 +248,12 @@ error(int error_flag, ...)
|
||||
va_end(arglist);
|
||||
|
||||
if (local_errno)
|
||||
(void) fprintf(stderr, " (%s)\n", strerror(local_errno));
|
||||
if ((local_errno > 0) && (local_errno < sys_nerr))
|
||||
(void) fprintf(stderr, " (%s)\n", sys_errlist[local_errno]);
|
||||
else
|
||||
(void) fprintf(stderr, " (unknown errno=%d)\n", local_errno);
|
||||
else
|
||||
(void) fprintf(stderr, "\n");
|
||||
|
||||
(void) fflush(stderr);
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
/*
|
||||
* This file is editted automatically by autoconf.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
@@ -29,25 +29,6 @@ Strip the white space from the end of every line on the list of files.\n\
|
||||
#include <string.h>
|
||||
#include <memory.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef VMS
|
||||
#ifndef HAVE_STRERROR
|
||||
extern int sys_nerr;
|
||||
extern char *sys_errlist[];
|
||||
|
||||
#define strerror( _err ) \
|
||||
((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
|
||||
|
||||
#else /* HAVE_STRERROR */
|
||||
char *strerror ();
|
||||
#endif
|
||||
#else /* VMS */
|
||||
char *strerror (int,...);
|
||||
#endif
|
||||
|
||||
|
||||
#define BUFFER_SIZE 2048
|
||||
#define MAX_PATH 2048
|
||||
@@ -79,6 +60,7 @@ int test_only = FALSE; /* test only */
|
||||
|
||||
extern char *optarg; /* getopt(3) control vars */
|
||||
extern int optind, opterr;
|
||||
extern int errno;
|
||||
|
||||
char *progname; /* for error() */
|
||||
|
||||
@@ -94,10 +76,8 @@ long getparm(char *s, long min, long max, char *msg);
|
||||
#define stol(p) strtol(p, (char **) NULL, 0)
|
||||
int Open(), Read(), Write();
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv
|
||||
)
|
||||
int
|
||||
main(int argc, char **argv, char **env)
|
||||
{
|
||||
register int c;
|
||||
int showusage = FALSE; /* usage error? */
|
||||
@@ -197,7 +177,7 @@ process(char *arg)
|
||||
if ( buffer[ length ] != '\n' )
|
||||
error(ERR_ERRNO|ERR_FATAL, "Line %d too long in %s\n", line_number, arg);
|
||||
|
||||
while ( isspace( (int) buffer[ length ] ) )
|
||||
while ( isspace( buffer[ length ] ) )
|
||||
buffer[ length-- ] = '\0';
|
||||
|
||||
if ( test_only ) {
|
||||
@@ -236,6 +216,8 @@ error(int error_flag, ...)
|
||||
{
|
||||
va_list arglist;
|
||||
register char *format;
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
int local_errno;
|
||||
|
||||
extern int errno;
|
||||
@@ -253,9 +235,12 @@ error(int error_flag, ...)
|
||||
va_end(arglist);
|
||||
|
||||
if (local_errno)
|
||||
(void) fprintf(stderr, " (%s)\n", strerror(local_errno));
|
||||
if ((local_errno > 0) && (local_errno < sys_nerr))
|
||||
(void) fprintf(stderr, " (%s)\n", sys_errlist[local_errno]);
|
||||
else
|
||||
(void) fprintf(stderr, " (unknown errno=%d)\n", local_errno);
|
||||
else
|
||||
(void) fprintf(stderr, "\n");
|
||||
(void) fprintf(stderr, "\n");
|
||||
|
||||
(void) fflush(stderr);
|
||||
|
||||
|
||||
@@ -8,13 +8,7 @@
|
||||
* is not robust enough to detect hex-record formatting
|
||||
* errors.
|
||||
*
|
||||
* Published: May 1993 Embedded Systems Programming magazine
|
||||
* "Creating Faster Hex Files"
|
||||
*
|
||||
* URL: ESP magazine: http://www.embedded.com
|
||||
* Source Code: ftp://ftp.mfi.com/pub/espmag/1993/pakhex.zip
|
||||
*
|
||||
* Author: Mark Gringrich
|
||||
* Published: 5/93 Embedded Systems magazine
|
||||
*
|
||||
* Compiler: Microsoft C 6.0
|
||||
* cl /F 1000 packhex.c
|
||||
@@ -43,23 +37,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef VMS
|
||||
#ifndef HAVE_STRERROR
|
||||
extern int sys_nerr;
|
||||
extern char *sys_errlist[];
|
||||
|
||||
#define strerror( _err ) \
|
||||
((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
|
||||
|
||||
#else /* HAVE_STRERROR */
|
||||
char *strerror ();
|
||||
#endif
|
||||
#else /* VMS */
|
||||
char *strerror (int,...);
|
||||
#endif
|
||||
|
||||
#if defined(__unix__) && !defined(EXIT_FAILURE)
|
||||
#define EXIT_FAILURE -1
|
||||
#define EXIT_SUCCESS 0
|
||||
@@ -99,7 +76,7 @@ typedef struct /* Functions and constant returning Hex-record vital stats. */
|
||||
|
||||
/*--------------------------- function prototypes ----------------------------*/
|
||||
|
||||
Rec_vitals * identify_first_data_record( char *, int );
|
||||
Rec_vitals * identify_first_data_record( char * );
|
||||
Ulong get_ndigit_hex( char *, int );
|
||||
|
||||
|
||||
@@ -411,24 +388,18 @@ Rec_vitals *formats[] =
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv
|
||||
)
|
||||
void main( void )
|
||||
{
|
||||
|
||||
char inbuff[ MAX_LINE_SIZE ], outbuff[ MAX_LINE_SIZE ];
|
||||
char *in_dptr, *out_dptr;
|
||||
int d_total, d_count, d_excess, n;
|
||||
int length;
|
||||
Ulong in_rec_addr, out_rec_addr = 0;
|
||||
Rec_vitals *rptr;
|
||||
|
||||
|
||||
/* Sift through file until first hex record is identified. */
|
||||
|
||||
rptr = identify_first_data_record( inbuff, MAX_LINE_SIZE );
|
||||
if ( rptr == NULL )
|
||||
if ( ( rptr = identify_first_data_record( inbuff ) ) == NULL )
|
||||
{
|
||||
fputs( "No hex records found.\n", stderr );
|
||||
exit( EXIT_FAILURE );
|
||||
@@ -437,7 +408,8 @@ int main(
|
||||
|
||||
/* Attempt data-record splicing until end-of-file is reached. */
|
||||
d_total = 0;
|
||||
for (;;) {
|
||||
do
|
||||
{
|
||||
if ( rptr->is_data_record( inbuff ) == YES )
|
||||
{ /* Input record is a data record. */
|
||||
d_count = rptr->get_data_count( inbuff );
|
||||
@@ -483,21 +455,10 @@ int main(
|
||||
}
|
||||
puts( inbuff );
|
||||
}
|
||||
|
||||
inbuff[ MAX_LINE_SIZE - 1 ] = '\0';
|
||||
if ( !fgets( inbuff, MAX_LINE_SIZE, stdin ) )
|
||||
break;
|
||||
if ( inbuff[ MAX_LINE_SIZE - 1 ] ) {
|
||||
fprintf( stderr, "Input line too long" );
|
||||
exit( 1 );
|
||||
}
|
||||
length = strlen(inbuff);
|
||||
inbuff[length - 1] = '\0';
|
||||
|
||||
}
|
||||
} while ( gets( inbuff ) != NULL );
|
||||
|
||||
|
||||
return ( EXIT_SUCCESS );
|
||||
exit( EXIT_SUCCESS );
|
||||
|
||||
}
|
||||
|
||||
@@ -516,25 +477,12 @@ int main(
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
Rec_vitals * identify_first_data_record( char * buff_ptr, int max_length )
|
||||
Rec_vitals * identify_first_data_record( char * buff_ptr )
|
||||
{
|
||||
Rec_vitals ** ptr;
|
||||
int length;
|
||||
|
||||
|
||||
|
||||
for ( ;; ) {
|
||||
|
||||
buff_ptr[ max_length - 1 ] = '\0';
|
||||
if ( !fgets( buff_ptr, max_length, stdin ) )
|
||||
break;
|
||||
if ( buff_ptr[ max_length - 1 ] ) {
|
||||
fprintf( stderr, "Input line too long" );
|
||||
exit( 1 );
|
||||
}
|
||||
length = strlen(buff_ptr);
|
||||
buff_ptr[length - 1] = '\0';
|
||||
|
||||
while ( gets( buff_ptr ) != NULL )
|
||||
{
|
||||
for ( ptr = formats ; *ptr != ( Rec_vitals * ) NULL ; ptr++ )
|
||||
if ( ( *ptr )->is_data_record( buff_ptr ) == YES )
|
||||
return( *ptr ); /* Successful return. */
|
||||
|
||||
@@ -37,25 +37,6 @@ usage: unhex [-va] [ -o file ] [ file [file ... ] ]\n\
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef VMS
|
||||
#ifndef HAVE_STRERROR
|
||||
extern int sys_nerr;
|
||||
extern char *sys_errlist[];
|
||||
|
||||
#define strerror( _err ) \
|
||||
((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
|
||||
|
||||
#else /* HAVE_STRERROR */
|
||||
char *strerror ();
|
||||
#endif
|
||||
#else /* VMS */
|
||||
char *strerror (int,...);
|
||||
#endif
|
||||
|
||||
|
||||
#define OK 0
|
||||
#define FAILURE (-1)
|
||||
@@ -97,6 +78,7 @@ u32 FFfill = 0L; /* how far to fill w 0xFF's */
|
||||
|
||||
extern char *optarg; /* getopt(3) control vars */
|
||||
extern int optind;
|
||||
extern int errno;
|
||||
|
||||
char *progname; /* for error() */
|
||||
|
||||
@@ -106,12 +88,8 @@ void error(int errn, ...);
|
||||
#define ERR_ABORT (ERR_ERRNO / 4) /* error is fatal; abort */
|
||||
#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
|
||||
|
||||
#ifdef HAVE_STRTOUL
|
||||
#define stol(p) strtoul(p, (char **) NULL, 0)
|
||||
#else
|
||||
#define stol(p) strtol(p, (char **) NULL, 0)
|
||||
#endif
|
||||
|
||||
|
||||
int unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
|
||||
int convert_Intel_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
|
||||
int convert_S_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
|
||||
@@ -137,10 +115,10 @@ char *MISCSUM = "Checksum mismatch";
|
||||
char *BADTYPE = "Unrecognized record type";
|
||||
char *MISTYPE = "Incompatible record types";
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv
|
||||
)
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
register int c;
|
||||
bool showusage = FALSE; /* usage error? */
|
||||
@@ -698,6 +676,8 @@ error(int error_flag, ...)
|
||||
{
|
||||
va_list arglist;
|
||||
register char *format;
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
int local_errno;
|
||||
|
||||
extern int errno;
|
||||
@@ -715,9 +695,12 @@ error(int error_flag, ...)
|
||||
va_end(arglist);
|
||||
|
||||
if (local_errno)
|
||||
(void) fprintf(stderr, " (%s)\n", strerror(local_errno));
|
||||
if ((local_errno > 0) && (local_errno < sys_nerr))
|
||||
(void) fprintf(stderr, " (%s)\n", sys_errlist[local_errno]);
|
||||
else
|
||||
(void) fprintf(stderr, " (unknown errno=%d)\n", local_errno);
|
||||
else
|
||||
(void) fprintf(stderr, "\n");
|
||||
(void) fprintf(stderr, "\n");
|
||||
|
||||
(void) fflush(stderr);
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/directory.cfg
|
||||
|
||||
SUB_DIRS=exec lib tests/tools tests/support tests/samples
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/directory.cfg
|
||||
|
||||
POSIX_DIRS_yes_V=posix
|
||||
POSIX_DIRS = $(POSIX_DIRS_$(RTEMS_HAS_POSIX_API)_V)
|
||||
|
||||
SUB_DIRS=score rtems $(POSIX_DIRS) sapi wrapup
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/directory.cfg
|
||||
|
||||
SUB_DIRS=base sys headers $(INLINE) optman src
|
||||
@@ -1,34 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
#H_PIECES= aio devctl intr limits mqueue pthread sched semaphore \
|
||||
# signal time unistd
|
||||
H_PIECES= pthread sched
|
||||
# limits.h may have been moved into newlib -- check before removing it
|
||||
# from the cvs tree
|
||||
H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
|
||||
|
||||
SRCS=$(H_FILES)
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/leaf.cfg
|
||||
|
||||
#
|
||||
# Add your list of files to delete here. The config files
|
||||
# already know how to delete some stuff, so you may want
|
||||
# to just run 'make clean' first to see what gets missed.
|
||||
# 'make clobber' already includes 'make clean'
|
||||
#
|
||||
|
||||
CLEAN_ADDITIONS +=
|
||||
CLOBBER_ADDITIONS +=
|
||||
|
||||
all: $(SRCS)
|
||||
$(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)
|
||||
@@ -1,137 +0,0 @@
|
||||
/* aio.h
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __POSIX_ASYNCHRONOUS_IO_h
|
||||
#define __POSIX_ASYNCHRONOUS_IO_h
|
||||
|
||||
#include <rtems/posix/features.h>
|
||||
|
||||
#if defined(_POSIX_ASYNCHRONOUS_IO)
|
||||
|
||||
/*
|
||||
* 6.7.1 Data Definitions for Asynchronous Input and Output,
|
||||
* P1003.1b-1993, p. 151
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
/*
|
||||
* 6.7.1.2 Manifest Constants, P1003.1b-1993, p. 153
|
||||
*/
|
||||
|
||||
#define AIO_CANCELED 0 /* all requested operations have been canceled */
|
||||
#define AIO_NOTCANCELED 1 /* some of the operations could not be canceled */
|
||||
/* since they are in progress */
|
||||
#define AIO_ALLDONE 2 /* none of the requested operations could be */
|
||||
/* canceled since they are already complete */
|
||||
|
||||
/* lio_listio() options */
|
||||
|
||||
#define LIO_WAIT 0 /* calling process is to suspend until the */
|
||||
/* operation is complete */
|
||||
#define LIO_NOWAIT 1 /* calling process is to continue execution while */
|
||||
/* the operation is performed and no notification */
|
||||
/* shall be given when the operation is completed */
|
||||
#define LIO_READ 2 /* request a read() */
|
||||
#define LIO_WRITE 3 /* request a write() */
|
||||
#define LIO_NOP 4 /* no transfer is requested */
|
||||
|
||||
/*
|
||||
* 6.7.1.1 Asynchronous I/O Control Block, P1003.1b-1993, p. 151
|
||||
*/
|
||||
|
||||
struct aiocb {
|
||||
int aio_fildes; /* File descriptor */
|
||||
off_t aio_offset; /* File offset */
|
||||
volatile void *aio_buf; /* Location of buffer */
|
||||
size_t aio_nbytes; /* Length of transfer */
|
||||
int aio_reqprio; /* Request priority offset */
|
||||
struct sigevent aio_sigevent; /* Signal number and value */
|
||||
int aoi_lio_opcode; /* Operation to be performed */
|
||||
};
|
||||
|
||||
/*
|
||||
* 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154
|
||||
*/
|
||||
|
||||
int aio_read(
|
||||
struct aiocb *aiocbp
|
||||
);
|
||||
|
||||
/*
|
||||
* 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155
|
||||
*/
|
||||
|
||||
int aio_write(
|
||||
struct aiocb *aiocbp
|
||||
);
|
||||
|
||||
/*
|
||||
* 6.7.4 List Directed I/O, P1003.1b-1993, p. 158
|
||||
*/
|
||||
|
||||
int lio_listio(
|
||||
int mode,
|
||||
struct aiocb * const list[],
|
||||
int nent,
|
||||
struct sigevent *sig
|
||||
);
|
||||
|
||||
/*
|
||||
* 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161
|
||||
*/
|
||||
|
||||
int aio_error(
|
||||
const struct aiocb *aiocbp
|
||||
);
|
||||
|
||||
/*
|
||||
* 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
|
||||
* P1003.1b-1993, p. 162
|
||||
*/
|
||||
|
||||
int aio_return(
|
||||
const struct aiocb *aiocbp
|
||||
);
|
||||
|
||||
/*
|
||||
* 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163
|
||||
*/
|
||||
|
||||
int aio_cancel(
|
||||
int filedes,
|
||||
struct aiocb *aiocbp
|
||||
);
|
||||
|
||||
/*
|
||||
* 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164
|
||||
*/
|
||||
|
||||
int aio_suspend(
|
||||
struct aiocb * const list[],
|
||||
int nent,
|
||||
const struct timespec *timeout
|
||||
);
|
||||
|
||||
#if defined(_POSIX_SYNCHRONIZED_IO)
|
||||
|
||||
/*
|
||||
* 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166
|
||||
*/
|
||||
|
||||
int aio_fsync(
|
||||
int op,
|
||||
struct aiocb *aiocbp
|
||||
);
|
||||
|
||||
#endif /* _POSIX_SYNCHRONIZED_IO */
|
||||
|
||||
#endif /* _POSIX_ASYNCHRONOUS_IO */
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,30 +0,0 @@
|
||||
/* devctl.h
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __POSIX_DEVICE_CONTROL_h
|
||||
#define __POSIX_DEVICE_CONTROL_h
|
||||
|
||||
#include <rtems/posix/features.h>
|
||||
|
||||
#if defined(_POSIX_DEVICE_CONTROL)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/*
|
||||
* 21.2.1 Control a Device, P1003.4b/D8, p. 65
|
||||
*/
|
||||
|
||||
int devctl(
|
||||
int filedes,
|
||||
void *dev_data_ptr,
|
||||
size_t nbyte,
|
||||
int *dev_info_ptr
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,72 +0,0 @@
|
||||
/* intr.h
|
||||
*
|
||||
* XXX: It is unclear if the type "intr_t" should be defined when
|
||||
* _POSIX_INTERRUPT_CONTROL is not.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __POSIX_INTERRUPTS_h
|
||||
#define __POSIX_INTERRUPTS_h
|
||||
|
||||
#include <rtems/posix/features.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#if defined(_POSIX_INTERRUPT_CONTROL)
|
||||
|
||||
/*
|
||||
* 22.2 Concepts, P1003.4b/D8, p. 73
|
||||
*/
|
||||
|
||||
typedef int intr_t;
|
||||
|
||||
/*
|
||||
* 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
|
||||
*/
|
||||
|
||||
/*
|
||||
* Return codes from an interrupt handler
|
||||
*/
|
||||
|
||||
#define INTR_HANDLED_NOTIFY 0 /* ISR handled this interrupt, notify */
|
||||
/* the thread that registered the */
|
||||
/* ISR that the interrupt occurred. */
|
||||
#define INTR_HANDLED_DO_NOT_NOTIFY 1 /* ISR handled this interrupt, but */
|
||||
/* do NOT perform notification. */
|
||||
#define INTR_NOT_HANDLED 2 /* ISR did not handle this interrupt, */
|
||||
/* let the next handler try. */
|
||||
|
||||
int intr_capture(
|
||||
intr_t intr,
|
||||
int (*intr_handler)( void *area ),
|
||||
volatile void *area,
|
||||
size_t areasize
|
||||
);
|
||||
|
||||
int intr_release(
|
||||
intr_t intr,
|
||||
int (*intr_handler)( void *area )
|
||||
);
|
||||
|
||||
int intr_lock(
|
||||
intr_t intr
|
||||
);
|
||||
|
||||
int intr_unlock(
|
||||
intr_t intr
|
||||
);
|
||||
|
||||
/*
|
||||
* 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76
|
||||
*/
|
||||
|
||||
int intr_timed_wait(
|
||||
int flags,
|
||||
const struct timespec *timeout
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,164 +0,0 @@
|
||||
/* limits.h
|
||||
*
|
||||
* This file lists the minimums for the limits set by each of
|
||||
* the POSIX features subsets.
|
||||
*
|
||||
* XXX: Careful attention needs to be paid to section 2.8 in 1003.1b-1993
|
||||
* to segregrate the variables below based on their "class" according
|
||||
* to our implementation. We also need to set the Run-Time Invariant
|
||||
* and other related values.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include_next <limits.h>
|
||||
|
||||
#ifndef __POSIX_LIMITS_h
|
||||
#define __POSIX_LIMITS_h
|
||||
|
||||
/* really only to get min stack size from <rtems/score/cpu.h> */
|
||||
#include <rtems/system.h>
|
||||
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
* *
|
||||
* P1003.1b-1993 defines the constants below this comment. *
|
||||
* *
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
|
||||
#define _POSIX_AIO_LISTIO_MAX 2
|
||||
#define _POSIX_AIO_MAX 1
|
||||
#define _POSIX_ARG_MAX 4096
|
||||
#define _POSIX_CHILD_MAX 6
|
||||
#define _POSIX_DELAYTIMER_MAX 32
|
||||
#define _POSIX_LINK_MAX 8
|
||||
#define _POSIX_MAX_CANON 255
|
||||
#define _POSIX_MAX_INPUT 255
|
||||
#define _POSIX_MQ_OPEN_MAX 8
|
||||
#define _POSIX_MQ_PRIO_MAX 32
|
||||
#define _POSIX_NAME_MAX 14
|
||||
#define _POSIX_NGROUPS_MAX 0
|
||||
#define _POSIX_OPEN_MAX 16
|
||||
#define _POSIX_PATH_MAX 255
|
||||
#define _POSIX_PIPE_BUF 512
|
||||
#define _POSIX_RTSIG_MAX 8
|
||||
#define _POSIX_SEM_NSEMS_MAX 256
|
||||
#define _POSIX_SEM_VALUE_MAX 32767
|
||||
#define _POSIX_SIGQUEUE_MAX 32
|
||||
#define _POSIX_SSIZE_MAX 32767
|
||||
#define _POSIX_STREAM_MAX 8
|
||||
#define _POSIX_TIMER_MAX 32
|
||||
#define _POSIX_TZNAME_MAX 3
|
||||
|
||||
/*
|
||||
* Definitions of the following may be omitted if the value is >= stated
|
||||
* minimum but is indeterminate.
|
||||
*/
|
||||
|
||||
#define AIO_LISTIO_MAX 2
|
||||
#define AIO_MAX 1
|
||||
#define AIO_PRIO_DELTA_MAX 0
|
||||
#define ARG_MAX 4096
|
||||
#define CHILD_MAX 6
|
||||
#define DELAYTIMER_MAX 32
|
||||
#define MQ_OPEN_MAX 8
|
||||
#define MQ_PRIO_MAX 32
|
||||
#define OPEN_MAX 16
|
||||
#define PAGESIZE 1
|
||||
#define RTSIG_MAX 8
|
||||
#define SEM_NSEMS_MAX 256
|
||||
#define SEM_VALUE_MAX 32767
|
||||
#define SIGQUEUE_MAX 32
|
||||
#define STREAM_MAX 8
|
||||
#define TIMER_MAX 32
|
||||
#define TZNAME_MAX 3
|
||||
|
||||
/*
|
||||
* Pathname Variables
|
||||
*/
|
||||
|
||||
#define LINK_MAX 8
|
||||
#define MAX_CANON 255
|
||||
#define MAX_INPUT 255
|
||||
#define NAME_MAX 14
|
||||
#define PATH_MAX 255
|
||||
#define PIPE_BUF 512
|
||||
|
||||
/*
|
||||
* Invariant values
|
||||
*/
|
||||
|
||||
#define SSIZE_MAX 32767
|
||||
|
||||
/*
|
||||
* Maximum Values
|
||||
*/
|
||||
|
||||
#define _POSIX_CLOCKRES_MIN 0 /* in nanoseconds */
|
||||
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
* *
|
||||
* P1003.1c/D10 defines the constants below this comment. *
|
||||
*
|
||||
* XXX: doc seems to have printing problems in this table :(
|
||||
* *
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
|
||||
#define _POSIX_LOGIN_NAME_MAX 9
|
||||
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
|
||||
#define _POSIX_THREAD_KEYS_MAX 28
|
||||
#define _POSIX_THREAD_THREADS_MAX 64
|
||||
#define _POSIX_TTY_NAME_MAX 9
|
||||
|
||||
/*
|
||||
* Definitions of the following may be omitted if the value is >= stated
|
||||
* minimum but is indeterminate.
|
||||
*/
|
||||
|
||||
#define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
|
||||
#define TTY_NAME_MAX _POSIX_TTY_NAME_MAX
|
||||
#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
|
||||
#define PTHREAD_STACK_MIN CPU_STACK_MINIMUM_SIZE
|
||||
|
||||
/*
|
||||
* The maximum number of keys (PTHREAD_KEYS_MAX) and threads
|
||||
* (PTHREAD_THREADS_MAX) are configurable and may exceed the minimum.
|
||||
*
|
||||
#define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX
|
||||
#define PTHREAD_THREADS_MAX _POSIX_THREAD_THREADS_MAX
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
* *
|
||||
* P1003.4b/D8 defines the constants below this comment. *
|
||||
* *
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
|
||||
#define _POSIX_INTERRUPT_OVERRUN_MAX 32
|
||||
|
||||
/*
|
||||
* Definitions of the following may be omitted if the value is >= stated
|
||||
* minimum but is indeterminate.
|
||||
*/
|
||||
|
||||
#define INTERRUPT_OVERRUN_MAX 32
|
||||
|
||||
/*
|
||||
* Pathname Variables
|
||||
*/
|
||||
|
||||
#define MIN_ALLOC_SIZE
|
||||
#define REC_MIN_XFER_SIZE
|
||||
#define REC_MAX_XFER_SIZE
|
||||
#define REC_INCR_XFER_SIZE
|
||||
#define REC_XFER_ALIGN
|
||||
#define MAX_ATOMIC_SIZE
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,145 +0,0 @@
|
||||
/* mqueue.h
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __POSIX_MESSAGE_QUEUE_h
|
||||
#define __POSIX_MESSAGE_QUEUE_h
|
||||
|
||||
#include <rtems/posix/features.h>
|
||||
|
||||
#if defined(_POSIX_MESSAGE_PASSING)
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/score/object.h>
|
||||
|
||||
/*
|
||||
* 15.1.1 Data Structures, P1003.1b-1993, p. 271
|
||||
*/
|
||||
|
||||
typedef Objects_Id mqd_t;
|
||||
|
||||
struct mq_attr {
|
||||
long mq_flags; /* Message queue flags */
|
||||
long mq_maxmsg; /* Maximum number of messages */
|
||||
long mq_msgsize; /* Maximum message size */
|
||||
long mq_curmsgs; /* Number of messages currently queued */
|
||||
};
|
||||
|
||||
/*
|
||||
* 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
|
||||
*/
|
||||
|
||||
mqd_t mq_open(
|
||||
const char *name,
|
||||
int oflag,
|
||||
...
|
||||
);
|
||||
|
||||
/*
|
||||
* 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275
|
||||
*/
|
||||
|
||||
int mq_close(
|
||||
mqd_t mqdes
|
||||
);
|
||||
|
||||
/*
|
||||
* 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
|
||||
*/
|
||||
|
||||
int mq_unlink(
|
||||
const char *name
|
||||
);
|
||||
|
||||
/*
|
||||
* 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
|
||||
*
|
||||
* NOTE: P1003.4b/D8, p. 45 adds mq_timedsend().
|
||||
*/
|
||||
|
||||
int mq_send(
|
||||
mqd_t mqdes,
|
||||
const char *msg_ptr,
|
||||
size_t msg_len,
|
||||
unsigned int msg_prio
|
||||
);
|
||||
|
||||
#if defined(_POSIX_TIMEOUTS)
|
||||
|
||||
#include <time.h>
|
||||
|
||||
int mq_timedsend(
|
||||
mqd_t mqdes,
|
||||
const char *msg_ptr,
|
||||
size_t msg_len,
|
||||
unsigned int msg_prio,
|
||||
const struct timespec *timeout
|
||||
);
|
||||
|
||||
#endif /* _POSIX_TIMEOUTS */
|
||||
|
||||
/*
|
||||
* 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
|
||||
*
|
||||
* NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
|
||||
*/
|
||||
|
||||
ssize_t mq_receive(
|
||||
mqd_t mqdes,
|
||||
char *msg_ptr,
|
||||
size_t msg_len,
|
||||
unsigned int *msg_prio
|
||||
);
|
||||
|
||||
#if defined(_POSIX_TIMEOUTS)
|
||||
|
||||
int mq_timedreceive( /* XXX: should this be ssize_t */
|
||||
mqd_t mqdes,
|
||||
char *msg_ptr,
|
||||
size_t msg_len,
|
||||
unsigned int *msg_prio,
|
||||
const struct timespec *timeout
|
||||
);
|
||||
|
||||
#endif /* _POSIX_TIMEOUTS */
|
||||
|
||||
#if defined(_POSIX_REALTIME_SIGNALS)
|
||||
|
||||
/*
|
||||
* 15.2.6 Notify Process that a Message is Available on a Queue,
|
||||
* P1003.1b-1993, p. 280
|
||||
*/
|
||||
|
||||
int mq_notify(
|
||||
mqd_t mqdes,
|
||||
const struct sigevent *notification
|
||||
);
|
||||
|
||||
#endif /* _POSIX_REALTIME_SIGNALS */
|
||||
|
||||
/*
|
||||
* 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281
|
||||
*/
|
||||
|
||||
int mq_setattr(
|
||||
mqd_t mqdes,
|
||||
const struct mq_attr *mqstat,
|
||||
struct mq_attr *omqstat
|
||||
);
|
||||
|
||||
/*
|
||||
* 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
|
||||
*/
|
||||
|
||||
int mq_getattr(
|
||||
mqd_t mqdes,
|
||||
struct mq_attr *mqstat
|
||||
);
|
||||
|
||||
#endif /* _POSIX_MESSAGE_PASSING */
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,500 +0,0 @@
|
||||
/* pthread.h
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __PTHREAD_h
|
||||
#define __PTHREAD_h
|
||||
|
||||
#include <sys/features.h>
|
||||
|
||||
#if defined(_POSIX_THREADS)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include <sys/sched.h>
|
||||
|
||||
/*
|
||||
* 3.1.3 Register Fork Handlers, P1003.1c/Draft 10, P1003.1c/Draft 10, p. 27
|
||||
*
|
||||
* RTEMS does not support processes, so we fall under this and do not
|
||||
* provide this routine:
|
||||
*
|
||||
* "Either the implementation shall support the pthread_atfork() function
|
||||
* as described above or the pthread_atfork() funciton shall not be
|
||||
* provided."
|
||||
*/
|
||||
|
||||
/*
|
||||
* 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
|
||||
*/
|
||||
|
||||
int pthread_mutexattr_init(
|
||||
pthread_mutexattr_t *attr
|
||||
);
|
||||
|
||||
int pthread_mutexattr_destroy(
|
||||
pthread_mutexattr_t *attr
|
||||
);
|
||||
|
||||
int pthread_mutexattr_getpshared(
|
||||
const pthread_mutexattr_t *attr,
|
||||
int *pshared
|
||||
);
|
||||
|
||||
int pthread_mutexattr_setpshared(
|
||||
pthread_mutexattr_t *attr,
|
||||
int pshared
|
||||
);
|
||||
|
||||
/*
|
||||
* 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87
|
||||
*/
|
||||
|
||||
int pthread_mutex_init(
|
||||
pthread_mutex_t *mutex,
|
||||
const pthread_mutexattr_t *attr
|
||||
);
|
||||
|
||||
int pthread_mutex_destroy(
|
||||
pthread_mutex_t *mutex
|
||||
);
|
||||
|
||||
/*
|
||||
* This is used to statically initialize a pthread_mutex_t. Example:
|
||||
*
|
||||
* pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
*/
|
||||
|
||||
#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) 0xFFFFFFFF)
|
||||
|
||||
/*
|
||||
* 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
|
||||
*
|
||||
* NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29
|
||||
*/
|
||||
|
||||
int pthread_mutex_lock(
|
||||
pthread_mutex_t *mutex
|
||||
);
|
||||
|
||||
int pthread_mutex_trylock(
|
||||
pthread_mutex_t *mutex
|
||||
);
|
||||
|
||||
int pthread_mutex_unlock(
|
||||
pthread_mutex_t *mutex
|
||||
);
|
||||
|
||||
#if defined(_POSIX_TIMEOUTS)
|
||||
|
||||
int pthread_mutex_timedlock(
|
||||
pthread_mutex_t *mutex,
|
||||
const struct timespec *timeout
|
||||
);
|
||||
|
||||
#endif /* _POSIX_TIMEOUTS */
|
||||
|
||||
/*
|
||||
* 11.4.1 Condition Variable Initialization Attributes,
|
||||
* P1003.1c/Draft 10, p. 96
|
||||
*/
|
||||
|
||||
int pthread_condattr_init(
|
||||
pthread_condattr_t *attr
|
||||
);
|
||||
|
||||
int pthread_condattr_destroy(
|
||||
pthread_condattr_t *attr
|
||||
);
|
||||
|
||||
int pthread_condattr_getpshared(
|
||||
const pthread_condattr_t *attr,
|
||||
int *pshared
|
||||
);
|
||||
|
||||
int pthread_condattr_setpshared(
|
||||
pthread_condattr_t *attr,
|
||||
int pshared
|
||||
);
|
||||
|
||||
/*
|
||||
* 11.4.2 Initializing and Destroying a Condition Variable,
|
||||
* P1003.1c/Draft 10, p. 87
|
||||
*/
|
||||
|
||||
int pthread_cond_init(
|
||||
pthread_cond_t *cond,
|
||||
const pthread_condattr_t *attr
|
||||
);
|
||||
|
||||
int pthread_cond_destroy(
|
||||
pthread_cond_t *mutex
|
||||
);
|
||||
|
||||
/*
|
||||
* This is used to statically initialize a pthread_cond_t. Example:
|
||||
*
|
||||
* pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
|
||||
*/
|
||||
|
||||
#define PTHREAD_COND_INITIALIZER ((pthread_mutex_t) 0xFFFFFFFF)
|
||||
|
||||
/*
|
||||
* 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101
|
||||
*/
|
||||
|
||||
int pthread_cond_signal(
|
||||
pthread_cond_t *cond
|
||||
);
|
||||
|
||||
int pthread_cond_broadcast(
|
||||
pthread_cond_t *cond
|
||||
);
|
||||
|
||||
/*
|
||||
* 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105
|
||||
*/
|
||||
|
||||
int pthread_cond_wait(
|
||||
pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex
|
||||
);
|
||||
|
||||
int pthread_cond_timedwait(
|
||||
pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex,
|
||||
const struct timespec *abstime
|
||||
);
|
||||
|
||||
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
|
||||
|
||||
/*
|
||||
* 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
|
||||
*/
|
||||
|
||||
int pthread_attr_setscope(
|
||||
pthread_attr_t *attr,
|
||||
int contentionscope
|
||||
);
|
||||
|
||||
int pthread_attr_getscope(
|
||||
const pthread_attr_t *attr,
|
||||
int *contentionscope
|
||||
);
|
||||
|
||||
int pthread_attr_setinheritsched(
|
||||
pthread_attr_t *attr,
|
||||
int inheritsched
|
||||
);
|
||||
|
||||
int pthread_attr_getinheritsched(
|
||||
const pthread_attr_t *attr,
|
||||
int *inheritsched
|
||||
);
|
||||
|
||||
int pthread_attr_setschedpolicy(
|
||||
pthread_attr_t *attr,
|
||||
int policy
|
||||
);
|
||||
|
||||
int pthread_attr_getschedpolicy(
|
||||
const pthread_attr_t *attr,
|
||||
int *policy
|
||||
);
|
||||
|
||||
#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
|
||||
|
||||
int pthread_attr_setschedparam(
|
||||
pthread_attr_t *attr,
|
||||
const struct sched_param *param
|
||||
);
|
||||
|
||||
int pthread_attr_getschedparam(
|
||||
const pthread_attr_t *attr,
|
||||
struct sched_param *param
|
||||
);
|
||||
|
||||
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
|
||||
|
||||
/*
|
||||
* 13.5.2 Dynamic Thread Scheduling Parameters Access,
|
||||
* P1003.1c/Draft 10, p. 124
|
||||
*/
|
||||
|
||||
int pthread_getschedparam(
|
||||
pthread_t thread,
|
||||
int *policy,
|
||||
struct sched_param *param
|
||||
);
|
||||
|
||||
int pthread_setschedparam(
|
||||
pthread_t thread,
|
||||
int policy,
|
||||
struct sched_param *param
|
||||
);
|
||||
|
||||
#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
|
||||
|
||||
#if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT)
|
||||
|
||||
/*
|
||||
* 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
|
||||
*/
|
||||
|
||||
int pthread_mutexattr_setprotocol(
|
||||
pthread_mutexattr_t *attr,
|
||||
int protocol
|
||||
);
|
||||
|
||||
int pthread_mutexattr_getprotocol(
|
||||
const pthread_mutexattr_t *attr,
|
||||
int *protocol
|
||||
);
|
||||
|
||||
int pthread_mutexattr_setprioceiling(
|
||||
pthread_mutexattr_t *attr,
|
||||
int prioceiling
|
||||
);
|
||||
|
||||
int pthread_mutexattr_getprioceiling(
|
||||
const pthread_mutexattr_t *attr,
|
||||
int *prioceiling
|
||||
);
|
||||
|
||||
#endif /* _POSIX_THREAD_PRIO_INHERIT || _POSIX_THREAD_PRIO_PROTECT */
|
||||
|
||||
#if defined(_POSIX_THREAD_PRIO_PROTECT)
|
||||
|
||||
/*
|
||||
* 13.6.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131
|
||||
*/
|
||||
|
||||
int pthread_mutex_setprioceiling(
|
||||
pthread_mutex_t *mutex,
|
||||
int prioceiling,
|
||||
int *old_ceiling
|
||||
);
|
||||
|
||||
int pthread_mutex_getprioceiling(
|
||||
pthread_mutex_t *mutex,
|
||||
int *prioceiling
|
||||
);
|
||||
|
||||
#endif /* _POSIX_THREAD_PRIO_PROTECT */
|
||||
|
||||
/*
|
||||
* 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
|
||||
*/
|
||||
|
||||
int pthread_attr_init(
|
||||
pthread_attr_t *attr
|
||||
);
|
||||
|
||||
int pthread_attr_destroy(
|
||||
pthread_attr_t *attr
|
||||
);
|
||||
|
||||
int pthread_attr_getstacksize(
|
||||
const pthread_attr_t *attr,
|
||||
size_t *stacksize
|
||||
);
|
||||
|
||||
int pthread_attr_setstacksize(
|
||||
pthread_attr_t *attr,
|
||||
size_t stacksize
|
||||
);
|
||||
|
||||
int pthread_attr_getstackaddr(
|
||||
const pthread_attr_t *attr,
|
||||
void **stackaddr
|
||||
);
|
||||
|
||||
int pthread_attr_setstackaddr(
|
||||
pthread_attr_t *attr,
|
||||
void *stackaddr
|
||||
);
|
||||
|
||||
int pthread_attr_getdetachstate(
|
||||
const pthread_attr_t *attr,
|
||||
int *detachstate
|
||||
);
|
||||
|
||||
int pthread_attr_setdetachstate(
|
||||
pthread_attr_t *attr,
|
||||
int detachstate
|
||||
);
|
||||
|
||||
/*
|
||||
* 16.1.2 Thread Creation, P1003.1c/Draft 10, p. 144
|
||||
*/
|
||||
|
||||
int pthread_create(
|
||||
pthread_t *thread,
|
||||
const pthread_attr_t *attr,
|
||||
void *(*start_routine)( void * ),
|
||||
void *arg
|
||||
);
|
||||
|
||||
/*
|
||||
* 16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147
|
||||
*/
|
||||
|
||||
int pthread_join(
|
||||
pthread_t thread,
|
||||
void **value_ptr
|
||||
);
|
||||
|
||||
/*
|
||||
* 16.1.4 Detaching a Thread, P1003.1c/Draft 10, p. 149
|
||||
*/
|
||||
|
||||
int pthread_detach(
|
||||
pthread_t thread
|
||||
);
|
||||
|
||||
/*
|
||||
* 16.1.5.1 Thread Termination, p1003.1c/Draft 10, p. 150
|
||||
*/
|
||||
|
||||
void pthread_exit(
|
||||
void *value_ptr
|
||||
);
|
||||
|
||||
/*
|
||||
* 16.1.6 Get Calling Thread's ID, p1003.1c/Draft 10, p. XXX
|
||||
*/
|
||||
|
||||
pthread_t pthread_self( void );
|
||||
|
||||
/*
|
||||
* 16.1.7 Compare Thread IDs, p1003.1c/Draft 10, p. 153
|
||||
*/
|
||||
|
||||
int pthread_equal(
|
||||
pthread_t t1,
|
||||
pthread_t t2
|
||||
);
|
||||
|
||||
/*
|
||||
* 16.1.8 Dynamic Package Initialization
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is used to statically initialize a pthread_once_t. Example:
|
||||
*
|
||||
* pthread_once_t once = PTHREAD_ONCE_INIT;
|
||||
*
|
||||
* NOTE: This is named inconsistently -- it should be INITIALIZER.
|
||||
*/
|
||||
|
||||
#define PTHREAD_ONCE_INIT { 1, 0 } /* is initialized and not run */
|
||||
|
||||
int pthread_once(
|
||||
pthread_once_t *once_control,
|
||||
void (*init_routine)(void)
|
||||
);
|
||||
|
||||
/*
|
||||
* 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163
|
||||
*/
|
||||
|
||||
int pthread_key_create(
|
||||
pthread_key_t *key,
|
||||
void (*destructor)( void * )
|
||||
);
|
||||
|
||||
/*
|
||||
* 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165
|
||||
*/
|
||||
|
||||
int pthread_setspecific(
|
||||
pthread_key_t key,
|
||||
const void *value
|
||||
);
|
||||
|
||||
void *pthread_getspecific(
|
||||
pthread_key_t key
|
||||
);
|
||||
|
||||
/*
|
||||
* 17.1.3 Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167
|
||||
*/
|
||||
|
||||
int pthread_key_delete(
|
||||
pthread_key_t key
|
||||
);
|
||||
|
||||
/*
|
||||
* 18.2.1 Canceling Execution of a Thread, P1003.1c/Draft 10, p. 181
|
||||
*/
|
||||
|
||||
#define PTHREAD_CANCEL_ENABLE 0
|
||||
#define PTHREAD_CANCEL_DISABLE 1
|
||||
|
||||
#define PTHREAD_CANCEL_DEFERRED 0
|
||||
#define PTHREAD_CANCEL_ASYNCHRONOUS 1
|
||||
|
||||
int pthread_cancel(
|
||||
pthread_t thread
|
||||
);
|
||||
|
||||
/*
|
||||
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
|
||||
*/
|
||||
|
||||
int pthread_setcancelstate(
|
||||
int state,
|
||||
int *oldstate
|
||||
);
|
||||
|
||||
int pthread_setcanceltype(
|
||||
int type,
|
||||
int *oldtype
|
||||
);
|
||||
|
||||
void pthread_testcancel( void );
|
||||
|
||||
/*
|
||||
* 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184
|
||||
*/
|
||||
|
||||
void pthread_cleanup_push(
|
||||
void (*routine)( void * ),
|
||||
void *arg
|
||||
);
|
||||
|
||||
void pthread_cleanup_pop(
|
||||
int execute
|
||||
);
|
||||
|
||||
#if defined(_POSIX_THREAD_CPUTIME)
|
||||
|
||||
/*
|
||||
* 20.1.6 Accessing a Thread CPU-time Clock, P1003.4b/D8, p. 58
|
||||
*/
|
||||
|
||||
int pthread_getcpuclockid(
|
||||
pthread_t thread_id,
|
||||
clockid_t *clock_id
|
||||
);
|
||||
|
||||
/*
|
||||
* 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/D8, p. 59
|
||||
*/
|
||||
|
||||
int pthread_attr_setcputime(
|
||||
pthread_attr_t *attr,
|
||||
int clock_allowed
|
||||
);
|
||||
|
||||
int pthread_attr_getcputime(
|
||||
pthread_attr_t *attr,
|
||||
int *clock_allowed
|
||||
);
|
||||
|
||||
#endif /* defined(_POSIX_THREAD_CPUTIME) */
|
||||
|
||||
#endif /* defined(_POSIX_THREADS) */
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,88 +0,0 @@
|
||||
/* sched.h
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __POSIX_SCHEDULING_h
|
||||
#define __POSIX_SCHEDULING_h
|
||||
|
||||
#include <sys/features.h>
|
||||
|
||||
#if defined(_POSIX_PRIORITY_SCHEDULING)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include <sys/sched.h>
|
||||
#include <pthread.h>
|
||||
|
||||
/*
|
||||
* 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252
|
||||
*
|
||||
*/
|
||||
|
||||
int sched_setparam(
|
||||
pid_t pid,
|
||||
const struct sched_param *param
|
||||
);
|
||||
|
||||
/*
|
||||
* 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253
|
||||
*/
|
||||
|
||||
int sched_getparam(
|
||||
pid_t pid,
|
||||
const struct sched_param *param
|
||||
);
|
||||
|
||||
/*
|
||||
* 13.3.3 Set Scheduling Policy and Scheduling Parameters,
|
||||
* P1003.1b-1993, p. 254
|
||||
*/
|
||||
|
||||
int sched_setscheduler(
|
||||
pid_t pid,
|
||||
int policy,
|
||||
const struct sched_param *param
|
||||
);
|
||||
|
||||
/*
|
||||
* 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256
|
||||
*/
|
||||
|
||||
int sched_getscheduler(
|
||||
pid_t pid
|
||||
);
|
||||
|
||||
/*
|
||||
* 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
|
||||
*/
|
||||
|
||||
int sched_get_priority_max(
|
||||
int policy
|
||||
);
|
||||
|
||||
int sched_get_priority_min(
|
||||
int policy
|
||||
);
|
||||
|
||||
int sched_rr_get_interval(
|
||||
pid_t pid,
|
||||
struct timespec *interval
|
||||
);
|
||||
|
||||
#endif /* _POSIX_PRIORITY_SCHEDULING */
|
||||
|
||||
#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING)
|
||||
|
||||
/*
|
||||
* 13.3.5 Yield Processor, P1003.1b-1993, p. 257
|
||||
*/
|
||||
|
||||
int sched_yield( void );
|
||||
|
||||
#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
/* semaphore.h
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __POSIX_SEMAPHORE_h
|
||||
#define __POSIX_SEMAPHORE_h
|
||||
|
||||
#include <rtems/posix/features.h>
|
||||
|
||||
#if defined(_POSIX_SEMAPHORES)
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
/*
|
||||
* 11.1 Semaphore Characteristics, P1003.1b-1993, p.219
|
||||
*/
|
||||
|
||||
typedef int sem_t;
|
||||
|
||||
/*
|
||||
* 11.2.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219
|
||||
*/
|
||||
|
||||
int sem_init(
|
||||
sem_t *sem,
|
||||
int pshared,
|
||||
unsigned int value
|
||||
);
|
||||
|
||||
/*
|
||||
* 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220
|
||||
*/
|
||||
|
||||
int sem_destroy(
|
||||
sem_t *sem
|
||||
);
|
||||
|
||||
/*
|
||||
* 11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221
|
||||
*
|
||||
* NOTE: Follows open() calling conventions.
|
||||
*/
|
||||
|
||||
sem_t *sem_open(
|
||||
const char *name,
|
||||
int oflag,
|
||||
...
|
||||
);
|
||||
|
||||
/*
|
||||
* 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224
|
||||
*/
|
||||
|
||||
int sem_close(
|
||||
sem_t *sem
|
||||
);
|
||||
|
||||
/*
|
||||
* 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225
|
||||
*/
|
||||
|
||||
int sem_unlink(
|
||||
const char *name
|
||||
);
|
||||
|
||||
/*
|
||||
* 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
|
||||
*
|
||||
* NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
|
||||
*/
|
||||
|
||||
int sem_wait(
|
||||
sem_t *sem
|
||||
);
|
||||
|
||||
int sem_trywait(
|
||||
sem_t *sem
|
||||
);
|
||||
|
||||
#if defined(_POSIX_TIMEOUTS)
|
||||
int sem_timedwait(
|
||||
sem_t *sem,
|
||||
const struct timespec *timeout
|
||||
);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227
|
||||
*/
|
||||
|
||||
int sem_post(
|
||||
sem_t *sem
|
||||
);
|
||||
|
||||
/*
|
||||
* 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229
|
||||
*/
|
||||
|
||||
int sem_getvalue(
|
||||
sem_t *sem,
|
||||
int *sval
|
||||
);
|
||||
|
||||
#endif /* _POSIX_SEMAPHORES */
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,89 +0,0 @@
|
||||
/* unistd.h
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __POSIX_UNISTD_h
|
||||
#define __POSIX_UNISTD_h
|
||||
|
||||
#include <rtems/posix/features.h>
|
||||
|
||||
/*
|
||||
* 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 96
|
||||
*
|
||||
* NOTE: Table 4-2, Configurable System Variables, p. 96
|
||||
*/
|
||||
|
||||
#define _SC_AIO_LISTIO_MAX 0
|
||||
#define _SC_AIO_MAX 1
|
||||
#define _SC_AIO_PRIO_DELTA_MAX 2
|
||||
#define _SC_ARG_MAX 3
|
||||
#define _SC_CHILD_MAX 4
|
||||
#define _SC_CLK_TCK 5
|
||||
#define _SC_DELAYTIMER_MAX 6
|
||||
#define _SC_MQ_OPEN_MAX 7
|
||||
#define _SC_MQ_PRIO_MAX 8
|
||||
#define _SC_NGROUPS_MAX 9
|
||||
#define _SC_OPEN_MAX 10
|
||||
#define _SC_PAGESIZE 11
|
||||
#define _SC_RTSIG_MAX 12
|
||||
#define _SC_SEM_NSEMS_MAX 13
|
||||
#define _SC_SEM_VALUE_MAX 14
|
||||
#define _SC_SIGQUEUE_MAX 15
|
||||
#define _SC_STREAM_MAX 16
|
||||
#define _SC_TIMER_MAX 17
|
||||
#define _SC_TZNAME_MAX 18
|
||||
|
||||
#define _SC_ASYNCHRONOUS_IO 19
|
||||
#define _SC_FSYNC 20
|
||||
#define _SC_JOB_CONTROL 21
|
||||
#define _SC_MAPPED_FILES 22
|
||||
#define _SC_MEMLOCK 23
|
||||
#define _SC_MEMLOCK_RANGE 24
|
||||
#define _SC_MEMORY_PROTECTION 25
|
||||
#define _SC_MESSAGE_PASSING 26
|
||||
#define _SC_PRIORITIZED_IO 27
|
||||
#define _SC_REALTIME_SIGNALS 28
|
||||
#define _SC_SAVED_IDS 29
|
||||
#define _SC_SEMAPHORES 30
|
||||
#define _SC_SHARED_MEMORY_OBJECTS 31
|
||||
#define _SC_SYNCHRONIZED_IO 32
|
||||
#define _SC_TIMERS 33
|
||||
#define _SC_VERSION 34
|
||||
|
||||
/*
|
||||
* P1003.1c/D10, p. 52 adds the following.
|
||||
*/
|
||||
|
||||
#define _SC_GETGR_R_SIZE_MAX 35
|
||||
#define _SC_GETPW_R_SIZE_MAX 36
|
||||
#define _SC_LOGIN_NAME_MAX 37
|
||||
#define _SC_THREAD_DESTRUCTOR_ITERATIONS 38
|
||||
#define _SC_THREAD_KEYS_MAX 39
|
||||
#define _SC_THREAD_STACK_MIN 40
|
||||
#define _SC_THREAD_THREADS_MAX 41
|
||||
#define _SC_TTY_NAME_MAX 42
|
||||
|
||||
#define _SC_THREADS 43
|
||||
#define _SC_THREAD_ATTR_STACKADDR 44
|
||||
#define _SC_THREAD_ATTR_STACKSIZE 45
|
||||
#define _SC_THREAD_PRIORITY_SCHEDULING 46
|
||||
#define _SC_THREAD_PRIO_INHERIT 47
|
||||
#define _SC_THREAD_PRIO_CEILING 48
|
||||
#define _SC_THREAD_PROCESS_SHARED 49
|
||||
#define _SC_THREAD_SAFE_FUNCTIONS 50
|
||||
|
||||
/* JRS: 04/02/98: _SC_THREAD_PRIO_CEILING seems to have changed names
|
||||
* in the final standard to _SC_THREAD_PRIO_PROTECT.
|
||||
*/
|
||||
|
||||
/*
|
||||
* 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 95
|
||||
*/
|
||||
|
||||
long sysconf(
|
||||
int name
|
||||
);
|
||||
|
||||
#endif
|
||||
/* end of include */
|
||||
@@ -1,34 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
H_PIECES= cond condmp config key mutex mutexmp posixapi \
|
||||
priority psignal pthread pthreadmp seterr threadsup time
|
||||
#H_PIECES= cancel cond condmp intr key mqueue mqueuemp mutex \
|
||||
# mutexmp pthread pthreadmp priority semaphore semaphoremp threadsup \
|
||||
# time
|
||||
H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
|
||||
|
||||
SRCS=$(H_FILES)
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/leaf.cfg
|
||||
|
||||
#
|
||||
# Add your list of files to delete here. The config files
|
||||
# already know how to delete some stuff, so you may want
|
||||
# to just run 'make clean' first to see what gets missed.
|
||||
# 'make clobber' already includes 'make clean'
|
||||
#
|
||||
|
||||
CLEAN_ADDITIONS +=
|
||||
CLOBBER_ADDITIONS +=
|
||||
|
||||
all: $(SRCS)
|
||||
$(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/posix
|
||||
@@ -1,16 +0,0 @@
|
||||
/* rtems/posix/cancel.h
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_CANCEL_h
|
||||
#define __RTEMS_POSIX_CANCEL_h
|
||||
|
||||
typedef struct {
|
||||
Chain_Node Node;
|
||||
void (*routine)( void * );
|
||||
void *arg;
|
||||
} POSIX_Cancel_Handler_control;
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,130 +0,0 @@
|
||||
/* rtems/posix/cond.h
|
||||
*
|
||||
* This include file contains all the private support information for
|
||||
* POSIX condition variables.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_h
|
||||
#define __RTEMS_POSIX_CONDITION_VARIABLES_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/score/object.h>
|
||||
#include <rtems/score/threadq.h>
|
||||
|
||||
/*
|
||||
* Constant to indicate condition variable does not currently have
|
||||
* a mutex assigned to it.
|
||||
*/
|
||||
|
||||
#define POSIX_CONDITION_VARIABLES_NO_MUTEX 0
|
||||
|
||||
/*
|
||||
* Data Structure used to manage a POSIX condition variable
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
Objects_Control Object;
|
||||
int process_shared;
|
||||
pthread_mutex_t Mutex;
|
||||
Thread_queue_Control Wait_queue;
|
||||
} POSIX_Condition_variables_Control;
|
||||
|
||||
/*
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Condition_variables_Information;
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_Manager_initialization
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
void _POSIX_Condition_variables_Manager_initialization(
|
||||
unsigned32 maximum_condition_variables
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_Allocate
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function allocates a condition variable control block from
|
||||
* the inactive chain of free condition variable control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *
|
||||
_POSIX_Condition_variables_Allocate( void );
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_Free
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine frees a condition variable control block to the
|
||||
* inactive chain of free condition variable control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
|
||||
POSIX_Condition_variables_Control *the_condition_variable
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_Get
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function maps condition variable IDs to condition variable control
|
||||
* blocks. If ID corresponds to a local condition variable, then it returns
|
||||
* the_condition variable control pointer which maps to ID and location
|
||||
* is set to OBJECTS_LOCAL. if the condition variable ID is global and
|
||||
* resides on a remote node, then location is set to OBJECTS_REMOTE,
|
||||
* and the_condition variable is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_condition variable is undefined.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
|
||||
Objects_Id *id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_Is_null
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function returns TRUE if the_condition variable is NULL
|
||||
* and FALSE otherwise.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
|
||||
POSIX_Condition_variables_Control *the_condition_variable
|
||||
);
|
||||
|
||||
#include <rtems/posix/cond.inl>
|
||||
#include <rtems/posix/condmp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
/* condmp.h
|
||||
*
|
||||
* This include file contains all the constants and structures associated
|
||||
* with the Multiprocessing Support in the POSIX Condition Variable Manager.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_MP_h
|
||||
#define __RTEMS_POSIX_CONDITION_VARIABLES_MP_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/score/mppkt.h>
|
||||
#include <rtems/score/object.h>
|
||||
#include <rtems/score/thread.h>
|
||||
#include <rtems/score/watchdog.h>
|
||||
|
||||
/*
|
||||
* The following enumerated type defines the list of
|
||||
* remote condition variable operations.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE = 0,
|
||||
POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE = 1,
|
||||
POSIX_CONDITION_VARIABLES_MP_EXTRACT_PROXY = 2,
|
||||
POSIX_CONDITION_VARIABLES_MP_OBTAIN_REQUEST = 3,
|
||||
POSIX_CONDITION_VARIABLES_MP_OBTAIN_RESPONSE = 4,
|
||||
POSIX_CONDITION_VARIABLES_MP_RELEASE_REQUEST = 5,
|
||||
POSIX_CONDITION_VARIABLES_MP_RELEASE_RESPONSE = 6,
|
||||
} POSIX_Condition_variables_MP_Remote_operations;
|
||||
|
||||
/*
|
||||
* The following data structure defines the packet used to perform
|
||||
* remote condition variable operations.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
MP_packet_Prefix Prefix;
|
||||
POSIX_Condition_variables_MP_Remote_operations operation;
|
||||
Objects_Name name;
|
||||
boolean wait; /* XXX options */
|
||||
Objects_Id proxy_id;
|
||||
} POSIX_Condition_variables_MP_Packet;
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_MP_Send_process_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* process operation can be performed on another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Condition_variables_MP_Send_process_packet (
|
||||
POSIX_Condition_variables_MP_Remote_operations operation,
|
||||
Objects_Id condition_variables_id,
|
||||
Objects_Name name,
|
||||
Objects_Id proxy_id
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_MP_Send_request_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* directive operation can be initiated on another node.
|
||||
*/
|
||||
|
||||
int _POSIX_Condition_variables_MP_Send_request_packet (
|
||||
POSIX_Condition_variables_MP_Remote_operations operation,
|
||||
Objects_Id condition_variables_id,
|
||||
boolean wait, /* XXX options */
|
||||
Watchdog_Interval timeout
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_MP_Send_response_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* directive can be performed on another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Condition_variables_MP_Send_response_packet (
|
||||
POSIX_Condition_variables_MP_Remote_operations operation,
|
||||
Objects_Id condition_variables_id,
|
||||
Thread_Control *the_thread
|
||||
);
|
||||
|
||||
/*
|
||||
*
|
||||
* _POSIX_Condition_variables_MP_Process_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs the actions specific to this package for
|
||||
* the request from another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Condition_variables_MP_Process_packet (
|
||||
MP_packet_Prefix *the_packet_prefix
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_MP_Send_object_was_deleted
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine is invoked indirectly by the thread queue
|
||||
* when a proxy has been removed from the thread queue and
|
||||
* the remote node must be informed of this.
|
||||
*/
|
||||
|
||||
void _POSIX_Condition_variables_MP_Send_object_was_deleted (
|
||||
Thread_Control *the_proxy
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_MP_Send_extract_proxy
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine is invoked when a task is deleted and it
|
||||
* has a proxy which must be removed from a thread queue and
|
||||
* the remote node must be informed of this.
|
||||
*/
|
||||
|
||||
void _POSIX_Condition_variables_MP_Send_extract_proxy (
|
||||
Thread_Control *the_thread
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_MP_Get_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function is used to obtain a condition variable mp packet.
|
||||
*/
|
||||
|
||||
POSIX_Condition_variables_MP_Packet
|
||||
*_POSIX_Condition_variables_MP_Get_packet ( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of file */
|
||||
@@ -1,59 +0,0 @@
|
||||
/* config.h
|
||||
*
|
||||
* This include file contains the table of user defined configuration
|
||||
* parameters specific for the POSIX API.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_CONFIGURATION_h
|
||||
#define __RTEMS_POSIX_CONFIGURATION_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* XXX
|
||||
*
|
||||
* The following records define the Configuration Table. The
|
||||
* information contained in this table is required in all
|
||||
* RTEMS systems, whether single or multiprocessor. This
|
||||
* table primarily defines the following:
|
||||
*
|
||||
* + required number of each object type
|
||||
*/
|
||||
|
||||
/*
|
||||
* For now, we are only allowing the user to specify the entry point
|
||||
* for posix initialization threads.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
void *(*thread_entry)(void *);
|
||||
} posix_initialization_threads_table;
|
||||
|
||||
typedef struct {
|
||||
int maximum_threads;
|
||||
int maximum_mutexes;
|
||||
int maximum_condition_variables;
|
||||
int maximum_keys;
|
||||
int maximum_queued_signals;
|
||||
int number_of_initialization_threads;
|
||||
posix_initialization_threads_table *User_initialization_threads_table;
|
||||
} posix_api_configuration_table;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,154 +0,0 @@
|
||||
/* rtems/posix/intr.h
|
||||
*
|
||||
* This include file contains all the private support information for
|
||||
* POSIX Interrupt Manager.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_KEY_h
|
||||
#define __RTEMS_POSIX_KEY_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/score/isr.h>
|
||||
#include <rtems/score/object.h>
|
||||
|
||||
/*
|
||||
* Data Structure used to manage each POSIX Interrupt Vector
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
int number_installed;
|
||||
int lock_count;
|
||||
int deferred_count;
|
||||
Chain_Control Handlers;
|
||||
} POSIX_Interrupt_Control;
|
||||
|
||||
/*
|
||||
* Data Structure used to manage a POSIX Interrupt Handler
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
Objects_Control Object;
|
||||
int is_active;
|
||||
intr_t vector;
|
||||
Thread_Control *server;
|
||||
int (*handler)( void *area );
|
||||
volatile void *user_data_area;
|
||||
} POSIX_Interrupt_Handler_control;
|
||||
|
||||
/*
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Interrupt_Handlers_Information;
|
||||
|
||||
/*
|
||||
* The following is an array which is used to manage the set of
|
||||
* interrupt handlers installed on each vector.
|
||||
*/
|
||||
|
||||
POSIX_EXTERN POSIX_Interrupt_Control
|
||||
_POSIX_Interrupt_Information[ ISR_NUMBER_OF_VECTORS ];
|
||||
|
||||
/*
|
||||
* _POSIX_Interrupt_Manager_initialization
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
void _POSIX_Interrupt_Manager_initialization(
|
||||
unsigned32 maximum_interrupt_handlers
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Interrupt_Allocate
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function allocates a interrupt handler control block from
|
||||
* the inactive chain of free interrupt handler control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
|
||||
_POSIX_Interrupt_Allocate( void );
|
||||
|
||||
/*
|
||||
* _POSIX_Interrupt_Free
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine frees a interrupt handler control block to the
|
||||
* inactive chain of free interrupt handler control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
|
||||
POSIX_Interrupt_Handler_control *the_intr
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Interrupt_Get
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function maps interrupt handler IDs to interrupt handler control
|
||||
* blocks. If ID corresponds to a local interrupt handler, then it returns
|
||||
* the_intr control pointer which maps to ID and location
|
||||
* is set to OBJECTS_LOCAL. if the interrupt handler ID is global and
|
||||
* resides on a remote node, then location is set to OBJECTS_REMOTE,
|
||||
* and the_intr is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_intr is undefined.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
|
||||
Objects_Id id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Interrupt_Is_null
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function returns TRUE if the_intr is NULL and FALSE otherwise.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
|
||||
POSIX_Interrupt_Handler_control *the_intr
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Interrupt_Handler
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function XXX.
|
||||
*/
|
||||
|
||||
void _POSIX_Interrupt_Handler(
|
||||
ISR_Vector_number vector
|
||||
);
|
||||
|
||||
#include <rtems/posix/intr.inl>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
/* rtems/posix/key.h
|
||||
*
|
||||
* This include file contains all the private support information for
|
||||
* POSIX key.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_KEY_h
|
||||
#define __RTEMS_POSIX_KEY_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Data Structure used to manage a POSIX key
|
||||
*
|
||||
* NOTE: The Values is a table indexed by the index portion of the
|
||||
* ID of the currently executing thread.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
Objects_Control Object;
|
||||
boolean is_active;
|
||||
void (*destructor)( void * );
|
||||
void **Values[ OBJECTS_CLASSES_LAST_THREAD_CLASS + 1 ];
|
||||
} POSIX_Keys_Control;
|
||||
|
||||
/*
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Keys_Information;
|
||||
|
||||
/*
|
||||
* _POSIX_Keys_Manager_initialization
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
void _POSIX_Key_Manager_initialization(
|
||||
unsigned32 maximum_keys
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Keys_Run_destructors
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function executes all the destructors associated with the thread's
|
||||
* keys. This function will execute until all values have been set to NULL.
|
||||
*
|
||||
* NOTE: This is the routine executed when a thread exits to
|
||||
* run through all the keys and do the destructor action.
|
||||
*/
|
||||
|
||||
void _POSIX_Keys_Run_destructors(
|
||||
Thread_Control *thread
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Keys_Allocate
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function allocates a keys control block from
|
||||
* the inactive chain of free keys control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void );
|
||||
|
||||
/*
|
||||
* _POSIX_Keys_Free
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine frees a keys control block to the
|
||||
* inactive chain of free keys control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
|
||||
POSIX_Keys_Control *the_key
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Keys_Get
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function maps key IDs to key control blocks.
|
||||
* If ID corresponds to a local keys, then it returns
|
||||
* the_key control pointer which maps to ID and location
|
||||
* is set to OBJECTS_LOCAL. if the keys ID is global and
|
||||
* resides on a remote node, then location is set to OBJECTS_REMOTE,
|
||||
* and the_key is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_key is undefined.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
|
||||
Objects_Id id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Keys_Is_null
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function returns TRUE if the_key is NULL and FALSE otherwise.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
|
||||
POSIX_Keys_Control *the_key
|
||||
);
|
||||
|
||||
#include <rtems/posix/key.inl>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
/* rtems/posix/mqueue.h
|
||||
*
|
||||
* This include file contains all the private support information for
|
||||
* POSIX Message Queues.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_h
|
||||
#define __RTEMS_POSIX_MESSAGE_QUEUE_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/score/coremsg.h>
|
||||
#include <rtems/score/object.h>
|
||||
|
||||
/*
|
||||
* Data Structure used to manage a POSIX message queue
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
Objects_Control Object;
|
||||
int process_shared;
|
||||
int flags;
|
||||
boolean named;
|
||||
boolean linked;
|
||||
boolean blocking;
|
||||
unsigned32 open_count;
|
||||
CORE_message_queue_Control Message_queue;
|
||||
struct sigevent notification;
|
||||
} POSIX_Message_queue_Control;
|
||||
|
||||
/*
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information;
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_Manager_initialization
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
void _POSIX_Message_queue_Manager_initialization(
|
||||
unsigned32 maximum_message_queues
|
||||
);
|
||||
|
||||
/*
|
||||
*
|
||||
* _POSIX_Message_queue_Create_support
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs the creation of a message queue utilizing the
|
||||
* core message queue.
|
||||
*/
|
||||
|
||||
int _POSIX_Message_queue_Create_support(
|
||||
const char *name,
|
||||
int pshared,
|
||||
unsigned int oflag,
|
||||
struct mq_attr *attr,
|
||||
POSIX_Message_queue_Control **message_queue
|
||||
);
|
||||
|
||||
/*
|
||||
*
|
||||
* _POSIX_Message_queue_Send_support
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine posts a message to a specified message queue.
|
||||
*/
|
||||
|
||||
int _POSIX_Message_queue_Send_support(
|
||||
mqd_t mqdes,
|
||||
const char *msg_ptr,
|
||||
unsigned32 msg_len,
|
||||
Priority_Control msg_prio,
|
||||
Watchdog_Interval timeout
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_Allocate
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function allocates a message queue control block from
|
||||
* the inactive chain of free message queue control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_Free
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine frees a message queue control block to the
|
||||
* inactive chain of free message queue control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
|
||||
POSIX_Message_queue_Control *the_mq
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_Get
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function maps message queue IDs to message queue control blocks.
|
||||
* If ID corresponds to a local message queue, then it returns
|
||||
* the_mq control pointer which maps to ID and location
|
||||
* is set to OBJECTS_LOCAL. if the message queue ID is global and
|
||||
* resides on a remote node, then location is set to OBJECTS_REMOTE,
|
||||
* and the_message queue is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_mq is undefined.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
|
||||
Objects_Id id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_Is_null
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
|
||||
POSIX_Message_queue_Control *the_mq
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_Name_to_id
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
int _POSIX_Message_queue_Name_to_id(
|
||||
const char *name,
|
||||
Objects_Id *id
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_Priority_to_core
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
|
||||
unsigned int priority
|
||||
);
|
||||
|
||||
#include <rtems/posix/mqueue.inl>
|
||||
#include <rtems/posix/mqueuemp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
/* mqueuemp.h
|
||||
*
|
||||
* This include file contains all the constants and structures associated
|
||||
* with the Multiprocessing Support in the POSIX Message Queue Manager.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_MP_h
|
||||
#define __RTEMS_POSIX_MESSAGE_QUEUE_MP_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/score/mppkt.h>
|
||||
#include <rtems/score/object.h>
|
||||
#include <rtems/score/thread.h>
|
||||
#include <rtems/score/watchdog.h>
|
||||
|
||||
/*
|
||||
* The following enumerated type defines the list of
|
||||
* remote message queue operations.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0,
|
||||
POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1,
|
||||
POSIX_MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2,
|
||||
POSIX_MESSAGE_QUEUE_MP_OBTAIN_REQUEST = 3,
|
||||
POSIX_MESSAGE_QUEUE_MP_OBTAIN_RESPONSE = 4,
|
||||
POSIX_MESSAGE_QUEUE_MP_RELEASE_REQUEST = 5,
|
||||
POSIX_MESSAGE_QUEUE_MP_RELEASE_RESPONSE = 6,
|
||||
} POSIX_Message_queue_MP_Remote_operations;
|
||||
|
||||
/*
|
||||
* The following data structure defines the packet used to perform
|
||||
* remote message queue operations.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
MP_packet_Prefix Prefix;
|
||||
POSIX_Message_queue_MP_Remote_operations operation;
|
||||
Objects_Name name;
|
||||
boolean wait; /* XXX options */
|
||||
Objects_Id proxy_id;
|
||||
} POSIX_Message_queue_MP_Packet;
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_MP_Send_process_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* process operation can be performed on another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Message_queue_MP_Send_process_packet (
|
||||
POSIX_Message_queue_MP_Remote_operations operation,
|
||||
Objects_Id mq_id,
|
||||
Objects_Name name,
|
||||
Objects_Id proxy_id
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_MP_Send_request_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* directive operation can be initiated on another node.
|
||||
*/
|
||||
|
||||
int _POSIX_Message_queue_MP_Send_request_packet (
|
||||
POSIX_Message_queue_MP_Remote_operations operation,
|
||||
Objects_Id mq_id,
|
||||
boolean wait, /* XXX options */
|
||||
Watchdog_Interval timeout
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_MP_Send_response_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* directive can be performed on another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Message_queue_MP_Send_response_packet (
|
||||
POSIX_Message_queue_MP_Remote_operations operation,
|
||||
Objects_Id mq_id,
|
||||
Thread_Control *the_thread
|
||||
);
|
||||
|
||||
/*
|
||||
*
|
||||
* _POSIX_Message_queue_MP_Process_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs the actions specific to this package for
|
||||
* the request from another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Message_queue_MP_Process_packet (
|
||||
MP_packet_Prefix *the_packet_prefix
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_MP_Send_object_was_deleted
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine is invoked indirectly by the thread queue
|
||||
* when a proxy has been removed from the thread queue and
|
||||
* the remote node must be informed of this.
|
||||
*/
|
||||
|
||||
void _POSIX_Message_queue_MP_Send_object_was_deleted (
|
||||
Thread_Control *the_proxy
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_MP_Send_extract_proxy
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine is invoked when a task is deleted and it
|
||||
* has a proxy which must be removed from a thread queue and
|
||||
* the remote node must be informed of this.
|
||||
*/
|
||||
|
||||
void _POSIX_Message_queue_MP_Send_extract_proxy (
|
||||
Thread_Control *the_thread
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_MP_Get_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function is used to obtain a message queue mp packet.
|
||||
*/
|
||||
|
||||
POSIX_Message_queue_MP_Packet *_POSIX_Message_queue_MP_Get_packet ( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of file */
|
||||
@@ -1,120 +0,0 @@
|
||||
/* rtems/posix/mutex.h
|
||||
*
|
||||
* This include file contains all the private support information for
|
||||
* POSIX mutex's.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_MUTEX_h
|
||||
#define __RTEMS_POSIX_MUTEX_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/score/coremutex.h>
|
||||
#include <pthread.h>
|
||||
|
||||
/*
|
||||
* Data Structure used to manage a POSIX mutex
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
Objects_Control Object;
|
||||
int process_shared;
|
||||
CORE_mutex_Control Mutex;
|
||||
} POSIX_Mutex_Control;
|
||||
|
||||
/*
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Mutex_Information;
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_Manager_initialization
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
void _POSIX_Mutex_Manager_initialization(
|
||||
unsigned32 maximum_mutexes
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_Allocate
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function allocates a mutexes control block from
|
||||
* the inactive chain of free mutexes control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void );
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_Free
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine frees a mutexes control block to the
|
||||
* inactive chain of free mutexes control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
|
||||
POSIX_Mutex_Control *the_mutex
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_Get
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function maps mutexes IDs to mutexes control blocks.
|
||||
* If ID corresponds to a local mutexes, then it returns
|
||||
* the_mutex control pointer which maps to ID and location
|
||||
* is set to OBJECTS_LOCAL. if the mutexes ID is global and
|
||||
* resides on a remote node, then location is set to OBJECTS_REMOTE,
|
||||
* and the_mutex is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_mutex is undefined.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
|
||||
Objects_Id *id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_Is_null
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function returns TRUE if the_mutex is NULL and FALSE otherwise.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
|
||||
POSIX_Mutex_Control *the_mutex
|
||||
);
|
||||
|
||||
#include <rtems/posix/mutex.inl>
|
||||
#include <rtems/posix/mutexmp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
/* mutexmp.h
|
||||
*
|
||||
* This include file contains all the constants and structures associated
|
||||
* with the Multiprocessing Support in the POSIX Mutex Manager.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_MUTEX_MP_h
|
||||
#define __RTEMS_POSIX_MUTEX_MP_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/score/mppkt.h>
|
||||
#include <rtems/score/object.h>
|
||||
#include <rtems/score/thread.h>
|
||||
#include <rtems/score/watchdog.h>
|
||||
|
||||
/*
|
||||
* The following enumerated type defines the list of
|
||||
* remote mutex operations.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
POSIX_MUTEX_MP_ANNOUNCE_CREATE = 0,
|
||||
POSIX_MUTEX_MP_ANNOUNCE_DELETE = 1,
|
||||
POSIX_MUTEX_MP_EXTRACT_PROXY = 2,
|
||||
POSIX_MUTEX_MP_OBTAIN_REQUEST = 3,
|
||||
POSIX_MUTEX_MP_OBTAIN_RESPONSE = 4,
|
||||
POSIX_MUTEX_MP_RELEASE_REQUEST = 5,
|
||||
POSIX_MUTEX_MP_RELEASE_RESPONSE = 6,
|
||||
} POSIX_Mutex_MP_Remote_operations;
|
||||
|
||||
/*
|
||||
* The following data structure defines the packet used to perform
|
||||
* remote mutex operations.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
MP_packet_Prefix Prefix;
|
||||
POSIX_Mutex_MP_Remote_operations operation;
|
||||
Objects_Name name;
|
||||
boolean wait; /* XXX options */
|
||||
Objects_Id proxy_id;
|
||||
} POSIX_Mutex_MP_Packet;
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_MP_Send_process_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* process operation can be performed on another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Mutex_MP_Send_process_packet (
|
||||
POSIX_Mutex_MP_Remote_operations operation,
|
||||
Objects_Id mutex_id,
|
||||
Objects_Name name,
|
||||
Objects_Id proxy_id
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_MP_Send_request_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* directive operation can be initiated on another node.
|
||||
*/
|
||||
|
||||
int _POSIX_Mutex_MP_Send_request_packet (
|
||||
POSIX_Mutex_MP_Remote_operations operation,
|
||||
Objects_Id mutex_id,
|
||||
boolean wait, /* XXX options */
|
||||
Watchdog_Interval timeout
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_MP_Send_response_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* directive can be performed on another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Mutex_MP_Send_response_packet (
|
||||
POSIX_Mutex_MP_Remote_operations operation,
|
||||
Objects_Id mutex_id,
|
||||
Thread_Control *the_thread
|
||||
);
|
||||
|
||||
/*
|
||||
*
|
||||
* _POSIX_Mutex_MP_Process_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs the actions specific to this package for
|
||||
* the request from another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Mutex_MP_Process_packet (
|
||||
MP_packet_Prefix *the_packet_prefix
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_MP_Send_object_was_deleted
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine is invoked indirectly by the thread queue
|
||||
* when a proxy has been removed from the thread queue and
|
||||
* the remote node must be informed of this.
|
||||
*/
|
||||
|
||||
void _POSIX_Mutex_MP_Send_object_was_deleted (
|
||||
Thread_Control *the_proxy
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_MP_Send_extract_proxy
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine is invoked when a task is deleted and it
|
||||
* has a proxy which must be removed from a thread queue and
|
||||
* the remote node must be informed of this.
|
||||
*/
|
||||
|
||||
void _POSIX_Mutex_MP_Send_extract_proxy (
|
||||
Thread_Control *the_thread
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_MP_Get_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function is used to obtain a mutex mp packet.
|
||||
*/
|
||||
|
||||
POSIX_Mutex_MP_Packet *_POSIX_Mutex_MP_Get_packet ( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of file */
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* POSIX API Support
|
||||
*
|
||||
* NOTE:
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __POSIX_API_h
|
||||
#define __POSIX_API_h
|
||||
|
||||
#include <rtems/config.h>
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_API_Initialize
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
void _POSIX_API_Initialize(
|
||||
rtems_configuration_table *configuration_table
|
||||
);
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_PRIORITY_h
|
||||
#define __RTEMS_POSIX_PRIORITY_h
|
||||
|
||||
#include <rtems/score/priority.h>
|
||||
|
||||
/*
|
||||
* 1003.1b-1993,2.2.2.80 definition of priority, p. 19
|
||||
*
|
||||
* "Numericallly higher values represent higher priorities."
|
||||
*
|
||||
* Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
|
||||
*
|
||||
* There are only 254 posix priority levels since a task at priority level
|
||||
* 255 would never run because of the RTEMS idle task. This is necessary
|
||||
* because GNAT maps the lowest Ada task priority to the lowest thread
|
||||
* priority. The lowest priority Ada task should get to run, so there is
|
||||
* a fundamental conflict with having 255 priorities.
|
||||
*/
|
||||
|
||||
#define POSIX_SCHEDULER_MAXIMUM_PRIORITY (254)
|
||||
|
||||
#define POSIX_SCHEDULER_MINIMUM_PRIORITY (1)
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
|
||||
int priority
|
||||
);
|
||||
|
||||
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
|
||||
int priority
|
||||
);
|
||||
|
||||
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
|
||||
Priority_Control priority
|
||||
);
|
||||
|
||||
#include <rtems/posix/priority.inl>
|
||||
|
||||
#endif
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_SIGNALS_h
|
||||
#define __RTEMS_POSIX_SIGNALS_h
|
||||
|
||||
typedef struct {
|
||||
Chain_Node Node;
|
||||
siginfo_t Info;
|
||||
} POSIX_signals_Siginfo_node;
|
||||
|
||||
void _POSIX_signals_Manager_Initialization(
|
||||
int maximum_queued_signals
|
||||
);
|
||||
|
||||
void _POSIX_signals_Post_switch_extension(
|
||||
Thread_Control *the_thread
|
||||
);
|
||||
|
||||
#endif
|
||||
/* end of file */
|
||||
@@ -1,123 +0,0 @@
|
||||
/* rtems/posix/pthread.h
|
||||
*
|
||||
* This include file contains all the private support information for
|
||||
* POSIX threads.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_THREADS_h
|
||||
#define __RTEMS_POSIX_THREADS_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/posix/config.h>
|
||||
#include <rtems/posix/threadsup.h>
|
||||
|
||||
#define PTHREAD_MINIMUM_STACK_SIZE (STACK_MINIMUM_SIZE * 2)
|
||||
|
||||
/*
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Threads_Information;
|
||||
|
||||
/*
|
||||
* These are used to manage the user initialization threads.
|
||||
*/
|
||||
|
||||
POSIX_EXTERN posix_initialization_threads_table
|
||||
*_POSIX_Threads_User_initialization_threads;
|
||||
POSIX_EXTERN unsigned32 _POSIX_Threads_Number_of_initialization_threads;
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_Manager_initialization
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
void _POSIX_Threads_Manager_initialization(
|
||||
unsigned32 maximum_pthreads,
|
||||
unsigned32 number_of_initialization_threads,
|
||||
posix_initialization_threads_table *user_threads
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_Allocate
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function allocates a pthread control block from
|
||||
* the inactive chain of free pthread control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void );
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_Free
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine frees a pthread control block to the
|
||||
* inactive chain of free pthread control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free(
|
||||
Thread_Control *the_pthread
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_Get
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function maps pthread IDs to pthread control blocks.
|
||||
* If ID corresponds to a local pthread, then it returns
|
||||
* the_pthread control pointer which maps to ID and location
|
||||
* is set to OBJECTS_LOCAL. if the pthread ID is global and
|
||||
* resides on a remote node, then location is set to OBJECTS_REMOTE,
|
||||
* and the_pthread is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_pthread is undefined.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get(
|
||||
pthread_t id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_Is_null
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function returns TRUE if the_pthread is NULL and FALSE otherwise.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null(
|
||||
Thread_Control *the_pthread
|
||||
);
|
||||
|
||||
#include <rtems/posix/pthread.inl>
|
||||
#include <rtems/posix/pthreadmp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
/* pthreadmp.h
|
||||
*
|
||||
* This include file contains all the constants and structures associated
|
||||
* with the Multiprocessing Support in the POSIX Threads Manager.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_THREADS_MP_h
|
||||
#define __RTEMS_POSIX_THREADS_MP_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/score/mppkt.h>
|
||||
#include <rtems/score/object.h>
|
||||
#include <rtems/score/thread.h>
|
||||
#include <rtems/score/watchdog.h>
|
||||
|
||||
/*
|
||||
* The following enumerated type defines the list of
|
||||
* remote pthread operations.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
POSIX_THREADS_MP_ANNOUNCE_CREATE = 0,
|
||||
POSIX_THREADS_MP_ANNOUNCE_DELETE = 1,
|
||||
POSIX_THREADS_MP_EXTRACT_PROXY = 2,
|
||||
POSIX_THREADS_MP_OBTAIN_REQUEST = 3,
|
||||
POSIX_THREADS_MP_OBTAIN_RESPONSE = 4,
|
||||
POSIX_THREADS_MP_RELEASE_REQUEST = 5,
|
||||
POSIX_THREADS_MP_RELEASE_RESPONSE = 6
|
||||
} POSIX_Threads_MP_Remote_operations;
|
||||
|
||||
/*
|
||||
* The following data structure defines the packet used to perform
|
||||
* remote pthread operations.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
MP_packet_Prefix Prefix;
|
||||
POSIX_Threads_MP_Remote_operations operation;
|
||||
Objects_Name name;
|
||||
boolean wait;
|
||||
Objects_Id proxy_id;
|
||||
} POSIX_Threads_MP_Packet;
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_MP_Send_process_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* process operation can be performed on another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Threads_MP_Send_process_packet (
|
||||
POSIX_Threads_MP_Remote_operations operation,
|
||||
Objects_Id pthread_id,
|
||||
Objects_Name name,
|
||||
Objects_Id proxy_id
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_MP_Send_request_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* directive operation can be initiated on another node.
|
||||
*/
|
||||
|
||||
int _POSIX_Threads_MP_Send_request_packet (
|
||||
POSIX_Threads_MP_Remote_operations operation,
|
||||
Objects_Id pthread_id,
|
||||
boolean wait,
|
||||
Watchdog_Interval timeout
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_MP_Send_response_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* directive can be performed on another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Threads_MP_Send_response_packet (
|
||||
POSIX_Threads_MP_Remote_operations operation,
|
||||
Objects_Id pthread_id,
|
||||
Thread_Control *the_thread
|
||||
);
|
||||
|
||||
/*
|
||||
*
|
||||
* _POSIX_Threads_MP_Process_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs the actions specific to this package for
|
||||
* the request from another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Threads_MP_Process_packet (
|
||||
MP_packet_Prefix *the_packet_prefix
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_MP_Send_object_was_deleted
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine is invoked indirectly by the thread queue
|
||||
* when a proxy has been removed from the thread queue and
|
||||
* the remote node must be informed of this.
|
||||
*/
|
||||
|
||||
void _POSIX_Threads_MP_Send_object_was_deleted (
|
||||
Thread_Control *the_proxy
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_MP_Send_extract_proxy
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine is invoked when a task is deleted and it
|
||||
* has a proxy which must be removed from a thread queue and
|
||||
* the remote node must be informed of this.
|
||||
*/
|
||||
|
||||
void _POSIX_Threads_MP_Send_extract_proxy (
|
||||
Thread_Control *the_thread
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_MP_Get_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function is used to obtain a pthread mp packet.
|
||||
*/
|
||||
|
||||
POSIX_Threads_MP_Packet *_POSIX_Threads_MP_Get_packet ( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of file */
|
||||
@@ -1,135 +0,0 @@
|
||||
/* rtems/posix/semaphore.h
|
||||
*
|
||||
* This include file contains all the private support information for
|
||||
* POSIX Semaphores.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_SEMAPHORE_h
|
||||
#define __RTEMS_POSIX_SEMAPHORE_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/score/coresem.h>
|
||||
|
||||
/*
|
||||
* Data Structure used to manage a POSIX semaphore
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
Objects_Control Object;
|
||||
int process_shared;
|
||||
boolean named;
|
||||
boolean linked;
|
||||
unsigned32 open_count;
|
||||
CORE_semaphore_Control Semaphore;
|
||||
} POSIX_Semaphore_Control;
|
||||
|
||||
/*
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Semaphore_Information;
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_Manager_initialization
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
void _POSIX_Semaphore_Manager_initialization(
|
||||
unsigned32 maximum_semaphorees
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_Allocate
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function allocates a semaphore control block from
|
||||
* the inactive chain of free semaphore control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void );
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_Free
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine frees a semaphore control block to the
|
||||
* inactive chain of free semaphore control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
|
||||
POSIX_Semaphore_Control *the_semaphore
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_Get
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function maps semaphore IDs to semaphore control blocks.
|
||||
* If ID corresponds to a local semaphore, then it returns
|
||||
* the_semaphore control pointer which maps to ID and location
|
||||
* is set to OBJECTS_LOCAL. if the semaphore ID is global and
|
||||
* resides on a remote node, then location is set to OBJECTS_REMOTE,
|
||||
* and the_semaphore is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_semaphore is undefined.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
|
||||
Objects_Id *id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_Is_null
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
|
||||
POSIX_Semaphore_Control *the_semaphore
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_Name_to_id
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
int _POSIX_Semaphore_Name_to_id(
|
||||
const char *name,
|
||||
Objects_Id *id
|
||||
);
|
||||
|
||||
#include <rtems/posix/semaphore.inl>
|
||||
#include <rtems/posix/semaphoremp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
/* semaphoremp.h
|
||||
*
|
||||
* This include file contains all the constants and structures associated
|
||||
* with the Multiprocessing Support in the POSIX Semaphore Manager.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_SEMAPHORE_MP_h
|
||||
#define __RTEMS_POSIX_SEMAPHORE_MP_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/score/mppkt.h>
|
||||
#include <rtems/score/object.h>
|
||||
#include <rtems/score/thread.h>
|
||||
#include <rtems/score/watchdog.h>
|
||||
|
||||
/*
|
||||
* The following enumerated type defines the list of
|
||||
* remote semaphore operations.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
POSIX_SEMAPHORE_MP_ANNOUNCE_CREATE = 0,
|
||||
POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE = 1,
|
||||
POSIX_SEMAPHORE_MP_EXTRACT_PROXY = 2,
|
||||
POSIX_SEMAPHORE_MP_OBTAIN_REQUEST = 3,
|
||||
POSIX_SEMAPHORE_MP_OBTAIN_RESPONSE = 4,
|
||||
POSIX_SEMAPHORE_MP_RELEASE_REQUEST = 5,
|
||||
POSIX_SEMAPHORE_MP_RELEASE_RESPONSE = 6,
|
||||
} POSIX_Semaphore_MP_Remote_operations;
|
||||
|
||||
/*
|
||||
* The following data structure defines the packet used to perform
|
||||
* remote semaphore operations.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
MP_packet_Prefix Prefix;
|
||||
POSIX_Semaphore_MP_Remote_operations operation;
|
||||
Objects_Name name;
|
||||
boolean wait; /* XXX options */
|
||||
Objects_Id proxy_id;
|
||||
} POSIX_Semaphore_MP_Packet;
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_MP_Send_process_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* process operation can be performed on another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Semaphore_MP_Send_process_packet (
|
||||
POSIX_Semaphore_MP_Remote_operations operation,
|
||||
Objects_Id semaphore_id,
|
||||
Objects_Name name,
|
||||
Objects_Id proxy_id
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_MP_Send_request_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* directive operation can be initiated on another node.
|
||||
*/
|
||||
|
||||
int _POSIX_Semaphore_MP_Send_request_packet (
|
||||
POSIX_Semaphore_MP_Remote_operations operation,
|
||||
Objects_Id semaphore_id,
|
||||
boolean wait, /* XXX options */
|
||||
Watchdog_Interval timeout
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_MP_Send_response_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs a remote procedure call so that a
|
||||
* directive can be performed on another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Semaphore_MP_Send_response_packet (
|
||||
POSIX_Semaphore_MP_Remote_operations operation,
|
||||
Objects_Id semaphore_id,
|
||||
Thread_Control *the_thread
|
||||
);
|
||||
|
||||
/*
|
||||
*
|
||||
* _POSIX_Semaphore_MP_Process_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine performs the actions specific to this package for
|
||||
* the request from another node.
|
||||
*/
|
||||
|
||||
void _POSIX_Semaphore_MP_Process_packet (
|
||||
MP_packet_Prefix *the_packet_prefix
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_MP_Send_object_was_deleted
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine is invoked indirectly by the thread queue
|
||||
* when a proxy has been removed from the thread queue and
|
||||
* the remote node must be informed of this.
|
||||
*/
|
||||
|
||||
void _POSIX_Semaphore_MP_Send_object_was_deleted (
|
||||
Thread_Control *the_proxy
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_MP_Send_extract_proxy
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine is invoked when a task is deleted and it
|
||||
* has a proxy which must be removed from a thread queue and
|
||||
* the remote node must be informed of this.
|
||||
*/
|
||||
|
||||
void _POSIX_Semaphore_MP_Send_extract_proxy (
|
||||
Thread_Control *the_thread
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_MP_Get_packet
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function is used to obtain a semaphore mp packet.
|
||||
*/
|
||||
|
||||
POSIX_Semaphore_MP_Packet *_POSIX_Semaphore_MP_Get_packet ( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of file */
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __POSIX_SET_ERRNO_h
|
||||
#define __POSIX_SET_ERRNO_h
|
||||
|
||||
#define set_errno_and_return_minus_one( _error ) \
|
||||
{ errno = (_error); return -1; }
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,46 +0,0 @@
|
||||
/* threadsup.h
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_THREAD_SUPPORT_h
|
||||
#define __RTEMS_POSIX_THREAD_SUPPORT_h
|
||||
|
||||
#include <rtems/score/coresem.h>
|
||||
#include <rtems/score/tqdata.h>
|
||||
|
||||
typedef struct {
|
||||
pthread_attr_t Attributes;
|
||||
int detachstate;
|
||||
Thread_queue_Control Join_List;
|
||||
int schedpolicy;
|
||||
struct sched_param schedparam;
|
||||
int ss_high_priority;
|
||||
Watchdog_Control Sporadic_timer;
|
||||
|
||||
sigset_t signals_blocked;
|
||||
sigset_t signals_pending;
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* POSIX Interrupts
|
||||
*/
|
||||
unsigned32 interrupts_installed;
|
||||
CORE_semaphore_Control Interrupt_Semaphore;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* POSIX Cancelability
|
||||
*/
|
||||
int cancelability_state;
|
||||
int cancelability_type;
|
||||
int cancelation_requested;
|
||||
Chain_Control Cancellation_Handlers;
|
||||
#endif
|
||||
|
||||
} POSIX_API_Control;
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_TIME_h
|
||||
#define __RTEMS_POSIX_TIME_h
|
||||
|
||||
#include <rtems/score/tod.h>
|
||||
|
||||
/*
|
||||
* Seconds from January 1, 1970 to January 1, 1988. Used to account for
|
||||
* differences between POSIX API and RTEMS core.
|
||||
*/
|
||||
|
||||
#define POSIX_TIME_SECONDS_1970_THROUGH_1988 \
|
||||
(((1987 - 1970 + 1) * TOD_SECONDS_PER_NON_LEAP_YEAR) + \
|
||||
(4 * TOD_SECONDS_PER_DAY))
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Timespec_subtract
|
||||
*/
|
||||
|
||||
void _POSIX_Timespec_subtract(
|
||||
const struct timespec *the_start,
|
||||
const struct timespec *end,
|
||||
struct timespec *result
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Timespec_to_interval
|
||||
*/
|
||||
|
||||
Watchdog_Interval _POSIX_Timespec_to_interval(
|
||||
const struct timespec *time
|
||||
);
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Interval_to_timespec
|
||||
*/
|
||||
|
||||
void _POSIX_Interval_to_timespec(
|
||||
Watchdog_Interval ticks,
|
||||
struct timespec *time
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,31 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
#I_PIECES= cond intr key mqueue mutex pthread priority semaphore
|
||||
I_PIECES=cond key mutex pthread priority
|
||||
I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
|
||||
|
||||
SRCS=$(I_FILES)
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/leaf.cfg
|
||||
|
||||
#
|
||||
# Add your list of files to delete here. The config files
|
||||
# already know how to delete some stuff, so you may want
|
||||
# to just run 'make clean' first to see what gets missed.
|
||||
# 'make clobber' already includes 'make clean'
|
||||
#
|
||||
|
||||
CLEAN_ADDITIONS +=
|
||||
CLOBBER_ADDITIONS +=
|
||||
|
||||
all: $(SRCS)
|
||||
$(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/posix
|
||||
@@ -1,77 +0,0 @@
|
||||
/* rtems/posix/cond.inl
|
||||
*
|
||||
* This include file contains the static inline implementation of the private
|
||||
* inlined routines for POSIX condition variables.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_inl
|
||||
#define __RTEMS_POSIX_CONDITION_VARIABLES_inl
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Condition_variables_Allocate
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
|
||||
*_POSIX_Condition_variables_Allocate( void )
|
||||
{
|
||||
return (POSIX_Condition_variables_Control *)
|
||||
_Objects_Allocate( &_POSIX_Condition_variables_Information );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Condition_variables_Free
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
|
||||
POSIX_Condition_variables_Control *the_condition_variable
|
||||
)
|
||||
{
|
||||
_Objects_Free(
|
||||
&_POSIX_Condition_variables_Information,
|
||||
&the_condition_variable->Object
|
||||
);
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Condition_variables_Get
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
|
||||
Objects_Id *id,
|
||||
Objects_Locations *location
|
||||
)
|
||||
{
|
||||
/* XXX really should validate pointer */
|
||||
/* XXX should support COND_INITIALIZER */
|
||||
return (POSIX_Condition_variables_Control *)
|
||||
_Objects_Get( &_POSIX_Condition_variables_Information, *id, location );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Condition_variables_Is_null
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
|
||||
POSIX_Condition_variables_Control *the_condition_variable
|
||||
)
|
||||
{
|
||||
return !the_condition_variable;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
/* rtems/posix/intr.inl
|
||||
*
|
||||
* This include file contains the static inline implementation of the private
|
||||
* inlined routines for POSIX Interrupt Manager
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_INTERRUPT_inl
|
||||
#define __RTEMS_POSIX_INTERRUPT_inl
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Interrupt_Allocate
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
|
||||
_POSIX_Interrupt_Allocate( void )
|
||||
{
|
||||
return (POSIX_Interrupt_Handler_control *)
|
||||
_Objects_Allocate( &_POSIX_Interrupt_Handlers_Information );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Interrupt_Free
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
|
||||
POSIX_Interrupt_Handler_control *the_intr
|
||||
)
|
||||
{
|
||||
_Objects_Free( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Interrupt_Get
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
|
||||
Objects_Id id,
|
||||
Objects_Locations *location
|
||||
)
|
||||
{
|
||||
return (POSIX_Interrupt_Control *)
|
||||
_Objects_Get( &_POSIX_Interrupt_Handlers_Information, id, location );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Interrupt_Is_null
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
|
||||
POSIX_Interrupt_Handler_control *the_intr
|
||||
)
|
||||
{
|
||||
return !the_intr;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
/* rtems/posix/key.inl
|
||||
*
|
||||
* This include file contains the static inline implementation of the private
|
||||
* inlined routines for POSIX key's.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_KEY_inl
|
||||
#define __RTEMS_POSIX_KEY_inl
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Keys_Allocate
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
|
||||
{
|
||||
return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Keys_Free
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
|
||||
POSIX_Keys_Control *the_key
|
||||
)
|
||||
{
|
||||
_Objects_Free( &_POSIX_Keys_Information, &the_key->Object );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Keys_Get
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
|
||||
Objects_Id id,
|
||||
Objects_Locations *location
|
||||
)
|
||||
{
|
||||
return (POSIX_Keys_Control *)
|
||||
_Objects_Get( &_POSIX_Keys_Information, id, location );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Keys_Is_null
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
|
||||
POSIX_Keys_Control *the_key
|
||||
)
|
||||
{
|
||||
return !the_key;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
/* rtems/posix/mqueue.inl
|
||||
*
|
||||
* This include file contains the static inline implementation of the private
|
||||
* inlined routines for POSIX Message Queue.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_inl
|
||||
#define __RTEMS_POSIX_MESSAGE_QUEUE_inl
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Message_queue_Allocate
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
|
||||
{
|
||||
return (POSIX_Message_queue_Control *)
|
||||
_Objects_Allocate( &_POSIX_Message_queue_Information );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Message_queue_Free
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
|
||||
POSIX_Message_queue_Control *the_mq
|
||||
)
|
||||
{
|
||||
_Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Message_queue_Get
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
|
||||
Objects_Id id,
|
||||
Objects_Locations *location
|
||||
)
|
||||
{
|
||||
return (POSIX_Message_queue_Control *)
|
||||
_Objects_Get( &_POSIX_Message_queue_Information, id, location );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Message_queue_Is_null
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
|
||||
POSIX_Message_queue_Control *the_mq
|
||||
)
|
||||
{
|
||||
return !the_mq;
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Message_queue_Priority_to_core
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
|
||||
unsigned int priority
|
||||
)
|
||||
{
|
||||
return priority;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
/* rtems/posix/mutex.inl
|
||||
*
|
||||
* This include file contains the static inline implementation of the private
|
||||
* inlined routines for POSIX mutex's.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_MUTEX_inl
|
||||
#define __RTEMS_POSIX_MUTEX_inl
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Mutex_Allocate
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
|
||||
{
|
||||
return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Mutex_Free
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
|
||||
POSIX_Mutex_Control *the_mutex
|
||||
)
|
||||
{
|
||||
_Objects_Free( &_POSIX_Mutex_Information, &the_mutex->Object );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Mutex_Get
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
|
||||
Objects_Id *id,
|
||||
Objects_Locations *location
|
||||
)
|
||||
{
|
||||
int status;
|
||||
|
||||
if ( !id ) {
|
||||
*location = OBJECTS_ERROR;
|
||||
return (POSIX_Mutex_Control *) 0;
|
||||
}
|
||||
|
||||
if ( *id == PTHREAD_MUTEX_INITIALIZER ) {
|
||||
/*
|
||||
* Do an "auto-create" here.
|
||||
*/
|
||||
|
||||
status = pthread_mutex_init( id, 0 );
|
||||
if ( status ) {
|
||||
*location = OBJECTS_ERROR;
|
||||
return (POSIX_Mutex_Control *) 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Now call Objects_Get()
|
||||
*/
|
||||
|
||||
return (POSIX_Mutex_Control *)
|
||||
_Objects_Get( &_POSIX_Mutex_Information, *id, location );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Mutex_Is_null
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
|
||||
POSIX_Mutex_Control *the_mutex
|
||||
)
|
||||
{
|
||||
return !the_mutex;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_PRIORITY_inl
|
||||
#define __RTEMS_POSIX_PRIORITY_inl
|
||||
|
||||
/*
|
||||
* 1003.1b-1993,2.2.2.80 definition of priority, p. 19
|
||||
*
|
||||
* "Numericallly higher values represent higher priorities."
|
||||
*
|
||||
* Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
|
||||
int priority
|
||||
)
|
||||
{
|
||||
return (boolean) (priority >= 1 && priority <= 254);
|
||||
}
|
||||
|
||||
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
|
||||
int priority
|
||||
)
|
||||
{
|
||||
return (Priority_Control) (255 - priority);
|
||||
}
|
||||
|
||||
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
|
||||
Priority_Control priority
|
||||
)
|
||||
{
|
||||
return 255 - priority;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,70 +0,0 @@
|
||||
/* rtems/posix/pthread.inl
|
||||
*
|
||||
* This include file contains the static inline implementation of the private
|
||||
* inlined routines for POSIX threads.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_THREADS_inl
|
||||
#define __RTEMS_POSIX_THREADS_inl
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Threads_Allocate
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
|
||||
{
|
||||
return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Threads_Free
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
|
||||
Thread_Control *the_pthread
|
||||
)
|
||||
{
|
||||
_Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Threads_Get
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get (
|
||||
pthread_t id,
|
||||
Objects_Locations *location
|
||||
)
|
||||
{
|
||||
return (Thread_Control *)
|
||||
_Objects_Get( &_POSIX_Threads_Information, (Objects_Id)id, location );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Threads_Is_null
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null (
|
||||
Thread_Control *the_pthread
|
||||
)
|
||||
{
|
||||
return !the_pthread;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/* rtems/posix/semaphore.inl
|
||||
*
|
||||
* This include file contains the static inline implementation of the private
|
||||
* inlined routines for POSIX Semaphores.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __RTEMS_POSIX_SEMAPHORE_inl
|
||||
#define __RTEMS_POSIX_SEMAPHORE_inl
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Semaphore_Allocate
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
|
||||
{
|
||||
return (POSIX_Semaphore_Control *)
|
||||
_Objects_Allocate( &_POSIX_Semaphore_Information );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Semaphore_Free
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
|
||||
POSIX_Semaphore_Control *the_semaphore
|
||||
)
|
||||
{
|
||||
_Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Semaphore_Get
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
|
||||
Objects_Id *id,
|
||||
Objects_Locations *location
|
||||
)
|
||||
{
|
||||
return (POSIX_Semaphore_Control *)
|
||||
_Objects_Get( &_POSIX_Semaphore_Information, *id, location );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Semaphore_Is_null
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
|
||||
POSIX_Semaphore_Control *the_semaphore
|
||||
)
|
||||
{
|
||||
return !the_semaphore;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
# Right now there are not macro implementation of the posix inline routines
|
||||
# So it won't build
|
||||
I_PIECES=
|
||||
I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
|
||||
|
||||
SRCS=$(I_FILES)
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/leaf.cfg
|
||||
|
||||
#
|
||||
# Add your list of files to delete here. The config files
|
||||
# already know how to delete some stuff, so you may want
|
||||
# to just run 'make clean' first to see what gets missed.
|
||||
# 'make clobber' already includes 'make clean'
|
||||
#
|
||||
|
||||
CLEAN_ADDITIONS +=
|
||||
CLOBBER_ADDITIONS +=
|
||||
|
||||
all: $(SRCS)
|
||||
#$(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/posix
|
||||
@@ -1,47 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
C_FILES=
|
||||
|
||||
H_FILES=
|
||||
|
||||
SRCS=$(C_FILES) $(CC_FILES) $(H_FILES)
|
||||
OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
|
||||
|
||||
PGMS=$(C_FILES:%.c=$(ARCH)/%.rel)
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/leaf.cfg
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
#
|
||||
|
||||
DEFINES +=
|
||||
CPPFLAGS +=
|
||||
CFLAGS += $(CFLAGS_OS_V)
|
||||
|
||||
ASM4FLAGS += -I $(PROJECT_INCLUDE)/rtems
|
||||
LD_PATHS +=
|
||||
LD_LIBS +=
|
||||
LDFLAGS +=
|
||||
|
||||
#
|
||||
# Add your list of files to delete here. The config files
|
||||
# already know how to delete some stuff, so you may want
|
||||
# to just run 'make clean' first to see what gets missed.
|
||||
# 'make clobber' already includes 'make clean'
|
||||
#
|
||||
|
||||
CLEAN_ADDITIONS +=
|
||||
CLOBBER_ADDITIONS +=
|
||||
|
||||
all: ${ARCH} $(SRCS) $(OBJS) $(PGMS)
|
||||
#$(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
|
||||
@@ -1,56 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
# following are semi-implemented and untested
|
||||
# C_PIECES=aio cancel devctl intr mqueue ptimer semaphore time utsname
|
||||
|
||||
ENOSYS_C_PIECES=\
|
||||
execl execle execlp execv execve execvp fork \
|
||||
pthreadatfork wait waitpid
|
||||
|
||||
C_PIECES= adasupp cond getpid key mutex pthread psignal sched time \
|
||||
types unistd $(ENOSYS_C_PIECES)
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
SRCS=$(C_FILES) $(CC_FILES)
|
||||
OBJS=$(C_O_FILES) $(CC_O_FILES)
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/lib.cfg
|
||||
|
||||
#
|
||||
# Add local stuff here using +=
|
||||
#
|
||||
|
||||
DEFINES += -D__RTEMS_INSIDE__
|
||||
CPPFLAGS +=
|
||||
CFLAGS += $(CFLAGS_OS_V)
|
||||
|
||||
#
|
||||
# Add your list of files to delete here. The config files
|
||||
# already know how to delete some stuff, so you may want
|
||||
# to just run 'make clean' first to see what gets missed.
|
||||
# 'make clobber' already includes 'make clean'
|
||||
#
|
||||
|
||||
CLEAN_ADDITIONS +=
|
||||
CLOBBER_ADDITIONS +=
|
||||
|
||||
all: ${ARCH} $(SRCS) ${OBJS}
|
||||
|
||||
# temporary so we can see how many things are left to implement
|
||||
not:
|
||||
grep -i NOT_IMPL $(C_FILES) | grep -v MP_NOT_IMPL
|
||||
@echo
|
||||
@echo
|
||||
@echo
|
||||
@echo `grep -i NOT_IMPL $(C_FILES) | grep -v MP_NOT_IMPL | wc -l ` places marked not implemented
|
||||
@echo `wc -l $(C_FILES) | grep total` lines of C code to test
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/posix/pthread.h>
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _ada_pthread_minimum_stack_size
|
||||
*
|
||||
* This routine returns the minimum stack size so the GNAT RTS can
|
||||
* allocate enough stack for Ada tasks.
|
||||
*/
|
||||
|
||||
size_t _ada_pthread_minimum_stack_size( void )
|
||||
{
|
||||
/*
|
||||
* Eventually this may need to include a per cpu family calculation
|
||||
* but for now, this will do.
|
||||
*/
|
||||
|
||||
return PTHREAD_MINIMUM_STACK_SIZE * 2;
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <aio.h>
|
||||
|
||||
#include <rtems/system.h>
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154
|
||||
*/
|
||||
|
||||
int aio_read(
|
||||
struct aiocb *aiocbp
|
||||
)
|
||||
{
|
||||
return POSIX_NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155
|
||||
*/
|
||||
|
||||
int aio_write(
|
||||
struct aiocb *aiocbp
|
||||
)
|
||||
{
|
||||
return POSIX_NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 6.7.4 List Directed I/O, P1003.1b-1993, p. 158
|
||||
*/
|
||||
|
||||
int lio_listio(
|
||||
int mode,
|
||||
struct aiocb * const list[],
|
||||
int nent,
|
||||
struct sigevent *sig
|
||||
)
|
||||
{
|
||||
return POSIX_NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161
|
||||
*/
|
||||
|
||||
int aio_error(
|
||||
const struct aiocb *aiocbp
|
||||
)
|
||||
{
|
||||
return POSIX_NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
|
||||
* P1003.1b-1993, p. 162
|
||||
*/
|
||||
|
||||
int aio_return(
|
||||
const struct aiocb *aiocbp
|
||||
)
|
||||
{
|
||||
return POSIX_NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163
|
||||
*/
|
||||
|
||||
int aio_cancel(
|
||||
int filedes,
|
||||
struct aiocb *aiocbp
|
||||
)
|
||||
{
|
||||
return POSIX_NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164
|
||||
*/
|
||||
|
||||
int aio_suspend(
|
||||
struct aiocb * const list[],
|
||||
int nent,
|
||||
const struct timespec *timeout
|
||||
)
|
||||
{
|
||||
return POSIX_NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166
|
||||
*/
|
||||
|
||||
int aio_fsync(
|
||||
int op,
|
||||
struct aiocb *aiocbp
|
||||
)
|
||||
{
|
||||
return POSIX_NOT_IMPLEMENTED();
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/score/chain.h>
|
||||
#include <rtems/score/isr.h>
|
||||
#include <rtems/score/thread.h>
|
||||
#include <rtems/score/wkspace.h>
|
||||
#include <rtems/posix/cancel.h>
|
||||
#include <rtems/posix/pthread.h>
|
||||
#include <rtems/posix/threadsup.h>
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* POSIX_Thread_cancel_run
|
||||
*
|
||||
*/
|
||||
|
||||
void POSIX_Thread_cancel_run(
|
||||
Thread_Control *the_thread
|
||||
)
|
||||
{
|
||||
int old_cancel_state;
|
||||
POSIX_Cancel_Handler_control *handler;
|
||||
Chain_Control *handler_stack;
|
||||
POSIX_API_Thread_Support_Control *thread_support;
|
||||
ISR_Level level;
|
||||
|
||||
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
|
||||
|
||||
handler_stack = &thread_support->Cancellation_Handlers;
|
||||
|
||||
old_cancel_state = thread_support->cancelability_state;
|
||||
|
||||
thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE;
|
||||
|
||||
while ( !_Chain_Is_empty( handler_stack ) ) {
|
||||
_ISR_Disable( level );
|
||||
handler = (POSIX_Cancel_Handler_control *) _Chain_Tail( handler_stack );
|
||||
_Chain_Extract_unprotected( &handler->Node );
|
||||
_ISR_Enable( level );
|
||||
|
||||
(*handler->routine)( handler->arg );
|
||||
|
||||
_Workspace_Free( handler );
|
||||
}
|
||||
|
||||
thread_support->cancelation_requested = 0;
|
||||
|
||||
thread_support->cancelability_state = old_cancel_state;
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 18.2.1 Canceling Execution of a Thread, P1003.1c/Draft 10, p. 181
|
||||
*/
|
||||
|
||||
int pthread_cancel(
|
||||
pthread_t thread
|
||||
)
|
||||
{
|
||||
Thread_Control *the_thread;
|
||||
POSIX_API_Thread_Support_Control *thread_support;
|
||||
Objects_Locations location;
|
||||
|
||||
the_thread = _POSIX_Threads_Get( &thread, &location );
|
||||
switch ( location ) {
|
||||
case OBJECTS_ERROR:
|
||||
return EINVAL;
|
||||
case OBJECTS_REMOTE:
|
||||
return POSIX_MP_NOT_IMPLEMENTED();
|
||||
case OBJECTS_LOCAL:
|
||||
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
|
||||
|
||||
thread_support->cancelation_requested = 1;
|
||||
|
||||
_Thread_Enable_dispatch();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return POSIX_BOTTOM_REACHED();
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
|
||||
*/
|
||||
|
||||
int pthread_setcancelstate(
|
||||
int state,
|
||||
int *oldstate
|
||||
)
|
||||
{
|
||||
POSIX_API_Thread_Support_Control *thread_support;
|
||||
|
||||
if ( !oldstate )
|
||||
return EINVAL;
|
||||
|
||||
if ( state != PTHREAD_CANCEL_ENABLE && state != PTHREAD_CANCEL_DISABLE )
|
||||
return EINVAL;
|
||||
|
||||
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
|
||||
|
||||
*oldstate = thread_support->cancelability_state;
|
||||
thread_support->cancelability_state = state;
|
||||
|
||||
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
|
||||
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
|
||||
thread_support->cancelation_requested )
|
||||
POSIX_Thread_cancel_run( _Thread_Executing );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
|
||||
*/
|
||||
|
||||
int pthread_setcanceltype(
|
||||
int type,
|
||||
int *oldtype
|
||||
)
|
||||
{
|
||||
POSIX_API_Thread_Support_Control *thread_support;
|
||||
|
||||
if ( !oldtype )
|
||||
return EINVAL;
|
||||
|
||||
if ( type != PTHREAD_CANCEL_DEFERRED && type != PTHREAD_CANCEL_ASYNCHRONOUS )
|
||||
return EINVAL;
|
||||
|
||||
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
|
||||
|
||||
*oldtype = thread_support->cancelability_type;
|
||||
thread_support->cancelability_type = type;
|
||||
|
||||
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
|
||||
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
|
||||
thread_support->cancelation_requested )
|
||||
POSIX_Thread_cancel_run( _Thread_Executing );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
|
||||
*/
|
||||
|
||||
void pthread_testcancel( void )
|
||||
{
|
||||
POSIX_API_Thread_Support_Control *thread_support;
|
||||
|
||||
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
|
||||
|
||||
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
|
||||
thread_support->cancelation_requested )
|
||||
POSIX_Thread_cancel_run( _Thread_Executing );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184
|
||||
*/
|
||||
|
||||
void pthread_cleanup_push(
|
||||
void (*routine)( void * ),
|
||||
void *arg
|
||||
)
|
||||
{
|
||||
POSIX_Cancel_Handler_control *handler;
|
||||
Chain_Control *handler_stack;
|
||||
POSIX_API_Thread_Support_Control *thread_support;
|
||||
|
||||
if ( !routine )
|
||||
return; /* XXX what to do really? */
|
||||
|
||||
handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
|
||||
|
||||
if ( !handler )
|
||||
return; /* XXX what to do really? */
|
||||
|
||||
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
|
||||
|
||||
handler_stack = &thread_support->Cancellation_Handlers;
|
||||
|
||||
handler->routine = routine;
|
||||
handler->arg = arg;
|
||||
|
||||
_Chain_Append( handler_stack, &handler->Node );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184
|
||||
*/
|
||||
|
||||
void pthread_cleanup_pop(
|
||||
int execute
|
||||
)
|
||||
{
|
||||
POSIX_Cancel_Handler_control *handler;
|
||||
Chain_Control *handler_stack;
|
||||
POSIX_API_Thread_Support_Control *thread_support;
|
||||
ISR_Level level;
|
||||
|
||||
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
|
||||
|
||||
handler_stack = &thread_support->Cancellation_Handlers;
|
||||
|
||||
if ( _Chain_Is_empty( handler_stack ) )
|
||||
return;
|
||||
|
||||
_ISR_Disable( level );
|
||||
handler = (POSIX_Cancel_Handler_control *) _Chain_Tail( handler_stack );
|
||||
_Chain_Extract_unprotected( &handler->Node );
|
||||
_ISR_Enable( level );
|
||||
|
||||
if ( execute )
|
||||
(*handler->routine)( handler->arg );
|
||||
|
||||
_Workspace_Free( handler );
|
||||
}
|
||||
@@ -1,502 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/score/object.h>
|
||||
#include <rtems/score/states.h>
|
||||
#include <rtems/score/watchdog.h>
|
||||
#include <rtems/posix/cond.h>
|
||||
#include <rtems/posix/time.h>
|
||||
#include <rtems/posix/mutex.h>
|
||||
|
||||
/*
|
||||
* TEMPORARY
|
||||
*/
|
||||
|
||||
void _POSIX_Condition_variables_MP_Send_process_packet (
|
||||
POSIX_Condition_variables_MP_Remote_operations operation,
|
||||
Objects_Id condition_variables_id,
|
||||
Objects_Name name,
|
||||
Objects_Id proxy_id
|
||||
)
|
||||
{
|
||||
(void) POSIX_MP_NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
void _POSIX_Condition_variables_MP_Send_extract_proxy(
|
||||
Thread_Control *the_thread
|
||||
)
|
||||
{
|
||||
(void) POSIX_MP_NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
/*
|
||||
* END OF TEMPORARY
|
||||
*/
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* The default condition variable attributes structure.
|
||||
*/
|
||||
|
||||
const pthread_condattr_t _POSIX_Condition_variables_Default_attributes = {
|
||||
TRUE, /* is_initialized */
|
||||
PTHREAD_PROCESS_PRIVATE /* process_shared */
|
||||
};
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Condition_variables_Manager_initialization
|
||||
*
|
||||
* This routine initializes all condition variable manager related data
|
||||
* structures.
|
||||
*
|
||||
* Input parameters:
|
||||
* maximum_condition_variables - maximum configured condition_variables
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*/
|
||||
|
||||
void _POSIX_Condition_variables_Manager_initialization(
|
||||
unsigned32 maximum_condition_variables
|
||||
)
|
||||
{
|
||||
_Objects_Initialize_information(
|
||||
&_POSIX_Condition_variables_Information,
|
||||
OBJECTS_POSIX_CONDITION_VARIABLES,
|
||||
TRUE,
|
||||
maximum_condition_variables,
|
||||
sizeof( POSIX_Condition_variables_Control ),
|
||||
FALSE,
|
||||
0,
|
||||
FALSE
|
||||
);
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.1 Condition Variable Initialization Attributes,
|
||||
* P1003.1c/Draft 10, p. 96
|
||||
*/
|
||||
|
||||
int pthread_condattr_init(
|
||||
pthread_condattr_t *attr
|
||||
)
|
||||
{
|
||||
if ( !attr )
|
||||
return EINVAL;
|
||||
|
||||
*attr = _POSIX_Condition_variables_Default_attributes;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.1 Condition Variable Initialization Attributes,
|
||||
* P1003.1c/Draft 10, p. 96
|
||||
*/
|
||||
|
||||
int pthread_condattr_destroy(
|
||||
pthread_condattr_t *attr
|
||||
)
|
||||
{
|
||||
if ( !attr || attr->is_initialized == FALSE )
|
||||
return EINVAL;
|
||||
|
||||
attr->is_initialized = FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.1 Condition Variable Initialization Attributes,
|
||||
* P1003.1c/Draft 10, p. 96
|
||||
*/
|
||||
|
||||
int pthread_condattr_getpshared(
|
||||
const pthread_condattr_t *attr,
|
||||
int *pshared
|
||||
)
|
||||
{
|
||||
if ( !attr )
|
||||
return EINVAL;
|
||||
|
||||
*pshared = attr->process_shared;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.1 Condition Variable Initialization Attributes,
|
||||
* P1003.1c/Draft 10, p. 96
|
||||
*/
|
||||
|
||||
int pthread_condattr_setpshared(
|
||||
pthread_condattr_t *attr,
|
||||
int pshared
|
||||
)
|
||||
{
|
||||
if ( !attr )
|
||||
return EINVAL;
|
||||
|
||||
switch ( pshared ) {
|
||||
case PTHREAD_PROCESS_SHARED:
|
||||
case PTHREAD_PROCESS_PRIVATE:
|
||||
attr->process_shared = pshared;
|
||||
return 0;
|
||||
|
||||
default:
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.2 Initializing and Destroying a Condition Variable,
|
||||
* P1003.1c/Draft 10, p. 87
|
||||
*/
|
||||
|
||||
int pthread_cond_init(
|
||||
pthread_cond_t *cond,
|
||||
const pthread_condattr_t *attr
|
||||
)
|
||||
{
|
||||
POSIX_Condition_variables_Control *the_cond;
|
||||
const pthread_condattr_t *the_attr;
|
||||
|
||||
if ( attr ) the_attr = attr;
|
||||
else the_attr = &_POSIX_Condition_variables_Default_attributes;
|
||||
|
||||
/*
|
||||
* XXX: Be careful about attributes when global!!!
|
||||
*/
|
||||
|
||||
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
|
||||
return POSIX_MP_NOT_IMPLEMENTED();
|
||||
|
||||
if ( !the_attr->is_initialized )
|
||||
return EINVAL;
|
||||
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
the_cond = _POSIX_Condition_variables_Allocate();
|
||||
|
||||
if ( !the_cond ) {
|
||||
_Thread_Enable_dispatch();
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED &&
|
||||
!( _Objects_MP_Allocate_and_open( &_POSIX_Condition_variables_Information,
|
||||
0, the_cond->Object.id, FALSE ) ) ) {
|
||||
_POSIX_Condition_variables_Free( the_cond );
|
||||
_Thread_Enable_dispatch();
|
||||
return EAGAIN;
|
||||
}
|
||||
|
||||
the_cond->process_shared = the_attr->process_shared;
|
||||
|
||||
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
|
||||
|
||||
/* XXX some more initialization might need to go here */
|
||||
_Thread_queue_Initialize(
|
||||
&the_cond->Wait_queue,
|
||||
OBJECTS_POSIX_CONDITION_VARIABLES,
|
||||
THREAD_QUEUE_DISCIPLINE_FIFO,
|
||||
STATES_WAITING_FOR_CONDITION_VARIABLE,
|
||||
_POSIX_Condition_variables_MP_Send_extract_proxy,
|
||||
ETIMEDOUT
|
||||
);
|
||||
|
||||
_Objects_Open(
|
||||
&_POSIX_Condition_variables_Information,
|
||||
&the_cond->Object,
|
||||
0
|
||||
);
|
||||
|
||||
*cond = the_cond->Object.id;
|
||||
|
||||
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
|
||||
_POSIX_Condition_variables_MP_Send_process_packet(
|
||||
POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE,
|
||||
the_cond->Object.id,
|
||||
0, /* Name not used */
|
||||
0 /* Not used */
|
||||
);
|
||||
|
||||
_Thread_Enable_dispatch();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.2 Initializing and Destroying a Condition Variable,
|
||||
* P1003.1c/Draft 10, p. 87
|
||||
*/
|
||||
|
||||
int pthread_cond_destroy(
|
||||
pthread_cond_t *cond
|
||||
)
|
||||
{
|
||||
register POSIX_Condition_variables_Control *the_cond;
|
||||
Objects_Locations location;
|
||||
|
||||
the_cond = _POSIX_Condition_variables_Get( cond, &location );
|
||||
switch ( location ) {
|
||||
case OBJECTS_ERROR:
|
||||
return EINVAL;
|
||||
case OBJECTS_REMOTE:
|
||||
_Thread_Dispatch();
|
||||
return POSIX_MP_NOT_IMPLEMENTED();
|
||||
return EINVAL;
|
||||
case OBJECTS_LOCAL:
|
||||
|
||||
if ( _Thread_queue_First( &the_cond->Wait_queue ) ) {
|
||||
_Thread_Enable_dispatch();
|
||||
return EBUSY;
|
||||
}
|
||||
|
||||
_Objects_Close(
|
||||
&_POSIX_Condition_variables_Information,
|
||||
&the_cond->Object
|
||||
);
|
||||
|
||||
_POSIX_Condition_variables_Free( the_cond );
|
||||
|
||||
if ( the_cond->process_shared == PTHREAD_PROCESS_SHARED ) {
|
||||
|
||||
_Objects_MP_Close(
|
||||
&_POSIX_Condition_variables_Information,
|
||||
the_cond->Object.id
|
||||
);
|
||||
|
||||
_POSIX_Condition_variables_MP_Send_process_packet(
|
||||
POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE,
|
||||
the_cond->Object.id,
|
||||
0, /* Not used */
|
||||
0 /* Not used */
|
||||
);
|
||||
}
|
||||
_Thread_Enable_dispatch();
|
||||
return 0;
|
||||
}
|
||||
return POSIX_BOTTOM_REACHED();
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Condition_variables_Signal_support
|
||||
*
|
||||
* A support routine which implements guts of the broadcast and single task
|
||||
* wake up version of the "signal" operation.
|
||||
*/
|
||||
|
||||
int _POSIX_Condition_variables_Signal_support(
|
||||
pthread_cond_t *cond,
|
||||
boolean is_broadcast
|
||||
)
|
||||
{
|
||||
register POSIX_Condition_variables_Control *the_cond;
|
||||
Objects_Locations location;
|
||||
Thread_Control *the_thread;
|
||||
|
||||
the_cond = _POSIX_Condition_variables_Get( cond, &location );
|
||||
switch ( location ) {
|
||||
case OBJECTS_ERROR:
|
||||
return EINVAL;
|
||||
case OBJECTS_REMOTE:
|
||||
_Thread_Dispatch();
|
||||
return POSIX_MP_NOT_IMPLEMENTED();
|
||||
return EINVAL;
|
||||
case OBJECTS_LOCAL:
|
||||
|
||||
do {
|
||||
the_thread = _Thread_queue_Dequeue( &the_cond->Wait_queue );
|
||||
if ( !the_thread )
|
||||
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
|
||||
} while ( is_broadcast && the_thread );
|
||||
|
||||
_Thread_Enable_dispatch();
|
||||
|
||||
return 0;
|
||||
}
|
||||
return POSIX_BOTTOM_REACHED();
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101
|
||||
*/
|
||||
|
||||
int pthread_cond_signal(
|
||||
pthread_cond_t *cond
|
||||
)
|
||||
{
|
||||
return _POSIX_Condition_variables_Signal_support( cond, FALSE );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101
|
||||
*/
|
||||
|
||||
int pthread_cond_broadcast(
|
||||
pthread_cond_t *cond
|
||||
)
|
||||
{
|
||||
return _POSIX_Condition_variables_Signal_support( cond, TRUE );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Condition_variables_Wait_support
|
||||
*
|
||||
* A support routine which implements guts of the blocking, non-blocking, and
|
||||
* timed wait version of condition variable wait routines.
|
||||
*/
|
||||
|
||||
int _POSIX_Condition_variables_Wait_support(
|
||||
pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex,
|
||||
Watchdog_Interval timeout,
|
||||
boolean already_timedout
|
||||
)
|
||||
{
|
||||
register POSIX_Condition_variables_Control *the_cond;
|
||||
Objects_Locations location;
|
||||
int status;
|
||||
int mutex_status;
|
||||
|
||||
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
_Thread_Unnest_dispatch();
|
||||
|
||||
the_cond = _POSIX_Condition_variables_Get( cond, &location );
|
||||
switch ( location ) {
|
||||
case OBJECTS_ERROR:
|
||||
return EINVAL;
|
||||
case OBJECTS_REMOTE:
|
||||
_Thread_Dispatch();
|
||||
return POSIX_MP_NOT_IMPLEMENTED();
|
||||
return EINVAL;
|
||||
case OBJECTS_LOCAL:
|
||||
|
||||
if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) {
|
||||
_Thread_Enable_dispatch();
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
(void) pthread_mutex_unlock( mutex );
|
||||
/* XXX ignore this for now since behavior is undefined
|
||||
if ( mutex_status ) {
|
||||
_Thread_Enable_dispatch();
|
||||
return EINVAL;
|
||||
}
|
||||
*/
|
||||
|
||||
if ( !already_timedout ) {
|
||||
the_cond->Mutex = *mutex;
|
||||
|
||||
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
|
||||
_Thread_Executing->Wait.return_code = 0;
|
||||
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
|
||||
_Thread_Executing->Wait.id = *cond;
|
||||
|
||||
_Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
|
||||
|
||||
_Thread_Enable_dispatch();
|
||||
|
||||
/*
|
||||
* Switch ourself out because we blocked as a result of the
|
||||
* _Thread_queue_Enqueue.
|
||||
*/
|
||||
|
||||
status = _Thread_Executing->Wait.return_code;
|
||||
if ( status && status != ETIMEDOUT )
|
||||
return status;
|
||||
|
||||
} else {
|
||||
_Thread_Enable_dispatch();
|
||||
status = ETIMEDOUT;
|
||||
}
|
||||
|
||||
/*
|
||||
* When we get here the dispatch disable level is 0.
|
||||
*/
|
||||
|
||||
mutex_status = pthread_mutex_lock( mutex );
|
||||
if ( mutex_status )
|
||||
return EINVAL;
|
||||
|
||||
return status;
|
||||
}
|
||||
return POSIX_BOTTOM_REACHED();
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105
|
||||
*/
|
||||
|
||||
int pthread_cond_wait(
|
||||
pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex
|
||||
)
|
||||
{
|
||||
return _POSIX_Condition_variables_Wait_support(
|
||||
cond,
|
||||
mutex,
|
||||
THREAD_QUEUE_WAIT_FOREVER,
|
||||
FALSE
|
||||
);
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105
|
||||
*/
|
||||
|
||||
int pthread_cond_timedwait(
|
||||
pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex,
|
||||
const struct timespec *abstime
|
||||
)
|
||||
{
|
||||
Watchdog_Interval timeout;
|
||||
struct timespec current_time;
|
||||
struct timespec difference;
|
||||
boolean already_timedout = FALSE;
|
||||
|
||||
if ( !abstime )
|
||||
return EINVAL;
|
||||
|
||||
/*
|
||||
* The abstime is a walltime. We turn it into an interval.
|
||||
*/
|
||||
|
||||
(void) clock_gettime( CLOCK_REALTIME, ¤t_time );
|
||||
|
||||
/* XXX probably some error checking should go here */
|
||||
|
||||
_POSIX_Timespec_subtract( ¤t_time, abstime, &difference );
|
||||
|
||||
if ( ( difference.tv_sec < 0 ) || ( ( difference.tv_sec == 0 ) &&
|
||||
( difference.tv_nsec < 0 ) ) )
|
||||
already_timedout = TRUE;
|
||||
|
||||
timeout = _POSIX_Timespec_to_interval( &difference );
|
||||
|
||||
return _POSIX_Condition_variables_Wait_support(
|
||||
cond,
|
||||
mutex,
|
||||
timeout,
|
||||
already_timedout
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <devctl.h>
|
||||
|
||||
#include <rtems/system.h>
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 21.2.1 Control a Device, P1003.4b/D8, p. 65
|
||||
*/
|
||||
|
||||
int devctl(
|
||||
int filedes,
|
||||
void *dev_data_ptr,
|
||||
size_t nbyte,
|
||||
int *dev_info_ptr
|
||||
)
|
||||
{
|
||||
return POSIX_NOT_IMPLEMENTED();
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* execl() - POSIX 1003.1b 3.1.2
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
int execl(
|
||||
const char *path,
|
||||
const char *arg,
|
||||
...
|
||||
)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* execle() - POSIX 1003.1b 3.1.2
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
int execle(
|
||||
const char *path,
|
||||
char const *arg,
|
||||
...
|
||||
)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* execlp() - POSIX 1003.1b 3.1.2
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
int execlp(
|
||||
const char *file,
|
||||
const char *arg,
|
||||
...
|
||||
)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user