forked from Imagelibrary/rtems
Compare commits
220 Commits
3.5.0-alph
...
3.5.12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7dd27391ef | ||
|
|
8cf884279f | ||
|
|
487a7ca5f7 | ||
|
|
99e7cbbb48 | ||
|
|
14966f8153 | ||
|
|
f398452a64 | ||
|
|
d08b1c758f | ||
|
|
f99538d871 | ||
|
|
bdf531ee7f | ||
|
|
110f4ff717 | ||
|
|
457b6ae167 | ||
|
|
e6424462c3 | ||
|
|
1a8fde6ca2 | ||
|
|
8e76546421 | ||
|
|
ba3911317a | ||
|
|
66d9e3ad29 | ||
|
|
10017a7223 | ||
|
|
4ff19203e0 | ||
|
|
0e0d88ba6a | ||
|
|
8cbbe312b6 | ||
|
|
adf98bd423 | ||
|
|
75f09e52de | ||
|
|
c4b8161d88 | ||
|
|
56d34e6ca9 | ||
|
|
b2b52cbc2a | ||
|
|
f972294dc7 | ||
|
|
744d287835 | ||
|
|
df26b78853 | ||
|
|
389fa85047 | ||
|
|
8bde6ea9ca | ||
|
|
da646dd837 | ||
|
|
94b3ec5970 | ||
|
|
6ca11842a5 | ||
|
|
391f662854 | ||
|
|
b38955b043 | ||
|
|
18269cef34 | ||
|
|
a31ddf784b | ||
|
|
8c8a924d5e | ||
|
|
107ce47b4b | ||
|
|
6dae1c2d0b | ||
|
|
8a38f3b1e5 | ||
|
|
f3dabb0439 | ||
|
|
d57392d0e1 | ||
|
|
4f60309bdd | ||
|
|
f00a0522a4 | ||
|
|
665356af66 | ||
|
|
b7a53bc7c9 | ||
|
|
4f7c546e28 | ||
|
|
c3dcd6e9b4 | ||
|
|
709b93db98 | ||
|
|
2931001675 | ||
|
|
eaa442fc46 | ||
|
|
05e4e4197e | ||
|
|
64f311f730 | ||
|
|
75d482d681 | ||
|
|
d1c00a18cb | ||
|
|
84147e4fe4 | ||
|
|
97dde60967 | ||
|
|
72c440eea7 | ||
|
|
217e398585 | ||
|
|
5d3e5399bb | ||
|
|
b9be5d0324 | ||
|
|
b817240cb8 | ||
|
|
6661eaa111 | ||
|
|
a625ccde69 | ||
|
|
c64e4ed482 | ||
|
|
5c491aef41 | ||
|
|
4442d21c43 | ||
|
|
8bdcfc474f | ||
|
|
7593d56c4f | ||
|
|
f3fe5b2488 | ||
|
|
0b0a3267fd | ||
|
|
3a86b73871 | ||
|
|
2b5944cfed | ||
|
|
67d224af9e | ||
|
|
7826883b16 | ||
|
|
8442656aed | ||
|
|
52cd72b161 | ||
|
|
62c4e481cf | ||
|
|
8e54b0b7d5 | ||
|
|
4aac8187e8 | ||
|
|
e88d2db77e | ||
|
|
e57b0e23d4 | ||
|
|
289ad864a5 | ||
|
|
76b6fd0cba | ||
|
|
ca201c9b6a | ||
|
|
11ab74ef98 | ||
|
|
8d0b7d9643 | ||
|
|
caaa47c29b | ||
|
|
ed329077c3 | ||
|
|
4250c8b13d | ||
|
|
a26603d598 | ||
|
|
3837215de3 | ||
|
|
a8cd94aa23 | ||
|
|
7f6fab613a | ||
|
|
eedbfd94e0 | ||
|
|
c4808ca59f | ||
|
|
97005786d8 | ||
|
|
ea744828ad | ||
|
|
591d45e7d5 | ||
|
|
eb5a7e07df | ||
|
|
c62d36feed | ||
|
|
1cefaced31 | ||
|
|
11290355c9 | ||
|
|
1039ae4125 | ||
|
|
07058e75b4 | ||
|
|
37f4c2d99f | ||
|
|
c701f1974b | ||
|
|
5e9b32b439 | ||
|
|
879a0474ea | ||
|
|
5e5731da12 | ||
|
|
1e0f4c8061 | ||
|
|
7fe12f6959 | ||
|
|
18c53787e1 | ||
|
|
7af35da5ff | ||
|
|
24b1cb9221 | ||
|
|
ea5df0ea54 | ||
|
|
cda7ecc2d8 | ||
|
|
79aaec8681 | ||
|
|
be650a843c | ||
|
|
c73aee15af | ||
|
|
486c329f2b | ||
|
|
c896e8d873 | ||
|
|
2122a0b7f4 | ||
|
|
d434b8d686 | ||
|
|
91a3554ded | ||
|
|
84ee59f575 | ||
|
|
38ffa0cee2 | ||
|
|
3652ad356b | ||
|
|
b3ac6a8dfe | ||
|
|
4b61ebfb48 | ||
|
|
08bae5e6c3 | ||
|
|
ced11f9984 | ||
|
|
3a4ae6c210 | ||
|
|
5072b07691 | ||
|
|
7f6a24abdd | ||
|
|
5250ff39f0 | ||
|
|
3235ad9a2c | ||
|
|
80e2c29e64 | ||
|
|
0cf5bd681a | ||
|
|
63edbb3fbc | ||
|
|
6b45e470be | ||
|
|
da6375babd | ||
|
|
bb322a0ea6 | ||
|
|
b2c491a080 | ||
|
|
6136168881 | ||
|
|
2a0b721738 | ||
|
|
94179e0f24 | ||
|
|
0f592fbafe | ||
|
|
9863dbfdd4 | ||
|
|
95fbca1940 | ||
|
|
b06e68ef1f | ||
|
|
3b438fa4b0 | ||
|
|
4b374f36e7 | ||
|
|
556fb911c8 | ||
|
|
a1df011813 | ||
|
|
199fa365bc | ||
|
|
45819022ce | ||
|
|
7285a01656 | ||
|
|
891e9c3c75 | ||
|
|
8d47a15eb9 | ||
|
|
4cc631db0f | ||
|
|
4e58d80b9e | ||
|
|
c1403ef153 | ||
|
|
aa9f19454a | ||
|
|
0e4c603b8e | ||
|
|
12f86efd88 | ||
|
|
0b8b9717a4 | ||
|
|
e34941195e | ||
|
|
4d9fa26805 | ||
|
|
e7e016fdc2 | ||
|
|
ce6e30b150 | ||
|
|
ea9d7db3b0 | ||
|
|
216ed5450b | ||
|
|
4a6fa2ab77 | ||
|
|
ad3bf6670f | ||
|
|
0d55427b31 | ||
|
|
795030965e | ||
|
|
4f90134497 | ||
|
|
c6fb8e9096 | ||
|
|
4a6e64d276 | ||
|
|
3a5dbdca1b | ||
|
|
0ea07c0089 | ||
|
|
f03f154b30 | ||
|
|
3d3a3590f8 | ||
|
|
c35e962218 | ||
|
|
2f2a597c73 | ||
|
|
1690c6b636 | ||
|
|
9e738b65b0 | ||
|
|
3b170f53b3 | ||
|
|
4ca27cfad7 | ||
|
|
3ea52882fb | ||
|
|
217d2e7dca | ||
|
|
10aed1e3c0 | ||
|
|
8044533152 | ||
|
|
f67ad3d54a | ||
|
|
6cc85032cb | ||
|
|
637df35f96 | ||
|
|
68931b5dc1 | ||
|
|
620d699c44 | ||
|
|
34d877ec46 | ||
|
|
9526d2176e | ||
|
|
9e86dd7db7 | ||
|
|
459f770f5e | ||
|
|
6b782ab7dc | ||
|
|
e8512eb679 | ||
|
|
7979e35617 | ||
|
|
7c22114bf5 | ||
|
|
fe6511014d | ||
|
|
7cf1556ed3 | ||
|
|
e864cfefa2 | ||
|
|
497428a296 | ||
|
|
4e0074bc7b | ||
|
|
84b7e72a90 | ||
|
|
69021ed415 | ||
|
|
18470ebae2 | ||
|
|
152e31af1f | ||
|
|
5b9d6ddf86 | ||
|
|
88d594a3d5 | ||
|
|
bf61e45c29 |
4
LICENSE
4
LICENSE
@@ -86,7 +86,7 @@ or changes.
|
|||||||
|
|
||||||
OAR remains the sole organization authorized by contract to
|
OAR remains the sole organization authorized by contract to
|
||||||
distribute or provide support and training for the Real-Time
|
distribute or provide support and training for the Real-Time
|
||||||
Executive for Military Systems (RTEMS).
|
Executive for Multiprocessor Systems (RTEMS).
|
||||||
|
|
||||||
In order to promote future research activities within the U.S.
|
In order to promote future research activities within the U.S.
|
||||||
Government, we request that potential users of RTEMS notify us
|
Government, we request that potential users of RTEMS notify us
|
||||||
@@ -94,7 +94,7 @@ as to the systems that RTEMS is being utilized. This will allow
|
|||||||
us to publicize our Dual-Use / Reuse capabilities in support of
|
us to publicize our Dual-Use / Reuse capabilities in support of
|
||||||
the current administration's goals. This can be accomplished by
|
the current administration's goals. This can be accomplished by
|
||||||
calling the RTEMS phone numbers published in the documentation
|
calling the RTEMS phone numbers published in the documentation
|
||||||
or by electronic mail to "rtems@redstone-emh2.army.mil". Your
|
or by electronic mail to "rtems@redstone.army.mil". Your
|
||||||
cooperation is greatly appreciated. Again, thank you for using
|
cooperation is greatly appreciated. Again, thank you for using
|
||||||
RTEMS.
|
RTEMS.
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,43 @@ The following persons/organizations have made contributions:
|
|||||||
examples in the back of the IDP user's manual, and the libgloss example
|
examples in the back of the IDP user's manual, and the libgloss example
|
||||||
support for the IDP board from the newlib/libgloss distribution.
|
support for the IDP board from the newlib/libgloss distribution.
|
||||||
|
|
||||||
|
+ David Glessner (dwg@glenqcy.glenayre.com) of Glenayre Electronics
|
||||||
|
submitted the support for the Motorola MC68302 CPU. This included
|
||||||
|
the "gen68302" BSP which uses the on-chip peripherals on the MC68302
|
||||||
|
as well as the modifications to the m68k dependent executive code to
|
||||||
|
support m68k family members based on the mc68000 core.
|
||||||
|
|
||||||
|
+ 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@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
|
||||||
|
evangelist and promoting the use of RTEMS both at I-CUBED Ltd. as well
|
||||||
|
as within the Internet community as a whole.
|
||||||
|
|
||||||
|
+ John S. Gwynne (jsg@coulomb.eng.ohio-state.edu) of Ohio State University
|
||||||
|
submitted the support for the Motorola MC68332 CPU as well as completing
|
||||||
|
the support for CPUs based on the MC68000 core. This included the "efi68k"
|
||||||
|
and "efi332" BSPs as well as completing the modifications to the m68k
|
||||||
|
dependent executive code to support m68k family members based on the
|
||||||
|
MC68000 core. "efi68k" and "efi332" are single board computers designed
|
||||||
|
primarily for automotive electronic fuel injection (EFI) control, but can
|
||||||
|
be considered general purpose controllers when used without the EFI
|
||||||
|
companion board(s). See the README in each BSP for more information.
|
||||||
|
|
||||||
|
+ The European Space Agency for sponsoring On-Line Applications Research
|
||||||
|
to port RTEMS to the SPARC V7 architecture for use with their ERC32
|
||||||
|
radiation-hardened CPU. Jiri Gaisler (jgais@wd.estec.esa.nl) deserves
|
||||||
|
special thanks for championing this port within the ESA was well as
|
||||||
|
for developing and supporting the SPARC Instruction Simulator used to
|
||||||
|
develop and test this port.
|
||||||
|
|
||||||
|
+ Eric Norum (eric@skatter.usask.ca) of the Saskatchewan Accelerator
|
||||||
|
Laboratory submitted the support for the Motorola MC68360 CPU
|
||||||
|
including the `gen68360' BSP.
|
||||||
|
|
||||||
Finally, the RTEMS project would like to thank those who have contributed
|
Finally, the RTEMS project would like to thank those who have contributed
|
||||||
to the other free software efforts which RTEMS utilizes. The primary RTEMS
|
to the other free software efforts which RTEMS utilizes. The primary RTEMS
|
||||||
development environment is from the Free Software Foundation (the GNU
|
development environment is from the Free Software Foundation (the GNU
|
||||||
|
|||||||
55
c/PROBLEMS
55
c/PROBLEMS
@@ -4,19 +4,34 @@
|
|||||||
|
|
||||||
This is the list of outstanding problems in this release.
|
This is the list of outstanding problems in this release.
|
||||||
|
|
||||||
1. The m68000 support is not complete. Someone with target hardware
|
+ The POSIX threads and real time extensions code in this tree does
|
||||||
needs to complete the missing gaps. Look for ifdef's based on the
|
not work yet and is intentionally not in the normal build path.
|
||||||
M68K_* macros defined in c/make/cpu/m68k.cfg. Most of the code
|
|
||||||
is present but none of it is tested. An attempt was made to insert
|
|
||||||
"#warnings" preprocessor directives in the appropriate places.
|
|
||||||
So these are a good starting spot.
|
|
||||||
|
|
||||||
2. The only i960 family member tested is the CA. No support for the
|
+ 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 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 i960 family member tested is the CA. No support for the
|
||||||
floating point support found in other family members is present.
|
floating point support found in other family members is present.
|
||||||
This also implies that RTEMS may "think" of something as generic
|
This also implies that RTEMS may "think" of something as generic
|
||||||
across the i960 family when in fact it is specific to the CA.
|
across the i960 family when in fact it is specific to the CA.
|
||||||
|
To make matters worse, the i960 target board owned by the RTEMS Project
|
||||||
|
is now broken and as a result even the i960CA is a "compile only" port.
|
||||||
|
|
||||||
3. The __read() system call in all of the BSPs using single
|
+ Some of the BSPs still define RAM_START and RAM_END in the bsp.h file.
|
||||||
|
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.
|
||||||
|
|
||||||
|
+ The __read() system call in all of the BSPs using single
|
||||||
character input/output needs to be smarter. The following
|
character input/output needs to be smarter. The following
|
||||||
issues need to be addressed:
|
issues need to be addressed:
|
||||||
|
|
||||||
@@ -25,15 +40,27 @@ This is the list of outstanding problems in this release.
|
|||||||
+ backspaces
|
+ backspaces
|
||||||
+ tabs
|
+ tabs
|
||||||
|
|
||||||
4. Solaris 2.3 port notes:
|
+ UNIX port notes:
|
||||||
|
|
||||||
+ Some of the tests run correctly when run interactively but
|
|
||||||
the screen and output do not match when the output is
|
|
||||||
redirected to a file.
|
|
||||||
|
|
||||||
+ sometimes a stray SIGALRM is reported as spfatal completes.
|
+ sometimes a stray SIGALRM is reported as spfatal completes.
|
||||||
|
|
||||||
5. Some of the tests may execute correctly and not produce the exact
|
+ There are conflicts between the names of native library routines
|
||||||
|
which MUST be used and those in the POSIX support. This must
|
||||||
|
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
|
ordering of lines in the screen file. This appears to be a combination
|
||||||
of a number of factors including buffering, processor speed, IO
|
of a number of factors including buffering, processor speed, IO
|
||||||
device overhead, and clock interrupt rate.
|
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.
|
||||||
|
|||||||
72
c/README.DOS
Normal file
72
c/README.DOS
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
|
tools
|
||||||
|
-----
|
||||||
|
The RTEMS build procedure was designed with the capabilitiies of a
|
||||||
|
typical UNIX computer in mind. Making this procedure work under MS-DOS
|
||||||
|
is not that difficult but requires that MS-DOS versions of a number
|
||||||
|
of UNIX utilities be acquired and installed. For time being, the
|
||||||
|
best advice which can be offered is:
|
||||||
|
|
||||||
|
"This is a nasty question, since when I first set up the DOS machine
|
||||||
|
(long before I acquired RTEMS) I ftp'd a bunch of different tool
|
||||||
|
sets (all from SimTel), and then picked individual tools from each
|
||||||
|
set that worked best for me. The djgpp tools are probably a good
|
||||||
|
starting point, especially to get a working sed. Next the gnu tools
|
||||||
|
in SimTel/msdos/gnuish, and then others. Sorry I can't give you more
|
||||||
|
specific names. The only real requirement for the tools is that
|
||||||
|
they *must* accept redirection of command line arguments from a file
|
||||||
|
using the '@' notation (i.e., "mkdir @/tmp/args" reads the argument
|
||||||
|
list from file /tmp/args)."
|
||||||
|
|
||||||
|
There is a special version (source and executable) of GNU make 3.71 for
|
||||||
|
MS-DOS which minimizes the amount of memory used by recursive makes
|
||||||
|
available on lancelot.gcs.redstone.army.mil in the file:
|
||||||
|
|
||||||
|
/pub/msdos/gmake371.tgz
|
||||||
|
|
||||||
|
Many of the RTEMS specific utilities used in the build and installation
|
||||||
|
are UNIX shell scripts. On a UNIX host, these are normally interpreted
|
||||||
|
by the Bourne Again Shell (BASH) or the Korn Shell (ksh). Most of these
|
||||||
|
scripts can be successfully executed with the following shell from the
|
||||||
|
MS-DOS archives from Simtel.
|
||||||
|
|
||||||
|
SimTel/msdos/sysutil/ms_sh23b.zip
|
||||||
|
|
||||||
|
Please be sure to use the 16-bit version. The Simtel archives are
|
||||||
|
available from ftp.cdrom.com as well as a number of mirror sites.
|
||||||
|
|
||||||
|
go32
|
||||||
|
----
|
||||||
|
go32 dumps the stack when a program seg-faults, and if this happens while
|
||||||
|
on an alternate stack an infinite loop can ensue. Setting the environment
|
||||||
|
variable GO32="core /tmp/core" will prevent more than 20 lines or
|
||||||
|
so of stack information from being dumped after a crash, and the output
|
||||||
|
will go to a file rather than the screen.
|
||||||
|
|
||||||
|
The go32 debuggers get confused by the relocated stacks used by tasks,
|
||||||
|
and tend to crash when variables are inspected.
|
||||||
|
|
||||||
|
djgcc include files
|
||||||
|
-------------------
|
||||||
|
In general, we use RTEMS include files because these contain the proper
|
||||||
|
declarations for the libc, and in particular, the stdio functions.
|
||||||
|
When calling go32-specific functions it is necessary to include some
|
||||||
|
djgpp include files, as well. Unfortunately, there are some disagreements
|
||||||
|
between RTEMS and djgpp as to how certain functions and types are
|
||||||
|
declared. In these cases, the RTEMS source have been modified to
|
||||||
|
special-case the differences.
|
||||||
|
|
||||||
|
other
|
||||||
|
-----
|
||||||
|
* Pressing F12 will immediately abort the program.
|
||||||
|
See lib/libbsp/i386/go32/console/inch.c.
|
||||||
|
|
||||||
|
* lib/libbsp/i386/go32/timer uses the on-board timer chip by default,
|
||||||
|
which has a resolution of about 1 microsecond. However, if executing
|
||||||
|
on a Pentium processor you can use the on-chip 64-bit cycle counter,
|
||||||
|
which counts at whatever clock rate your processor runs at. To enable
|
||||||
|
this, set RTEMS_CPU_MODEL=pentium in make/custom/go32.cfg.
|
||||||
|
|
||||||
56
c/TESTED
Normal file
56
c/TESTED
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
Host Development Systems
|
||||||
|
========================
|
||||||
|
|
||||||
|
All RTEMS development is done on a Sun SPARCStation running Solaris 2.3 and
|
||||||
|
all other host systems are not tested internally.
|
||||||
|
|
||||||
|
Target Systems
|
||||||
|
==============
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
(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.
|
||||||
|
|
||||||
|
(5) The RTEMS Project owns a Linux host but does not regularly test this BSP.
|
||||||
@@ -2,16 +2,51 @@
|
|||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
|
|
||||||
In the directory "update_tools", there are a set of tools to aid in
|
Between RTEMS 3.1.0 and 3.2.0, every RTEMS defined symbol made visible
|
||||||
making the application source changes necessary to address some
|
was renamed. This document describes the change and the tools provided
|
||||||
of the changes in the RTEMS API between release 3.1.0 and 3.2.0.
|
to assist you in updating your RTEMS 3.1.0 application.
|
||||||
|
|
||||||
The primary change addressed by these tools is the addition of
|
[NOTE: This change was not included in snapshots prior to 3.1.15.]
|
||||||
"rtems_" or "RTEMS_" as a prefix on EVERY user visible RTEMS
|
|
||||||
provided constant and routine. The primary factor in the decision
|
DESCRIPTION OF NAME CHANGES:
|
||||||
to make such a sweeping change was conflicts between the
|
============================
|
||||||
the RTEMS and POSIX API's.
|
|
||||||
|
The primary change was the addition of the prefix "rtems_" or "RTEMS_" to
|
||||||
|
EVERY user visible RTEMS provided constant and routine. The primary
|
||||||
|
factor in the decision to make such a sweeping change was conflicts
|
||||||
|
between the the RTEMS and POSIX API's.
|
||||||
|
|
||||||
|
|
||||||
|
TO UPDATE YOUR APPLICATION:
|
||||||
|
===========================
|
||||||
|
|
||||||
|
The update script requires that Perl be installed on your computer.
|
||||||
|
It has only been tested with Perl 5.x.
|
||||||
|
|
||||||
|
After RTEMS has been built, in the directory "$r/<BSP>/update_tools", will
|
||||||
|
be a set of tools to aid in making the application source changes necessary
|
||||||
|
to address (hopefully) all of the name changes in the RTEMS API between
|
||||||
|
releases 3.1.0 and 3.2.0.
|
||||||
|
|
||||||
|
The update shell script is the only executable which is invoked by the
|
||||||
|
user directly. The word-replace Perl script is invoked by the update
|
||||||
|
shell script.
|
||||||
|
|
||||||
WARNING: These tools modify the files IN PLACE!!! Backup your
|
WARNING: These tools modify the files IN PLACE!!! Backup your
|
||||||
source before using these tools.
|
source before using these tools.
|
||||||
|
|
||||||
|
To udpate your application, change directories to the top of your application
|
||||||
|
source tree and execute the update script. It should be something similar
|
||||||
|
to the following:
|
||||||
|
|
||||||
|
cd MY_APP
|
||||||
|
$r/<BSP>/update-tools/update
|
||||||
|
|
||||||
|
The update script will ask if you have backed up your source code before
|
||||||
|
beginning the update process. While operating on files, it will print
|
||||||
|
the name of each file and a dot for each change made to the source file.
|
||||||
|
|
||||||
|
NOTE: These scripts do not attempt to address changes in calling
|
||||||
|
sequences. After the script has run, you will need to update
|
||||||
|
calls to rtems_clock_get(), rtems_timer_fire_after(), and
|
||||||
|
rtems_timer_fire_when() by hand.
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
#
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
|
|
||||||
Misc. support tools for RTEMS workspaces.
|
|
||||||
More will be added later as they are converted from Teamware
|
|
||||||
to CVS.
|
|
||||||
|
|
||||||
install-if-change
|
|
||||||
Smart install script that also can append suffixes as it
|
|
||||||
installs (suffixes used for debug and profile variants).
|
|
||||||
Requires bash or ksh.
|
|
||||||
|
|
||||||
rcs-clean
|
|
||||||
deletes all files from the current directory that can be
|
|
||||||
re-created from RCS. Careful to not delete locked files.
|
|
||||||
May be used by 'gmake clobber'
|
|
||||||
|
|
||||||
lock-directory
|
|
||||||
unlock-directory
|
|
||||||
traverse a directory structure making it unwritable.
|
|
||||||
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,364 +0,0 @@
|
|||||||
/*
|
|
||||||
* cklength - check the length of lines in a file
|
|
||||||
*
|
|
||||||
* This program check to see if the files passed to it on the command line
|
|
||||||
* contain a line which exceeds the maximum allowable length. The default
|
|
||||||
* maximum line length is 80.
|
|
||||||
*
|
|
||||||
* usage: cklength [ -v ] [ arg ... ] files...
|
|
||||||
* -l length -- maximum line length
|
|
||||||
* -v -- verbose
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
* $Log$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define GETOPTARGS "l:nNv"
|
|
||||||
|
|
||||||
char *USAGE = "\
|
|
||||||
usage: cklength [ -v ] [ arg ... ] files... \n\
|
|
||||||
-l length -- maximum line length\n\
|
|
||||||
-n -- report line numbers for offending lines\n\
|
|
||||||
-N -- report line numbers and length for offending lines\n\
|
|
||||||
-v -- verbose\n\
|
|
||||||
\n\
|
|
||||||
Print the name of files which have at least 1 line which exceeds the\n\
|
|
||||||
maximum line length. The default maximum line length is 80.\n\
|
|
||||||
";
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <memory.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#define BUFFER_SIZE 512
|
|
||||||
|
|
||||||
#define SUCCESS 0
|
|
||||||
#define FAILURE -1
|
|
||||||
#define Failed(x) (((int) (x)) == FAILURE)
|
|
||||||
#define TRUE 1
|
|
||||||
#define FALSE 0
|
|
||||||
#define STREQ(a,b) (strcmp(a,b) == 0)
|
|
||||||
#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Definitions for unsigned "ints"; especially for use in data structures
|
|
||||||
* that will be shared among (potentially) different cpu's (we punt on
|
|
||||||
* byte ordering problems tho)
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef unsigned char u8;
|
|
||||||
typedef unsigned short u16;
|
|
||||||
typedef unsigned long u32;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* vars controlled by command line options
|
|
||||||
*/
|
|
||||||
|
|
||||||
int verbose = FALSE; /* be verbose */
|
|
||||||
int report_line_numbers = FALSE; /* report line numbers of offenders */
|
|
||||||
int report_line_length = FALSE; /* report line length of offenders */
|
|
||||||
|
|
||||||
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() */
|
|
||||||
|
|
||||||
int process(char *arg);
|
|
||||||
void error(int errn, ...);
|
|
||||||
long getparm(char *s, long min, long max, char *msg);
|
|
||||||
|
|
||||||
#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
|
|
||||||
#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */
|
|
||||||
#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */
|
|
||||||
#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
|
|
||||||
|
|
||||||
#define stol(p) strtol(p, (char **) NULL, 0)
|
|
||||||
int Open(), Read(), Write();
|
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc, char **argv, char **env)
|
|
||||||
{
|
|
||||||
register int c;
|
|
||||||
int showusage = FALSE; /* usage error? */
|
|
||||||
int rc = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* figure out invocation leaf-name
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
|
|
||||||
progname = argv[0];
|
|
||||||
else
|
|
||||||
progname++;
|
|
||||||
|
|
||||||
argv[0] = progname; /* for getopt err reporting */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Check options and arguments.
|
|
||||||
*/
|
|
||||||
|
|
||||||
opterr = 0; /* we'll report all errors */
|
|
||||||
while ((c = getopt(argc, argv, GETOPTARGS)) != EOF)
|
|
||||||
switch (c)
|
|
||||||
{
|
|
||||||
case 'l': /* line length */
|
|
||||||
line_length = atoi( optarg );
|
|
||||||
if ( line_length < 0 || line_length > BUFFER_SIZE )
|
|
||||||
error(ERR_FATAL, "(%d) is illegal line length\n",line_length);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'n': /* toggle report_line_numbers */
|
|
||||||
report_line_numbers = ! report_line_numbers;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'N': /* toggle both reports */
|
|
||||||
report_line_numbers = ! report_line_numbers;
|
|
||||||
report_line_length = ! report_line_length;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'v': /* toggle verbose */
|
|
||||||
verbose = ! verbose;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '?':
|
|
||||||
showusage = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showusage)
|
|
||||||
{
|
|
||||||
(void) fprintf(stderr, "%s", USAGE);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* traverse and process the arguments
|
|
||||||
*/
|
|
||||||
|
|
||||||
for ( ; argv[optind]; optind++)
|
|
||||||
if (Failed(process(argv[optind])))
|
|
||||||
rc = FAILURE;
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* process(arg)
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
process(char *arg)
|
|
||||||
{
|
|
||||||
FILE *in;
|
|
||||||
char *bptr;
|
|
||||||
char buffer[ BUFFER_SIZE ];
|
|
||||||
int line_number;
|
|
||||||
int length;
|
|
||||||
int count;
|
|
||||||
int rc = SUCCESS; /* succeed by default */
|
|
||||||
|
|
||||||
in = fopen( arg, "r" );
|
|
||||||
if (!in)
|
|
||||||
error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
|
|
||||||
|
|
||||||
count = 0;
|
|
||||||
|
|
||||||
for ( line_number=1 ; ; line_number++ ) {
|
|
||||||
bptr = fgets( buffer, BUFFER_SIZE, in );
|
|
||||||
if (!bptr)
|
|
||||||
break;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Don't count the carriage return.
|
|
||||||
*/
|
|
||||||
|
|
||||||
length = strlen( buffer ) - 1;
|
|
||||||
|
|
||||||
if ( length <= line_length )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ( count == 0 ) {
|
|
||||||
fprintf( stderr, "%s\n", arg );
|
|
||||||
if ( !report_line_numbers )
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( verbose )
|
|
||||||
fprintf( stderr, "TOO LONG:%d: %s\n", line_number, buffer );
|
|
||||||
|
|
||||||
if ( report_line_numbers ) {
|
|
||||||
if ( report_line_length )
|
|
||||||
fprintf( stderr, "%d: %d\n" , line_number, length );
|
|
||||||
else
|
|
||||||
fprintf( stderr, "%d\n" , line_number );
|
|
||||||
}
|
|
||||||
|
|
||||||
count++;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose( in );
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* error(errn, arglist)
|
|
||||||
* report an error to stderr using printf(3) conventions.
|
|
||||||
* Any output is preceded by '<progname>: '
|
|
||||||
*
|
|
||||||
* Uses ERR_FATAL bit to request exit(errn)
|
|
||||||
* ERR_ABORT to request abort()
|
|
||||||
* ERR_ERRNO to indicate use of errno instead of argument.
|
|
||||||
*
|
|
||||||
* If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
|
|
||||||
* associated error message is appended to the output.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*VARARGS*/
|
|
||||||
|
|
||||||
void
|
|
||||||
error(int error_flag, ...)
|
|
||||||
{
|
|
||||||
va_list arglist;
|
|
||||||
register char *format;
|
|
||||||
extern char *sys_errlist[];
|
|
||||||
extern int sys_nerr;
|
|
||||||
int local_errno;
|
|
||||||
|
|
||||||
extern int errno;
|
|
||||||
|
|
||||||
(void) fflush(stdout); /* in case stdout/stderr same */
|
|
||||||
|
|
||||||
local_errno = error_flag & ~ERR_MASK;
|
|
||||||
if (error_flag & ERR_ERRNO) /* use errno? */
|
|
||||||
local_errno = errno;
|
|
||||||
|
|
||||||
va_start(arglist, error_flag);
|
|
||||||
format = va_arg(arglist, char *);
|
|
||||||
(void) fprintf(stderr, "%s: ", progname);
|
|
||||||
(void) vfprintf(stderr, format, arglist);
|
|
||||||
va_end(arglist);
|
|
||||||
|
|
||||||
if (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);
|
|
||||||
|
|
||||||
if (error_flag & (ERR_FATAL | ERR_ABORT))
|
|
||||||
{
|
|
||||||
if (error_flag & ERR_FATAL)
|
|
||||||
{
|
|
||||||
error(0, local_errno ? "fatal error, exiting" : "exiting");
|
|
||||||
exit(local_errno);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
error(0, "fatal error, aborting");
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
long
|
|
||||||
getparm(char *s,
|
|
||||||
long min,
|
|
||||||
long max,
|
|
||||||
char *msg)
|
|
||||||
{
|
|
||||||
long val;
|
|
||||||
|
|
||||||
if ( ! strchr("0123456789-", *s))
|
|
||||||
{
|
|
||||||
error(ERR_FATAL, "'%s' is not a number", s);
|
|
||||||
return min;
|
|
||||||
}
|
|
||||||
|
|
||||||
val = strtol(s, (char **) NULL, 0);
|
|
||||||
if ((val < min) || (val > max))
|
|
||||||
{
|
|
||||||
if (min == max)
|
|
||||||
error(ERR_FATAL, "%s can only be %ld", s, min);
|
|
||||||
else
|
|
||||||
error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Open()
|
|
||||||
* Perform open(2), returning the file descriptor. Prints
|
|
||||||
* error message if open fails.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
Open(char *file,
|
|
||||||
int oflag,
|
|
||||||
int mode)
|
|
||||||
{
|
|
||||||
int O_fd;
|
|
||||||
|
|
||||||
if (Failed(O_fd = open(file, oflag, mode)))
|
|
||||||
error(
|
|
||||||
ERR_ERRNO | ERR_FATAL,
|
|
||||||
"open('%s', 0x%x, 0%o) failed", file, oflag, mode
|
|
||||||
);
|
|
||||||
|
|
||||||
return O_fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Read()
|
|
||||||
* Perform read(2); prints error message if fails.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
Read(int file,
|
|
||||||
char *buffer,
|
|
||||||
unsigned int count)
|
|
||||||
{
|
|
||||||
int nbytes;
|
|
||||||
|
|
||||||
if (Failed(nbytes = read(file, buffer, count)))
|
|
||||||
error(
|
|
||||||
ERR_ERRNO | ERR_FATAL,
|
|
||||||
"read(%d, 0x%x, %d) failed", file, buffer, count
|
|
||||||
);
|
|
||||||
|
|
||||||
return nbytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Write()
|
|
||||||
* Perform write(2); prints error message if fails.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
Write(int file,
|
|
||||||
char *buffer,
|
|
||||||
unsigned int count)
|
|
||||||
{
|
|
||||||
int nbytes;
|
|
||||||
|
|
||||||
if (Failed(nbytes = write(file, buffer, count)))
|
|
||||||
error(
|
|
||||||
ERR_ERRNO | ERR_FATAL,
|
|
||||||
"write(%d, 0x%x, %d) failed", file, buffer, count
|
|
||||||
);
|
|
||||||
|
|
||||||
return nbytes;
|
|
||||||
}
|
|
||||||
@@ -1,351 +0,0 @@
|
|||||||
/*
|
|
||||||
* eolstrip - strip white space from end of lines
|
|
||||||
*
|
|
||||||
* This program strips the white space from the end of every line in the
|
|
||||||
* specified program.
|
|
||||||
*
|
|
||||||
* usage: eolstrip [ -v ] [ arg ... ] files...
|
|
||||||
* -v -- verbose
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
* $Log$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define GETOPTARGS "vt"
|
|
||||||
|
|
||||||
char *USAGE = "\
|
|
||||||
usage: cklength [ -v ] [ arg ... ] files... \n\
|
|
||||||
-v -- verbose\n\
|
|
||||||
-t -- test only .. DO NOT OVERWRITE FILE!!!\n\
|
|
||||||
\n\
|
|
||||||
Strip the white space from the end of every line on the list of files.\n\
|
|
||||||
";
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <memory.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#define BUFFER_SIZE 2048
|
|
||||||
#define MAX_PATH 2048
|
|
||||||
|
|
||||||
#define SUCCESS 0
|
|
||||||
#define FAILURE -1
|
|
||||||
#define Failed(x) (((int) (x)) == FAILURE)
|
|
||||||
#define TRUE 1
|
|
||||||
#define FALSE 0
|
|
||||||
#define STREQ(a,b) (strcmp(a,b) == 0)
|
|
||||||
#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Definitions for unsigned "ints"; especially for use in data structures
|
|
||||||
* that will be shared among (potentially) different cpu's (we punt on
|
|
||||||
* byte ordering problems tho)
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef unsigned char u8;
|
|
||||||
typedef unsigned short u16;
|
|
||||||
typedef unsigned long u32;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* vars controlled by command line options
|
|
||||||
*/
|
|
||||||
|
|
||||||
int verbose = FALSE; /* be verbose */
|
|
||||||
int test_only = FALSE; /* test only */
|
|
||||||
|
|
||||||
extern char *optarg; /* getopt(3) control vars */
|
|
||||||
extern int optind, opterr;
|
|
||||||
extern int errno;
|
|
||||||
|
|
||||||
char *progname; /* for error() */
|
|
||||||
|
|
||||||
int process(char *arg);
|
|
||||||
void error(int errn, ...);
|
|
||||||
long getparm(char *s, long min, long max, char *msg);
|
|
||||||
|
|
||||||
#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
|
|
||||||
#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */
|
|
||||||
#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */
|
|
||||||
#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
|
|
||||||
|
|
||||||
#define stol(p) strtol(p, (char **) NULL, 0)
|
|
||||||
int Open(), Read(), Write();
|
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc, char **argv, char **env)
|
|
||||||
{
|
|
||||||
register int c;
|
|
||||||
int showusage = FALSE; /* usage error? */
|
|
||||||
int rc = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* figure out invocation leaf-name
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
|
|
||||||
progname = argv[0];
|
|
||||||
else
|
|
||||||
progname++;
|
|
||||||
|
|
||||||
argv[0] = progname; /* for getopt err reporting */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Check options and arguments.
|
|
||||||
*/
|
|
||||||
|
|
||||||
opterr = 0; /* we'll report all errors */
|
|
||||||
while ((c = getopt(argc, argv, GETOPTARGS)) != EOF)
|
|
||||||
switch (c)
|
|
||||||
{
|
|
||||||
case 't': /* toggle test only mode */
|
|
||||||
test_only = ! test_only;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'v': /* toggle verbose */
|
|
||||||
verbose = ! verbose;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '?':
|
|
||||||
showusage = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showusage)
|
|
||||||
{
|
|
||||||
(void) fprintf(stderr, "%s", USAGE);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* traverse and process the arguments
|
|
||||||
*/
|
|
||||||
|
|
||||||
for ( ; argv[optind]; optind++)
|
|
||||||
if (Failed(process(argv[optind])))
|
|
||||||
rc = FAILURE;
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* process(arg)
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
process(char *arg)
|
|
||||||
{
|
|
||||||
FILE *in;
|
|
||||||
FILE *out = (FILE *) 0;
|
|
||||||
char outname[ MAX_PATH ];
|
|
||||||
char *bptr;
|
|
||||||
char buffer[ BUFFER_SIZE ];
|
|
||||||
int length;
|
|
||||||
int line_number;
|
|
||||||
int rc = SUCCESS; /* succeed by default */
|
|
||||||
|
|
||||||
in = fopen( arg, "r" );
|
|
||||||
if (!in)
|
|
||||||
error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
|
|
||||||
|
|
||||||
if ( !test_only ) {
|
|
||||||
sprintf( outname, "%s.eoltmp", arg );
|
|
||||||
|
|
||||||
out = fopen( outname, "w" );
|
|
||||||
if (!out)
|
|
||||||
error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( verbose )
|
|
||||||
fprintf( stderr, "Processing %s\n", arg );
|
|
||||||
|
|
||||||
for ( line_number=1 ; ; line_number++ ) {
|
|
||||||
bptr = fgets( buffer, BUFFER_SIZE, in );
|
|
||||||
if (!bptr)
|
|
||||||
break;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Don't count the carriage return.
|
|
||||||
*/
|
|
||||||
|
|
||||||
length = strlen( buffer ) - 1;
|
|
||||||
|
|
||||||
if ( buffer[ length ] != '\n' )
|
|
||||||
error(ERR_ERRNO|ERR_FATAL, "Line %d too long in %s\n", line_number, arg);
|
|
||||||
|
|
||||||
while ( isspace( buffer[ length ] ) )
|
|
||||||
buffer[ length-- ] = '\0';
|
|
||||||
|
|
||||||
if ( test_only ) {
|
|
||||||
fprintf( stderr, "%s\n", arg );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf( out, "%s\n", buffer );
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose( in );
|
|
||||||
if ( !test_only ) {
|
|
||||||
fclose( out );
|
|
||||||
rename( outname, arg );
|
|
||||||
}
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* error(errn, arglist)
|
|
||||||
* report an error to stderr using printf(3) conventions.
|
|
||||||
* Any output is preceded by '<progname>: '
|
|
||||||
*
|
|
||||||
* Uses ERR_FATAL bit to request exit(errn)
|
|
||||||
* ERR_ABORT to request abort()
|
|
||||||
* ERR_ERRNO to indicate use of errno instead of argument.
|
|
||||||
*
|
|
||||||
* If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
|
|
||||||
* associated error message is appended to the output.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*VARARGS*/
|
|
||||||
|
|
||||||
void
|
|
||||||
error(int error_flag, ...)
|
|
||||||
{
|
|
||||||
va_list arglist;
|
|
||||||
register char *format;
|
|
||||||
extern char *sys_errlist[];
|
|
||||||
extern int sys_nerr;
|
|
||||||
int local_errno;
|
|
||||||
|
|
||||||
extern int errno;
|
|
||||||
|
|
||||||
(void) fflush(stdout); /* in case stdout/stderr same */
|
|
||||||
|
|
||||||
local_errno = error_flag & ~ERR_MASK;
|
|
||||||
if (error_flag & ERR_ERRNO) /* use errno? */
|
|
||||||
local_errno = errno;
|
|
||||||
|
|
||||||
va_start(arglist, error_flag);
|
|
||||||
format = va_arg(arglist, char *);
|
|
||||||
(void) fprintf(stderr, "%s: ", progname);
|
|
||||||
(void) vfprintf(stderr, format, arglist);
|
|
||||||
va_end(arglist);
|
|
||||||
|
|
||||||
if (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);
|
|
||||||
|
|
||||||
if (error_flag & (ERR_FATAL | ERR_ABORT))
|
|
||||||
{
|
|
||||||
if (error_flag & ERR_FATAL)
|
|
||||||
{
|
|
||||||
error(0, local_errno ? "fatal error, exiting" : "exiting");
|
|
||||||
exit(local_errno);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
error(0, "fatal error, aborting");
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
long
|
|
||||||
getparm(char *s,
|
|
||||||
long min,
|
|
||||||
long max,
|
|
||||||
char *msg)
|
|
||||||
{
|
|
||||||
long val;
|
|
||||||
|
|
||||||
if ( ! strchr("0123456789-", *s))
|
|
||||||
{
|
|
||||||
error(ERR_FATAL, "'%s' is not a number", s);
|
|
||||||
return min;
|
|
||||||
}
|
|
||||||
|
|
||||||
val = strtol(s, (char **) NULL, 0);
|
|
||||||
if ((val < min) || (val > max))
|
|
||||||
{
|
|
||||||
if (min == max)
|
|
||||||
error(ERR_FATAL, "%s can only be %ld", s, min);
|
|
||||||
else
|
|
||||||
error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Open()
|
|
||||||
* Perform open(2), returning the file descriptor. Prints
|
|
||||||
* error message if open fails.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
Open(char *file,
|
|
||||||
int oflag,
|
|
||||||
int mode)
|
|
||||||
{
|
|
||||||
int O_fd;
|
|
||||||
|
|
||||||
if (Failed(O_fd = open(file, oflag, mode)))
|
|
||||||
error(
|
|
||||||
ERR_ERRNO | ERR_FATAL,
|
|
||||||
"open('%s', 0x%x, 0%o) failed", file, oflag, mode
|
|
||||||
);
|
|
||||||
|
|
||||||
return O_fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Read()
|
|
||||||
* Perform read(2); prints error message if fails.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
Read(int file,
|
|
||||||
char *buffer,
|
|
||||||
unsigned int count)
|
|
||||||
{
|
|
||||||
int nbytes;
|
|
||||||
|
|
||||||
if (Failed(nbytes = read(file, buffer, count)))
|
|
||||||
error(
|
|
||||||
ERR_ERRNO | ERR_FATAL,
|
|
||||||
"read(%d, 0x%x, %d) failed", file, buffer, count
|
|
||||||
);
|
|
||||||
|
|
||||||
return nbytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Write()
|
|
||||||
* Perform write(2); prints error message if fails.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
Write(int file,
|
|
||||||
char *buffer,
|
|
||||||
unsigned int count)
|
|
||||||
{
|
|
||||||
int nbytes;
|
|
||||||
|
|
||||||
if (Failed(nbytes = write(file, buffer, count)))
|
|
||||||
error(
|
|
||||||
ERR_ERRNO | ERR_FATAL,
|
|
||||||
"write(%d, 0x%x, %d) failed", file, buffer, count
|
|
||||||
);
|
|
||||||
|
|
||||||
return nbytes;
|
|
||||||
}
|
|
||||||
12
c/build-tools/os/msdos/README
Normal file
12
c/build-tools/os/msdos/README
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
|
ifc is an MS-DOS executable which is equivalent to the program
|
||||||
|
install-if-change. It was compiled using Borland C 2.00.
|
||||||
|
|
||||||
|
cklength is a precompiled version of the program cklength.c from
|
||||||
|
the main source tree.
|
||||||
|
|
||||||
|
fixtimer is a program to restore the clock if the program does not
|
||||||
|
exit cleanly.
|
||||||
286
c/build-tools/os/msdos/cklength.uue
Normal file
286
c/build-tools/os/msdos/cklength.uue
Normal file
@@ -0,0 +1,286 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
begin 664 cklength
|
||||||
|
M?T5,1@$" 0 " ( ! $,% #0 "T8 T "
|
||||||
|
M!0 H !H %P 8 T $ - "@ H 4 P
|
||||||
|
M -0 !$ ! ! ! 7
|
||||||
|
M2P %TL % $ $ !=, (73 &\ %? < 0
|
||||||
|
M @ %U A=0 (@ !P O=7-R+VQI8B]L9"YS
|
||||||
|
M;RXQ $, !6 20 #P
|
||||||
|
M #@ $4 /0 !P !# &@
|
||||||
|
M A 30 #\ *0 $X !" D
|
||||||
|
M $@ W $8 )@ "
|
||||||
|
M ! %( 4P Z *@ 00
|
||||||
|
M $H 'P $L !5 3P L .P %0 H
|
||||||
|
M-@ #$ P 40
|
||||||
|
M
|
||||||
|
M
|
||||||
|
M G
|
||||||
|
M '0 C ; N
|
||||||
|
M "( -0 E #D R - !X
|
||||||
|
M "T ,P !$ *P
|
||||||
|
M ^ "\ 3 % !'
|
||||||
|
M 0#4 , $ $ Z # "
|
||||||
|
M ! U0 P P 0BT , 0 $*W #
|
||||||
|
M % !"S P !@ 0P4 , < $32
|
||||||
|
M # ( !$^ P "0 1/L , H $3
|
||||||
|
M] # + !% P # A=, , T
|
||||||
|
M (74 # . "%]@ P #P ACP , !
|
||||||
|
M (9" # 1 P $@ ,
|
||||||
|
M !, # 4 P %0
|
||||||
|
M , !8 # 7 P &
|
||||||
|
M , !D ! (8. 2 " !$_0 $0 "P !8
|
||||||
|
M 0P4 =!( < = (8U 2 (@ "&$0 $@
|
||||||
|
M "< 1/L !$ H U (8O 2 / "&0@ $$0
|
||||||
|
M$0 $4 AB8 !( !. (9# 01 1 5P "',@
|
||||||
|
M$0#_\0 %P 1+ 2!( < !B $2> $@2 ' 9P !$8@
|
||||||
|
M "H$@ !P &\ AD8 !0"$ !$ !T (73 1 /_Q B@ "
|
||||||
|
M&*0 $@ ) A@( !( "7 (8% 2
|
||||||
|
MG !$T@ $@ " *( ACT !!$ ! "J (9$ 01 1
|
||||||
|
M M "&E@ )@$0 $0 , AB !( #' (8\ 01
|
||||||
|
M 0 S0 "%U $0#_\0 -8 0[H !0!( < #> (9&
|
||||||
|
M 4 1 1 Y "&E@ )@$0 $0 /$ AC@ !( #W (8
|
||||||
|
M+ 2 _P "&" $@ 04 AD, !"$ !$ $-
|
||||||
|
M (<N 01 1 !$P "&+ $@ 1H 1 H !8!( <
|
||||||
|
M $@ (8_ 01 0 !,P "'+P $$0 $0 3H AC( !(
|
||||||
|
M $_ (<P 01 1 !1@ "&&@ $@ 4P AS$
|
||||||
|
M!!$ !$ %3 (8^ 01 0 !9P "&0@ $0#_\0 6X A?8
|
||||||
|
M !$ __$ &( (87 2 !C@ "&1 $$0 $0 9<
|
||||||
|
M 1,( /!( < &I $3\ 1 * !M@ !%TL $0#_\0
|
||||||
|
M ;T 10 !!$ P '* $2, $@2 ' !SP "&(P $@
|
||||||
|
M =8 0R( !( < 'H $3^ 1 + !]0 !#10 '4
|
||||||
|
M$@ !P ?H AD !!$ ! (& (8= 2 "#0 !$^
|
||||||
|
M $@ "0 A, AA0 !( 9V5T;W!T %]?1%1/4E],25-47U\
|
||||||
|
M7W-T87)T ')E860 871O:0!?7T-43U)?3$E35%]? '-T<G1O; !P<F]G;F%M
|
||||||
|
M90!V9G!R:6YT9@!?96YV:7)O;@!?96YD %=R:71E %)E860 9V5T<&%R;0!?
|
||||||
|
M:6]B %]'3$]"04Q?3T9&4T547U1!0DQ%7P!A8F]R= !A=&5X:70 97AI= !?
|
||||||
|
M:6YI= !V97)B;W-E %]S>7-?;F5R<@!S>7-?97)R;&ES= !F8VQO<V4 55-!
|
||||||
|
M1T4 7T193D%-24, <')O8V5S<P!?7VEO8@!?<WES7V5R<FQI<W0 =W)I=&4
|
||||||
|
M<W1R<F-H<@!?97AI= !E;G9I<F]N &5R<FYO '-T<F-H<@!E<G)O<@!R97!O
|
||||||
|
M<G1?;&EN95]L96YG=&@ ;W!T:6YD &]P96X ;W!T87)G &9G971S &]P=&5R
|
||||||
|
M<@!R97!O<G1?;&EN95]N=6UB97)S %]E9&%T80!?4%)/0T5$55)%7TQ)3DM!
|
||||||
|
M1T5?5$%"3$5? &9O<&5N '-Y<U]N97)R %]?9&]?9VQO8F%L7V1T;W)S %]?
|
||||||
|
M0U1/4E]%3D1?7P!?971E>'0 7VQI8E]V97)S:6]N $]P96X 9F9L=7-H %]?
|
||||||
|
M9&]?9VQO8F%L7V-T;W)S %]?1%1/4E]%3D1?7P!M86EN &QI;F5?;&5N9W1H
|
||||||
|
M '-T<FQE;@!?9FEN:0!F<')I;G1F &QI8F,N<V\N,0 AD, C$P
|
||||||
|
M AS$ !#$P AS !!$P AR\ _$P AD8 U
|
||||||
|
M$P " AD0 !($P AI8 P$P A@( K%0 A@4
|
||||||
|
M L%0 A@@ Y%0 A@L X%0 A@X :%0
|
||||||
|
M AA$ >%0 AA0 !5%0 AA< !'%0 AAH !"%0
|
||||||
|
M AAT !3%0 AB Q%0 AB, !.%0 AB8 B
|
||||||
|
M%0 ABD J%0 ABP \%0 AB\ @%0 AC(
|
||||||
|
M ! %0 AC4 =%0 AC@ W%0 "\$" X .@0*(#H$2<
|
||||||
|
M(Z @@) 0* 20$ !0 !"]@$ 1 !$D!(CX$ 0O(! 0 !P $
|
||||||
|
M "0$ 0DA $94L( *4 J $E 1 "A< (:6$N$,U"+ $ "D! 0 !"
|
||||||
|
MYP$ ! $+H 0 ('#X @! $0 1-0"(^R HK__$H #9(2(^S0 F $
|
||||||
|
M@*(@ * F4$" E@)@!)(0( "2 F $T ) "X"B( 2O__]E *@ 9*2@ "
|
||||||
|
M@ ,$0 1!$ $2B$B/LH2I@ M $ !&?P@ 0 *"$/_PRO__]T 0 $1$
|
||||||
|
M $1 $+!D!(C"(''X B!Z G>._F*@0 !BB$" L! @ - &0 ! $+!DA @
|
||||||
|
M+Q, (: HB $H !- B80@0@ $T 9 - "80B0 B !T")A"!$ (;0 B$(
|
||||||
|
MT"9 !$ (? (B#$(0 AB< (8E "&%0 19 0 !22$ 90 !"KI02H:"
|
||||||
|
MHC__ H ,X"B(&PB@ 1$0 AQ2 F HB!N@*(@/P* "J HB!. H '- $
|
||||||
|
M(/@0O__P%0 10* !. HB!V H 'M $H/00O__J%0 14 0IO0 B# E!
|
||||||
|
M"!$ (: HJ( "+__XM0B(0 3 !%$0@ $ (N2$F&H$+__W14 $70!"#X
|
||||||
|
M@* ")!@/_\0O__7T"0@^("@ B08#__T"0@^- $X/R H (D& __Q"__\_0
|
||||||
|
M).#\@* ")!@/_\0O__+T"2@]!"__\FB$" !@*1@ "* L1 "'%0 AA$
|
||||||
|
M (:0$B$X$P 19(28<A $)VU *@\$ 0F60$" !DA "- "(+R1*B "T 9
|
||||||
|
M"("B( "@ 1(0 A] "8+R1*B "0 #] &0 B HC__(H K 0/__0!""\
|
||||||
|
MD (@ = D(+R1*B "T 9 "("B( 2O__SDA $(''X B!Z G>.]F) 0 !@3
|
||||||
|
M !%0 !"6I(28="JD@ $H !Z80( 1& $P 19(28=A !%E! &* 0
|
||||||
|
M( &H![WX)0 ABT (:0$ 4DA B $ 0DV4$ 5@*(@ * #4! 0 !"
|
||||||
|
M2Y 0 !2B C__$0 AM "(0" I$ (!( *X"DX 2@ +$0 AA, $60%*$X
|
||||||
|
MDA)A^$ 0C64$ 8T 6@^("B( "@ B$0 AM "(/2 HB H !Q, $60
|
||||||
|
M%*$XDA)B )00 !! $(HE@>]^- %H/B HB H $A$ (;0 B#\@*(@ *
|
||||||
|
M D3 !%D!2A.)(28AB4$ 00 !"&Y80 !$0@ (I@3@ 1, $60%*$XDA)B
|
||||||
|
M($ 0A24$ 0I@3@ 1"__\B@!" !0 !"&Y 0 !6P$" @<?@"('H "=X[^0
|
||||||
|
M\B>@2/0GH$SV)Z!0^">@5/HGH%@1 "&0 !"$I 2(2@1' LBX "!$0 "
|
||||||
|
MC@ ( H !*('H$P1 "'\@(@N. 'H$@5 "&-0 AI 6H3@3 !%DA)B*$
|
||||||
|
M0?/4 J$(D!:A.)(0 !! $(!E! $8"F8 "@ :$0 A@2 !*0$B$X$0
|
||||||
|
MAM "(1" ID (-H #!$ (85 "&E!*B6)<N8 *0%J$X$P 19(28C! $'=
|
||||||
|
MU + "A" X1 "&D!(A.!, $62$F(X0 !!UI00 !D0@ '$0 AI 2(3@3
|
||||||
|
M !%0 !!T)(28E 1 "&0 !!W) 2(3@1# @(X " * !41" @(X " *
|
||||||
|
M R IF H !1$ $41 !%$( Y(2(EB2$B)P?___M) 0( ! $&MD!
|
||||||
|
M&9 0( 3 !%?___KI(28GA $'+ 0 (''X B!Z G>._F* 0 !@1 !%
|
||||||
|
MD!(BD$ 0<;23 @*(@ !* F0$ 0$0@ !, $62$F*@?___G)00 ! 0
|
||||||
|
M@ :L! &9(0( ! $&\E! @ + 0 B I@ 9!H !("F !H$@ 1 0 ("F
|
||||||
|
M0!H2@ ($0@ !, $62$F*XE! $'___XF6$ :,( !Q, $62$F+0E!
|
||||||
|
M&Y80 !E___^"F! &H''X B!Z G>._F* 0 !B0$ 0DA &4 0:*4$ :
|
||||||
|
ML! "("F/_\2@ ($1@ !, $62$F+PE! $)80 !E___]PF! &H''X B!
|
||||||
|
MZ G>._F* 0 !B0$ 0DA &4 09.4$ :L! "("F/_\2@ ($1@ !,
|
||||||
|
M $62$F,0E! $)80 !E___]>F! &H''X B!Z G>._F* 0 !B0$ 0DA
|
||||||
|
M&4 0824$ :L! "("F/_\2@ ($1@ !, $62$F,PE! $)80 !E___],
|
||||||
|
MF! &H''X B!Z G>._F!$ $32 B/X@*)@ * F@$B/XT 0 )_" "@
|
||||||
|
M!" $T 0 ("B( 2O__[ 0 (''X B!Z G>._F)WCOZ"!Z G>._F!$
|
||||||
|
M $34 B/L@**__Q* V2$B/LT )@!("B( "@ )E! @ )8"8 22$" D@)@
|
||||||
|
M!- "0 N HB $K___90"H &2DH H #!$ $01 !$HA(C[*$J8 +0! 1
|
||||||
|
MG\( $ "@A#_\,K___= $ !$1 !$0 !!$) 2(PB!Q^ (@>@ (''X B!
|
||||||
|
MZ G>._H(''X B!Z _____P #_____ ! '5S
|
||||||
|
M86=E.B @8VML96YG=&@@(%L@+78@72!;(&%R9R N+BX@72!F:6QE<RXN+B *
|
||||||
|
M(" @(" @(" @(" @+6P@;&5N9W1H(" @+2T@;6%X:6UU;2!L:6YE(&QE;F=T
|
||||||
|
M: H@(" @(" @(" @(" M;B @(" @(" @(" M+2!R97!O<G0@;&EN92!N=6UB
|
||||||
|
M97)S(&9O<B!O9F9E;F1I;F<@;&EN97,*(" @(" @(" @(" @+4X@(" @(" @
|
||||||
|
M(" @+2T@<F5P;W)T(&QI;F4@;G5M8F5R<R!A;F0@;&5N9W1H(&9O<B!O9F9E
|
||||||
|
M;F1I;F<@;&EN97,*(" @(" @(" @(" @+78@(" @(" @(" @+2T@=F5R8F]S
|
||||||
|
M90H*4')I;G0@=&AE(&YA;64@;V8@9FEL97,@=VAI8V@@:&%V92!A="!L96%S
|
||||||
|
M=" Q(&QI;F4@=VAI8V@@97AC965D<R!T:&4*;6%X:6UU;2!L:6YE(&QE;F=T
|
||||||
|
M:"X@(%1H92!D969A=6QT(&UA>&EM=6T@;&EN92!L96YG=&@@:7,@.# N"@
|
||||||
|
M &PZ;DYV *"5D*2!I<R!I;&QE9V%L(&QI;F4@;&5N9W1H"@ E<P
|
||||||
|
M '( 56YA8FQE('1O(&]P96X@9FEL92 H)7,I"@ E
|
||||||
|
M<PH %1/3R!,3TY'.B5D.B E<PH "5D.B E9 H )60*
|
||||||
|
M E<SH@ " H)7,I"@ ("AU;FMN;W=N(&5R<FYO/25D*0H "@
|
||||||
|
M !F871A;"!E<G)O<BP@97AI=&EN9P !E>&ET:6YG &9A=&%L(&5R
|
||||||
|
M<F]R+"!A8F]R=&EN9P # Q,C,T-38W.#DM G)7,G(&ES(&YO="!A
|
||||||
|
M(&YU;6)E<@ E<R!C86X@;VYL>2!B92 E;&0 E<R!M=7-T(&)E
|
||||||
|
M(&)E='=E96X@)6QD(&%N9" E;&0 &]P96XH)R5S)RP@,'@E>"P@,"5O*2!F
|
||||||
|
M86EL960 <F5A9"@E9"P@,'@E>"P@)60I(&9A:6QE9 !W<FET
|
||||||
|
M92@E9"P@,'@E>"P@)60I(&9A:6QE9 (74 $ (; # !$T@
|
||||||
|
M - $3X 0 0#H !0 !"+0 * ")0 8 0-4 "P
|
||||||
|
M ! 5 , A?8 @ .0 4 !P !< 0LP
|
||||||
|
M!P !"MP ( !. D ,
|
||||||
|
M # P,+__\P$ #
|
||||||
|
M \,+__\ $ # !(,+__[0$ # !4,+__Z@$ # !@,+__YP$
|
||||||
|
M # !L,+__Y $ # !X,+__X0$ # "$,+__W@$ # "0,+__
|
||||||
|
MVP$ # "<,+__V $ # "H,+__U0$ # "T,+__T@$ # #
|
||||||
|
M,+__SP$ # #,,+__S $ # #8,+__R0$ # #D,+__Q@$ #
|
||||||
|
M #P,+__PP$ # #\,+__P $ # $(,+__O0$ ! $4"
|
||||||
|
M % $
|
||||||
|
M 0 __$ $ U # ! ! .@ P @ 0-4
|
||||||
|
M , , $(M # $ !"MP P !0
|
||||||
|
M 0LP , 8 $,% # ' !$T@ P "
|
||||||
|
M 1/@ , D $3[ # * !$_0 P
|
||||||
|
M"P 10 , P (73 # - "%U
|
||||||
|
M P #@ A?8 , \ (8\ # 0 "&0@
|
||||||
|
M P $0 , !( # 3
|
||||||
|
M P % , !4 # 6
|
||||||
|
M P %P , !@ # 9
|
||||||
|
M #P ! #_\0 !8 0 __$ B $
|
||||||
|
M /_Q +0 !$U @ " $, 0R( < !2 (8\
|
||||||
|
M ! 0 8 ! #_\0 &L 0T4 < !Z
|
||||||
|
M $ /_Q A ! #_\0 (\ 1-$ ( < "E
|
||||||
|
M $31 ' M "&00 0 $ ,( 0 __$
|
||||||
|
M #) (8. 2 T !$_0 $0 "P -X 0P4 =!(
|
||||||
|
M < #E (8U 2 Z@ "&$0 $@ .\ 1/L
|
||||||
|
M !$ H #] (8O 2 !! "&0@ $$0 $0 0T AB8
|
||||||
|
M !( $6 (9# 01 1 !'P "',@ $0#_\0 20
|
||||||
|
M 1+ 2!( < $J $2> $@2 ' !+P !$8@ "H$@ !P
|
||||||
|
M 3< AD8 !0"$ !$ $\ (73 1 /_Q !4@ "&*0 $@
|
||||||
|
M 5@ A@( !( %? (8% 2 !9 !$T@
|
||||||
|
M$@ " 6H ACT !!$ ! %R (9$ 01 1 !? "&E@
|
||||||
|
M )@$0 $0 8@ AB !( &/ (8\ 01 0 !E0 "
|
||||||
|
M%U $0#_\0 9X 0[H !0!( < &F (9& 4 1 1 !
|
||||||
|
MK "&E@ )@$0 $0 ;D AC@ !( &_ (8+ 2
|
||||||
|
M !QP "&" $@ <T AD, !"$ !$ '5 (<N 01
|
||||||
|
M 1 !VP "&+ $@ >( 1 H !8!( < 'H (8_
|
||||||
|
M 01 0 !^P "'+P $$0 $0 @( AC( !( (' (<
|
||||||
|
MP 01 1 "#@ "&&@ $@ A0 AS$ !!$ !$ (;
|
||||||
|
M (8^ 01 0 "+P "&0@ $0#_\0 C8 A?8 !$ __$
|
||||||
|
M )0 (87 2 "5@ "&1 $$0 $0 E\ 1,( /!(
|
||||||
|
M < )Q $3\ 1 * "?@ !%TL $0#_\0 H4 10
|
||||||
|
M!!$ P *2 $2, $@2 ' "EP "&(P $@ IX 0R(
|
||||||
|
M !( < *P $3^ 1 + "O0 !#10 '4$@ !P L(
|
||||||
|
M AD !!$ ! +. (8= 2 "U0 !$^ $@ "0
|
||||||
|
M ML AA0 !( 9V\S,B]C:VQE;F=T: !C<G1I+G, =F%L=65S+5AA
|
||||||
|
M+F, 8W)T<W1U9F8N8P!?7V1O7V=L;V)A;%]C=&]R<U]A=7@ 9V-C,E]C;VUP
|
||||||
|
M:6QE9"X 9F]R8V5?=&]?9&%T80!C:VQE;F=T:"YC &=C8S)?8V]M<&EL960N
|
||||||
|
M &QI8F=C8S(N8P!C<G1S='5F9BYC %]?9&]?9VQO8F%L7V-T;W)S7V%U> !G
|
||||||
|
M8V,R7V-O;7!I;&5D+@!F;W)C95]T;U]D871A &-R=&XN<P!G971O<'0 7U]$
|
||||||
|
M5$]27TQ)4U1?7P!?<W1A<G0 <F5A9 !A=&]I %]?0U1/4E],25-47U\ <W1R
|
||||||
|
M=&]L '!R;V=N86UE '9F<')I;G1F %]E;G9I<F]N %]E;F0 5W)I=&4 4F5A
|
||||||
|
M9 !G971P87)M %]I;V( 7T=,3T)!3%]/1D93151?5$%"3$5? &%B;W)T &%T
|
||||||
|
M97AI= !E>&ET %]I;FET '9E<F)O<V4 7W-Y<U]N97)R '-Y<U]E<G)L:7-T
|
||||||
|
M &9C;&]S90!54T%'10!?1%E.04U)0P!P<F]C97-S %]?:6]B %]S>7-?97)R
|
||||||
|
M;&ES= !W<FET90!S=')R8VAR %]E>&ET &5N=FER;VX 97)R;F\ <W1R8VAR
|
||||||
|
M &5R<F]R ')E<&]R=%]L:6YE7VQE;F=T: !O<'1I;F0 ;W!E;@!O<'1A<F<
|
||||||
|
M9F=E=', ;W!T97)R ')E<&]R=%]L:6YE7VYU;6)E<G, 7V5D871A %]04D]#
|
||||||
|
M14154D5?3$E.2T%'15]404),15\ 9F]P96X <WES7VYE<G( 7U]D;U]G;&]B
|
||||||
|
M86Q?9'1O<G, 7U]#5$]27T5.1%]? %]E=&5X= !?;&EB7W9E<G-I;VX 3W!E
|
||||||
|
M;@!F9FQU<V@ 7U]D;U]G;&]B86Q?8W1O<G, 7U]$5$]27T5.1%]? &UA:6X
|
||||||
|
M;&EN95]L96YG=&@ <W1R;&5N %]F:6YI &9P<FEN=&8 $ %
|
||||||
|
MFP UD "]D # %$X ((X
|
||||||
|
M $8\ ! *",I4W5N3U,@-2XS($=E;F5R:6,@4V5P=&5M
|
||||||
|
M8F5R(#$Y.3, &%S.B!30S,N,"!E87)L>2!A8V-E<W,@,#$@4V5P(#$Y.3,*
|
||||||
|
M $=#0SH@*$=.52D@,BXV+C, &%S.B!30S,N,"!E87)L>2!A8V-E<W,@,#$@
|
||||||
|
M4V5P(#$Y.3,* $=#0SH@*$=.52D@,BXV+C, &%S.B!30S,N,"!E87)L>2!A
|
||||||
|
M8V-E<W,@,#$@4V5P(#$Y.3,* $=#0SH@*$=.52D@,BXV+C, &%S.B!30S,N
|
||||||
|
M,"!E87)L>2!A8V-E<W,@,#$@4V5P(#$Y.3,* $=#0SH@*$=.52D@,BXV+C,
|
||||||
|
M;&0Z("A31U4I(%-U;D]3+T5,1B H3$LM,2XS*0 0 "D 8?
|
||||||
|
M"V0 1,( (60 1,( +3P /(
|
||||||
|
M 7H <( EX L(
|
||||||
|
M SH !$H !5H !=(
|
||||||
|
M !EH !LX !SX !
|
||||||
|
MX8 !]( "#( ".8
|
||||||
|
M "5( "<( "D8 "G8
|
||||||
|
M "R( #&8 $GH %+(
|
||||||
|
M & %.8 ) %0X -< %3H #0 %
|
||||||
|
M6H #4 %9( #8 %;X #< %>8 #@
|
||||||
|
M %A( #D %CX #H %FH $8 %IX
|
||||||
|
M %T( &T %]( "X &"20 !\L 1,( "YI;G1E
|
||||||
|
M<G +FAA<V@ +F1Y;G-Y;0 N9'EN<W1R "YR96QA+F)S<P N<F5L82YP;'0
|
||||||
|
M+G1E>'0 +FEN:70 +F9I;FD +F-T;W)S "YD=&]R<P N<F]D871A "YG;W0
|
||||||
|
M+F1Y;F%M:6, +G!L= N9&%T80 N8G-S "YS>6UT86( +G-T<G1A8@ N<W1A
|
||||||
|
M8BYI;F1E> N8V]M;65N= N<W1A8@ N<VAS=')T86( +G-T86(N:6YD97AS
|
||||||
|
M='( +G-T86)S='( '9A;'5E<RU882YC "\Q,#DS+V]N,3 Y,U]W<R]U<W(O
|
||||||
|
M<W)C+VQI8B]L:6)C+P!P;W)T+V=E;B]V86QU97,M6&$N8P %AT(#L@5CTR
|
||||||
|
M+C +VYE="]M;W)G86YA+W5S<C$O<G1E;7,M,RXU+C P+V,O8G5I;&0M=&]O
|
||||||
|
M;',O<W)C "]U<W(O8V-S+VQI8B]V86QU97,M6&$N;P ;&EB9V-C,BYC "]U
|
||||||
|
M<W(T+T=.050O9V-C+3(N-BXS+P N+VQI8F=C8S(N8P!G8V,R7V-O;7!I;&5D
|
||||||
|
M+@!I;G0Z=#$]<C$[+3(Q-#<T.#,V-#@[,C$T-S0X,S8T-SL 8VAA<CIT,CUR
|
||||||
|
M,CLP.S$R-SL ;&]N9R!I;G0Z=#,]<C$[+3(Q-#<T.#,V-#@[,C$T-S0X,S8T
|
||||||
|
M-SL =6YS:6=N960@:6YT.G0T/7(Q.S [+3$[ &QO;F<@=6YS:6=N960@:6YT
|
||||||
|
M.G0U/7(Q.S [+3$[ &QO;F<@;&]N9R!I;G0Z=#8]<C$[,#$P,# P,# P,# P
|
||||||
|
M,# P,# P,# P,# [,#<W-S<W-S<W-S<W-S<W-S<W-S<W-SL ;&]N9R!L;VYG
|
||||||
|
M('5N<VEG;F5D(&EN=#IT-SUR,3LP,# P,# P,# P,# P.S Q-S<W-S<W-S<W
|
||||||
|
M-S<W-S<W-S<W-S<W.P!S:&]R="!I;G0Z=#@]<C$[+3,R-S8X.S,R-S8W.P!S
|
||||||
|
M:&]R="!U;G-I9VYE9"!I;G0Z=#D]<C$[,#LV-34S-3L <VEG;F5D(&-H87(Z
|
||||||
|
M=#$P/7(Q.RTQ,C@[,3(W.P!U;G-I9VYE9"!C:&%R.G0Q,3UR,3LP.S(U-3L
|
||||||
|
M9FQO870Z=#$R/7(Q.S0[,#L 9&]U8FQE.G0Q,SUR,3LX.S [ &QO;F<@9&]U
|
||||||
|
M8FQE.G0Q-#UR,3LX.S [ &-O;7!L97@@:6YT.G0Q-3US.')E86PZ,2PP+#,R
|
||||||
|
M.VEM86<Z,2PS,BPS,CL[ &-O;7!L97@@9FQO870Z=#$V/7(Q-CLT.S [ &-O
|
||||||
|
M;7!L97@@9&]U8FQE.G0Q-SUR,3<[.#LP.P!C;VUP;&5X(&QO;F<@9&]U8FQE
|
||||||
|
M.G0Q.#UR,3@[.#LP.P!V;VED.G0Q.3TQ.0!A<F-H7W1Y<&4Z5#(P/65!4D-(
|
||||||
|
M7S,R0DE4.C L05)#2%\V-$))5#HQ+#L <F5G7V-L87-S.E0R,3UE3D]?4D5'
|
||||||
|
M4SHP+$=%3D5204Q?4D5'4SHQ+$907U)%1U,Z,BQ!3$Q?4D5'4SHS+$Q)35]2
|
||||||
|
M14=?0TQ!4U-%4SHT+#L ;6%C:&EN95]M;V1E.E0R,CUE5D])1&UO9&4Z,"Q1
|
||||||
|
M26UO9&4Z,2Q(26UO9&4Z,BQ04TEM;V1E.C,L4TEM;V1E.C0L4$1);6]D93HU
|
||||||
|
M+$1);6]D93HV+%1);6]D93HW+$]);6]D93HX+%%&;6]D93HY+$A&;6]D93HQ
|
||||||
|
M,"Q4449M;V1E.C$Q+%-&;6]D93HQ,BQ$1FUO9&4Z,3,L6$9M;V1E.C$T+%1&
|
||||||
|
M;6]D93HQ-2Q30VUO9&4Z,38L1$-M;V1E.C$W+%A#;6]D93HQ."Q40VUO9&4Z
|
||||||
|
M,3DL0U%);6]D93HR,"Q#2$EM;V1E.C(Q+$-326UO9&4Z,C(L0T1);6]D93HR
|
||||||
|
M,RQ#5$EM;V1E.C(T+$-/26UO9&4Z,C4L0DQ+;6]D93HR-BQ#0VUO9&4Z,C<L
|
||||||
|
M0T-8;6]D93HR."Q#0U].3T]6;6]D93HR.2Q#0UA?3D]/5FUO9&4Z,S L0T-&
|
||||||
|
M4&UO9&4Z,S$L0T-&4$5M;V1E.C,R+$U!6%]-04-(24Y%7TU/1$4Z,S,L.P!M
|
||||||
|
M;V1E7V-L87-S.E0R,SUE34]$15]204Y$3TTZ,"Q-3T1%7TE.5#HQ+$U/1$5?
|
||||||
|
M1DQ/050Z,BQ-3T1%7U!!4E1)04Q?24Y4.C,L34]$15]#0SHT+$U/1$5?0T]-
|
||||||
|
M4$Q%6%])3E0Z-2Q-3T1%7T-/35!,15A?1DQ/050Z-BQ-05A?34]$15]#3$%3
|
||||||
|
M4SHW+#L <'1R9&EF9E]T.G0Q '-I>F5?=#IT- !W8VAA<E]T.G0S %51271Y
|
||||||
|
M<&4Z=#$Q %-)='EP93IT,0!54TET>7!E.G0T $1)='EP93IT-@!51$ET>7!E
|
||||||
|
M.G0W %-&='EP93IT,3( 1$9T>7!E.G0Q,P!W;W)D7W1Y<&4Z=#$ 1$ES=')U
|
||||||
|
M8W0Z5#(T/7,X:&EG:#HQ+# L,S([;&]W.C$L,S(L,S([.P!$275N:6]N.G0R
|
||||||
|
M-3UU.',Z,C0L,"PV-#ML;#HV+# L-C0[.P!F=6YC7W!T<CIT,C8]*C(W/68Q
|
||||||
|
M.0!?7V1O7V=L;V)A;%]D=&]R<SI&,3D
|
||||||
|
M $ ! @ ! -0 #4 $0
|
||||||
|
M 0 ) !0 ( 0#H Z FP #
|
||||||
|
M 0 $ #P L " $#5 U0 5@ ! !H $
|
||||||
|
M $ !< # @ !"+0 BT ")0 0
|
||||||
|
M ? ! ( 0K< *W %0 # $0 0 , *0
|
||||||
|
M 0 " $+, "S #D P \ $ # #, !
|
||||||
|
M!@ !#!0 P4 '- ! Y 0 8 1-(
|
||||||
|
M 32 )@ 0 /P $ & $3X $^
|
||||||
|
M , $ $4 ! !@ !$^P !/L "
|
||||||
|
M ! !, 0 8 1/T 3] @
|
||||||
|
M 0 4P $ " $4 % -+ (
|
||||||
|
M %L ! P "%TP !=, ! ! 0
|
||||||
|
M !@ !@ , A=0 74 (@ $ 0 ( :0
|
||||||
|
M $ ' (7V %]@ $8 $ # &X !
|
||||||
|
M P "&/ !CP % ! !T " , AD(
|
||||||
|
M 9" \ @ >0 ( &0@
|
||||||
|
M 90 $P "D $ $ ($ # !]8 "XP
|
||||||
|
M 0 ") 0 B/ $@
|
||||||
|
M 0 , E0 $ (H0 $; !
|
||||||
|
M )X ! ".@ !^ ! P
|
||||||
|
M "D P EF ,8 $ K@
|
||||||
|
M , )EX "; ! +T #
|
||||||
|
= ";Y &'P 0 !
|
||||||
|
|
||||||
|
end
|
||||||
111
c/build-tools/os/msdos/fixtimer.c
Normal file
111
c/build-tools/os/msdos/fixtimer.c
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <dos.h>
|
||||||
|
|
||||||
|
#define IO_RTC 0x70 /* RTC */
|
||||||
|
|
||||||
|
#define RTC_SEC 0x00 /* seconds */
|
||||||
|
#define RTC_MIN 0x02 /* minutes */
|
||||||
|
#define RTC_HRS 0x04 /* hours */
|
||||||
|
#define RTC_WDAY 0x06 /* week day */
|
||||||
|
#define RTC_DAY 0x07 /* day of month */
|
||||||
|
#define RTC_MONTH 0x08 /* month of year */
|
||||||
|
#define RTC_YEAR 0x09 /* month of year */
|
||||||
|
#define RTC_STATUSA 0x0a /* status register A */
|
||||||
|
#define RTCSA_TUP 0x80 /* time update, don't look now */
|
||||||
|
|
||||||
|
#define RTC_STATUSB 0x0b /* status register B */
|
||||||
|
|
||||||
|
#define RTC_DIAG 0x0e /* status register E - bios diagnostic */
|
||||||
|
#define RTCDG_BITS "\020\010clock_battery\007ROM_cksum\006config_unit\005memory_size\004fixed_disk\003invalid_time"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* convert 2 digit BCD number */
|
||||||
|
static int bcd( unsigned int i )
|
||||||
|
{
|
||||||
|
return ((i/16)*10 + (i%16));
|
||||||
|
}
|
||||||
|
|
||||||
|
static unsigned int rtcin( unsigned int what )
|
||||||
|
{
|
||||||
|
outportb( IO_RTC, what );
|
||||||
|
return inportb( IO_RTC+1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void fix_date( void )
|
||||||
|
{
|
||||||
|
int s;
|
||||||
|
struct date date;
|
||||||
|
struct time time;
|
||||||
|
|
||||||
|
/* initialize brain-dead battery powered clock */
|
||||||
|
outportb( IO_RTC, RTC_STATUSA );
|
||||||
|
outportb( IO_RTC+1, 0x26 );
|
||||||
|
outportb( IO_RTC, RTC_STATUSB );
|
||||||
|
outportb( IO_RTC+1, 2 );
|
||||||
|
|
||||||
|
outportb( IO_RTC, RTC_DIAG );
|
||||||
|
s = inportb( IO_RTC+1 );
|
||||||
|
if (s) printf("RTC BIOS diagnostic error %b\n", s, RTCDG_BITS);
|
||||||
|
|
||||||
|
/* check for presence of clock */
|
||||||
|
s = rtcin(RTC_STATUSA);
|
||||||
|
if ( s == 0xff || s == 0 ) {
|
||||||
|
printf( "Real-time clock not found\n" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ready for a read? */
|
||||||
|
while ((s & RTCSA_TUP) == RTCSA_TUP)
|
||||||
|
s = rtcin(RTC_STATUSA);
|
||||||
|
|
||||||
|
date.da_year = bcd(rtcin(RTC_YEAR)) + 1900; /* year */
|
||||||
|
if ( date.da_year < 1970) date.da_year += 100;
|
||||||
|
date.da_year -= 1980;
|
||||||
|
date.da_mon = bcd(rtcin(RTC_MONTH)); /* month */
|
||||||
|
date.da_day = bcd(rtcin(RTC_DAY)); /* day */
|
||||||
|
|
||||||
|
(void)bcd(rtcin(RTC_WDAY)); /* weekday */
|
||||||
|
|
||||||
|
time.ti_hour = bcd(rtcin(RTC_HRS)); /* hour */
|
||||||
|
time.ti_min = bcd(rtcin(RTC_MIN)); /* minutes */
|
||||||
|
time.ti_sec = bcd(rtcin(RTC_SEC)); /* seconds */
|
||||||
|
time.ti_hund = 0;
|
||||||
|
|
||||||
|
setdate( & date );
|
||||||
|
settime( & time );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void fix_timer( void )
|
||||||
|
{
|
||||||
|
#define PIT_PORT 0x40
|
||||||
|
#define TIMER_CNTR0 (PIT_PORT + 0) /* timer 0 counter port */
|
||||||
|
#define TIMER_MODE (PIT_PORT + 3) /* timer mode port */
|
||||||
|
#define TIMER_SEL0 0x00 /* select counter 0 */
|
||||||
|
#define TIMER_RATEGEN 0x04 /* mode 2, rate generator */
|
||||||
|
#define TIMER_16BIT 0x30 /* r/w counter 16 bits, LSB first */
|
||||||
|
|
||||||
|
/* set timer 0 to generate interrupts every period */
|
||||||
|
outportb( TIMER_MODE, TIMER_SEL0|TIMER_RATEGEN|TIMER_16BIT );
|
||||||
|
outportb( TIMER_CNTR0, 0 ); /* counter low */
|
||||||
|
outportb( TIMER_CNTR0, 0 ); /* counter high */
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
/* Make timer count at correct pace */
|
||||||
|
fix_timer();
|
||||||
|
|
||||||
|
/* Fix the date */
|
||||||
|
fix_date();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
162
c/build-tools/os/msdos/fixtimer.uue
Normal file
162
c/build-tools/os/msdos/fixtimer.uue
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
begin 664 fixtimer.exe
|
||||||
|
M35IF 0X 0 @ T __^; 8 (@ $ ^R!R:@$
|
||||||
|
M
|
||||||
|
M
|
||||||
|
M
|
||||||
|
M
|
||||||
|
M
|
||||||
|
M
|
||||||
|
M
|
||||||
|
M
|
||||||
|
M
|
||||||
|
M
|
||||||
|
M "Z3 $NB1;X ;0PS2&++@( BQXL ([:HY( C :0
|
||||||
|
M (D>C ")+JP QP:6 /__Z#0!Q#Z* (O'B]BY_W\F@3TX-W49)HM5 H#Z/740
|
||||||
|
M@.;?_P:6 (#^674$_P:6 /*NXV%#)C@%==: S8#WV8D.B@"Y 0#3XX/#"(/C
|
||||||
|
M^(D>C@",VBOJBSY\ H'_ )S![\ HD^? *!Q^P$<B@#/GH"<B*Q!-/O1SOO
|
||||||
|
M<AF#/GP" '0'@SYZ @!U#K\ $#OO=P>+_>L#Z2$!B]\#VHD>I ")'J@ H9
|
||||||
|
M*]B.P+1*5\TA7]/G^H[2B^?[,\ NC@;X ;^F!+GL!"O/\ZH._Q:8!.BU NB=
|
||||||
|
M [0 S1J)%I@ B0Z: /\6G 3_-H@ _S:& /\VA #H%P)0Z%H"+HX>^ 'H? .
|
||||||
|
M_Q::!#/ B_"Y+P"0_ ($@-0 1N+X+3<-D'0*N1D D+HO .B+ (OLM$R*1@+-
|
||||||
|
M(;D. )"Z2 #IAP >N US2&)'G0 C 9V +@$-<TAB1YX (P&>@"X!37-(8D>
|
||||||
|
M? ",!GX N 8US2&)'H C :" +@ )8S*CMJZ6 '-(1_#'K@ )<46= #-(1\>
|
||||||
|
MN 0EQ19X ,TA'QZX!27%%GP S2$?'K@&)<46@ #-(1_#QP:6 R\.T0+L"
|
||||||
|
M ,TAP[D> )"Z5@ NCA[X >CI_[@# %#H*?\ %6+[(M&!+$$T^BZ"@#WXHM6
|
||||||
|
M!('B#P #PNL 7<-5B^R*1@3F<.1QM #K %W#58OL@^P(5K *YG"P)N9QL OF
|
||||||
|
M<+ "YG&P#N9PY'&T (OP"_9T#[BR 5!6N)0!4.B<"8/$!K@* %#HM?]9B_"!
|
||||||
|
M_O\ = 0+]G4+N/P!4.A^"5GIJ0#K"K@* %#HE/]9B_"+QB6 #V '3LN D
|
||||||
|
M4.B _UE0Z%__605L!XE&^(%^^+('?02#1OAD@6[XO >X" !0Z%W_65#H//]9
|
||||||
|
MB$;[N < 4.A-_UE0Z"S_68A&^K@& %#H/?]94.@<_UFX! !0Z##_65#H#_]9
|
||||||
|
MB$;]N ( 4.@@_UE0Z/_^68A&_#/ 4.@1_UE0Z/#^68A&_\9&_@"-1OA0Z'H1
|
||||||
|
M68U&_%#HA1%97HOE7<.P-.9#L #F0+ YD##Z/#_Z.S^,\#K ,-5B^Q6BW8$
|
||||||
|
M"_9\%(/^6'8#OE< B388 HJ$&@*8ENL-]]Z#_B-WZL<&& +__XO&HY0 N/__
|
||||||
|
MZP!>7<(" ,-5B^SK"HL>?@+1X_^7I@2A?@+_#GX""\!UZ_\6= +_%G8"_Q9X
|
||||||
|
M O]V!.AZ_5E=PP "Z/!JH#+HP>K /\C@:0 +Z #+D)JQ C,6'UI.+
|
||||||
|
M-HH @\8"N0$ @#Z2 -R$8X&C "+_K%_,L#RKN-V@/%_@^P"N $ \,#P27^
|
||||||
|
M_XO\*_AR8(OGC,".V(S0CL!12?.D,L"JCMV'\H?9B\.+T$/H&0!W!W) Z!(
|
||||||
|
M=_D\('0(/ UT!#P)=>@RP.OD"\!T!T*J"L!U 4.&X#+ ^>,5K$DL(G0/!"(\
|
||||||
|
M7'4'@#PB=0*L20OVP^E^_5D#RBZ.'JP#B1Z$ $,#VXOTB^PKZW+FB^6)+H8
|
||||||
|
MXPZ)=@"#Q0(VK K X/IT\#/ B48 +O\FJ@.+#HH 4>A' 5F+^ O ="0>'@>.
|
||||||
|
M'HP ,_;\\Z0?B_@&_S:. .@I 8/$ HO8!Z.( O =0/I$?TSP+G__XD_@\,"
|
||||||
|
M\JXF. 5U](D'PU6+[(,^?@(@=06X 0#K%8M&!(L>?@+1XXF'I@3_!GX",\#K
|
||||||
|
M %W#58OL5E>+?@2+10:CZ 0[QW4(QP;H! ZQ"+=02+'N@$B7<$H>@$B40&
|
||||||
|
M7UY=PU6+[%97BWX$BT8&*06+-0/WBT8&0(D$B7P"H>8$.\=U!HDVY@3K"(O^
|
||||||
|
M WX&B74"B\8%! #K %]>7<-5B^Q6BT8$,](E__^!X@ 4E#H] !968OP@_[_
|
||||||
|
M=00SP.L8H>8$B40"BT8$0(D$B3;F!*'F! 4$ .L 7EW#58OL5HM&!#/2)?__
|
||||||
|
M@>( %)0Z+< 65F+\(/^_W4$,\#K%8DVZ@2)-N8$BT8$0(D$B\8%! #K %Y=
|
||||||
|
MPU6+[%97BWX$"_]U!#/ ZUJ+QP4+ "7X_XOX@S[J! !U!U?HH?]9ZT*+-N@$
|
||||||
|
MB\8+P'0QBP2+UX/"*#O"<@E75N@-_UE9ZR2+!#O'<@Y6Z-'^6?\$B\8%! #K
|
||||||
|
M$(MT!CLVZ 1USU?H(O]9ZP!?7EW#58OLBT8$B]2!Z@ !.\)S!Z.> #/ ZPO'
|
||||||
|
M!I0 " "X___K %W#58OLBT8$BU8& P:> (/2 (O(@<$ 8/2 O2=0H[S',&
|
||||||
|
MAP:> .L+QP:4 @ N/__ZP!=PU6+[/]V!.B?_UGK %W#58OLBT8$F5)0Z++_
|
||||||
|
MB^7K %W#58OL@^P"5E>+7@2+-XO&B4;^BUX$]T<"0 !T!(O&ZQ^+7@2+?PKK
|
||||||
|
M"XO?1X _"G4#_T;^B\9."\!U[HM&_NL 7UZ+Y5W" @!5B^Q6BW8$5NA3!%D+
|
||||||
|
MP'0%N/__ZTR#?@H!=1"#/ !^"U;HE?^9*48&&58(@60"7_['! BT0(B40*
|
||||||
|
M_W8*_W8(_W8&BD0$F%#HW *#Q B#^O]U"CW__W4%N/__ZP(SP.L 7EW#58OL
|
||||||
|
M@^P$5HMV!%;H[ -9"\!T"+K__[C__^L_N $ 4#/ 4%"*1 284.B8 H/$"(E6
|
||||||
|
M_HE&_(,\ 'X9BU;^BT;\4E!6Z!#_F8O8B\I86BO#&]'K!HM6_HM&_.L 7HOE
|
||||||
|
M7<-5B^RX $2+7@3-(;@ '($T>+1T.L 7<-5B^Q65XM^"HMV!(M$#CO&=0R#
|
||||||
|
M?@@"?P:!__]_=@:X___IJ@"#/NH# '4/N) ".\9U",<&Z@,! .L4@S[H P!U
|
||||||
|
M#;B CO&=0;'!N@# 0"#/ !T#[@! % SP%!05NC&_H/$"/=$ @0 = ?_= CH
|
||||||
|
M"PQ9@60"\__'1 8 (O&!04 B40(B40*@WX( G0_"_]V.\<&= +$"(-^!@!U
|
||||||
|
M&%?H6?U9B48&"\!T!X%, @0 ZP6X___K&XM&!HE$"HE$"(E\!H-^" %U!8%,
|
||||||
|
M @@ ,\#K %]>7<-65[\$ +Z NL0]T0" P!T!5;HG )93X/&$ O_=>Q?7L-5
|
||||||
|
MB^R![(H 5E>+1@A /0( <P4SP.GV (M>!-'C]X? P" =!+_=@C_=@;_=@3H
|
||||||
|
MXP"#Q ;IUP"+7@31XX&GP /__8M&!HF&?/^+1@B)AGC_C;9^_^MM_XYX_XN>
|
||||||
|
M?/__AGS_B@>(AGO_/ IU!,8$#4:*AGO_B 1&C89^_XO6*]"!^H ?#Z-AG[_
|
||||||
|
MB_XK^%>-AG[_4/]V!.A[ (/$!HF&=O\[QW0;@[YV_P!S!;C__^L-BT8(*X9X
|
||||||
|
M_P.&=O\KQ^M/C;9^_X.^>/\ = /IB?^-AG[_B_XK^(O'"\!V+E>-AG[_4/]V
|
||||||
|
M!.@M (/$!HF&=O\[QW07@[YV_P!S!;C__^L)BT8( X9V_RO'ZP6+1@CK %]>
|
||||||
|
MB^5=PU6+[(M>!-'C]X? P (=!"X @!0,\!04/]V!.@H (OEM$"+7@2+3@B+
|
||||||
|
M5@;-(7(/4(M>!-'C@8_ P 06.L&4.@%^>L 7<-5B^R+7@31XX&GP /__;1"
|
||||||
|
MBD8*BUX$BTX(BU8&S2%R NL'4.C;^)GK %W#58OL@^PB5E<&BWX*'@>+7@B#
|
||||||
|
M^R1W6(#[ G)3BT8,BTX."\E]$8!^!@!T"\8%+4?WV??8@]D C7;>XP^1*]+W
|
||||||
|
M\Y'W\X@41N,)Z_$KTO?SB!1&"\!U]8U.WO?9 \[\3HH$+ IS! 0ZZP,"1@2J
|
||||||
|
MXN^P *H'BT8*ZP!?7HOE7<(, %6+[(-^" IU!HM&!)GK!8M&!#/24E#_=@;_
|
||||||
|
M=@BP 5"P85#H7/_K %W#58OL_W8&_W8$_W8(_W8*L !0L&%0Z$#_ZP!=PU6+
|
||||||
|
M[/]V!O]V!/]V"/]V"H-^"@IU!;@! .L",\!0L&%0Z!G_ZP!=P[KL ^L#NO$#
|
||||||
|
MN04 D+1 NP( S2&Y)P"0NO8#M$#-(>EM]E6+[%97BW8$BT0..\9T!;C__^MF
|
||||||
|
M@SP ?"WW1 (( '4,BT0*B]:#P@4[PG46QP0 (M$"HO6@\(%.\)U!HM$"(E$
|
||||||
|
M"C/ ZS2+? 8#/$<I/%>+1 B)1 I0BD0$F%#H$OV#Q 8[QW01]T0" )U"H%,
|
||||||
|
M A N/__ZP0SP.L 7UY=PU6+[+AK#5"XD )0_W8$C48&4.A, NL 7<-5B^R+
|
||||||
|
M7@;_#_]V!HI&!)A0Z 8 B^7K %W#58OL@^P"5HMV!HI&!(A&__\$?3:*1O__
|
||||||
|
M1 J+7 J(1__W1 (( '0;@'[_"G0&@'[_#74/5N@9_UD+P'0&N/__Z>D BD;_
|
||||||
|
MM #IX0#_#/=$ I =0?W1 (" '4+@4P"$ "X___IQ@"!3 ( 8-\!@!T)H,\
|
||||||
|
M '015NC7_ED+P'0&N/__Z:< ZPJX__^+5 8KPHD$Z7W_Z94 @S[J P!U.;B0
|
||||||
|
M CO&=3**1 284.@)^UD+P'4%@60"__VX )0]T0" )T!;@" .L",\!0,\!0
|
||||||
|
M5NC]^H/$".F/_X!^_PIU'_=$ D =1BX 0!0N!X$4(I$!)A0Z.#\@\0&/0$
|
||||||
|
M=1BX 0!0C48$4(I$!)A0Z,C\@\0&/0$ =!'W1 ( G4*@4P"$ "X___K!XI&
|
||||||
|
M_[0 ZP!>B^5=PU6+[%:+=@2XD )05NC!_EE9ZP!>7<-5B^R#[ )65XMV!(M^
|
||||||
|
M!D?W1 (( '0CZP+K $^+QPO =!56BUX(_T8(B@>84.B+_EE9/?__=>+I=0#W
|
||||||
|
M1 ) '0W@WP& '0QBT0&.\=S*H,\ '0-5NBT_5D+P'0$,\#K4T]7_W8(BD0$
|
||||||
|
MF%#H(?R#Q :)1OXK?O[K-^L"ZP!/B\<+P'0L_P1]%8M>"/]&"(H'_T0*BUP*
|
||||||
|
MB$?_M #K#E:+7@C_1@C_-^CZ_5E9/?__=<N+Q^L 7UZ+Y5W"!@#_)IX$58OL
|
||||||
|
MBU8$N00/NR<$_(K&TNC7JHK&(L77JHK"TNC7JHK"(L77JNL 7<(" %6+[('L
|
||||||
|
ME@!65\=&J@ QD:M4.LX5[G__S+ \J[WT4E?PX@%1_Y.K7XB4U%2!HU&KBOX
|
||||||
|
MC4:N4%?_=@C_5@K&1JU0 7ZJC7ZN!UI96\,&_(U^KHF^;/^+OFS_BW8&K K
|
||||||
|
M=!$\)700B 5'_DZM?^_HN?_KZNEU!(FV>/^L/"5TYXF^;/\SR8F.=O^)CFK_
|
||||||
|
MB(YU_\>&</___\>&<O___^L!K#+DB]"+V(#K((#[8'-'BI\W!(O#/1< =@/I
|
||||||
|
M'02+V-'C+O^G& ]C#TL/I ]7#\D/TP\5$!\0+Q"*#V00/Q!#$$<0Z1";$3P1
|
||||||
|
M7!'_$BP3+!,L$W8/@ _IX0. _0!W^(..:O\!ZYN _0!W[(..:O\"ZX^ _0!W
|
||||||
|
MX("^=?\K= 2(EG7_Z7S_@Z9J_]^U!>ER_X..:O\@M07I:/^ _0!W1/>&:O\"
|
||||||
|
M '4A@XYJ_PBU >E1_^F( XM^!(L%@T8$ H#] G,)B89P_[4#Z3?_@/T$=>&)
|
||||||
|
MAG+__L7I*?^ _01ST[4$Z1__DBPPF(#] G<;M0*'AG#_"\!\TM'@B]#1X-'@
|
||||||
|
M \(!AG#_Z?O^@/T$=:6'AG+_"\!\M-'@B]#1X-'@ \(!AG+_Z=W^@XYJ_Q"U
|
||||||
|
M!>G3_H&.:O\ 8.F:O_OM07IP_Z#IFK_[X&.:O^ +4%Z;/^MPCK"K<*ZPNW
|
||||||
|
M$+/I MK&AG7_ ,:&;_\ B)9N_XM^!(L%,]+K$;<*QH9O_P&(EF[_BWX$BP69
|
||||||
|
M1T>)=@;WAFK_$ !T!(L51T>)?@2-OGO_"\!U,PO2=2^#OG+_ '4MB[YL_XN.
|
||||||
|
M</_C&X/Y_W06BX9J_R4( '0$LC#K K(@BL+HMOWB^>GI_8..:O\$4E!7BL>8
|
||||||
|
M4(J&;_]04^B0^18'BY9R_PO2?P/I% 'I(0&(EF[_B78&C;YZ_XM>!/\W0T.)
|
||||||
|
M7@3WAFK_( !T#_\W0T.)7@06!^@7_; ZJA8'Z _]Q@4 QH9O_P"#IFK_^XV.
|
||||||
|
M>O\K^8?/BY9R_SO1?P*+T>F^ (EV!HB6;O^+?@2+!8-&! (6!XV^>_\RY(D%
|
||||||
|
MN0$ Z=@ B78&B)9N_XM^!/>&:O\@ '4,BSV#1@0"'@<+_^L*Q#V#1@0$C, +
|
||||||
|
MQW4%'@>_( 3HVOP[CG+_=@2+CG+_Z9D B78&B)9N_XM^!(N.<O\+R7T#N08
|
||||||
|
M5U&-GGO_4U*X 0 CAFK_4(N&:O^I@ !T"K@" ,=&_@0 ZQ>I %T"K@( ,=&
|
||||||
|
M_@H ZPC'1OX( +@& %#H-_R+1OX!1@06!XV^>__WAFK_" !T$XN6</\+TGX+
|
||||||
|
MZ%O\*]%^!(F6=O^*AG7_"L!T%": /2UT#H.N=O\!@Y9V_P!/)H@%Z#3\B_>+
|
||||||
|
MOFS_BYYP_[@% ".&:O\]!0!U%HJF;O^ _&]U$(.^=O\ ?P;'AG;_ 0#K'Y"
|
||||||
|
M_'AT!8#\6'44@XYJ_T!+2X.N=O\"?0;'AG;_ #CG;_]X9J_P( =0SK!K @
|
||||||
|
MZ.'[2SO9?_;WAFK_0 !T#+ PZ,_[BH9N_^C(^XN6=O\+TGXG*\HKVB:*!#PM
|
||||||
|
M= @\('0$/"MU!R:LZ*C[24N'RN,'L##HG?OB^8?*XQ$KV2:LB 5'_DZM?P/H
|
||||||
|
MD/OB\0O;?@F+R[ @Z'O[XOGIKON)=@:+?@3WAFK_( !U"HL]@T8$ AX'ZP;$
|
||||||
|
M/8-&! 2X4 J1JT#1JHFB07I??N+MGC_B[YL_[ EZ#S[K K =?B ?JU0?0/H
|
||||||
|
M-OL'BT:JZP!?7HOE7<(( %6+[%97BW8$@S[H! !T'(L>Z 2+?P:+'N@$B7<&
|
||||||
|
MB74$B7P&H>@$B40$ZPJ)-N@$B70$B70&7UY=PU6+[(/L E97BW8&BWX$BP0!
|
||||||
|
M!:'F!#O&=0:)/N8$ZPV+! /&B4;^BU[^B7\"5NA-\5E?7HOE7<-6H>H$.P;F
|
||||||
|
M!'42_S;J!.C:\EDSP*/F!*/J!.L[BQ[F!(MW O<$ 0!U(E;H&?%9.S;J!'4*
|
||||||
|
M,\"CY@2CZ@3K!HM$ J/F!%;HH_)9ZPS_-N8$Z)GR68DVY@1>PU6+[(/L E97
|
||||||
|
MBW8$_PR+! /&B4;^BWP"]P4! '44.S;J!'0.BP0!!8M>_HE_ HOWZP56Z +_
|
||||||
|
M68M>_O<' 0!U"?]V_E;H*O]965]>B^5=PU6+[%:+=@0+]G4"ZQ>+Q@7\_XOP
|
||||||
|
M.S;F!'4%Z#S_ZP56Z(__65Y=PU6+[%:T*XMV!(L,BU0"S2%>7<-5B^Q6M"V+
|
||||||
|
M=@2+#(M4 LTA7EW# !4=7)B;RU#("T@0V]P>7)I9VAT("AC
|
||||||
|
M*2 Q.3@X($)O<FQA;F0@26YT;"X 3G5L;"!P;VEN=&5R(&%S<VEG;FUE;G0-
|
||||||
|
M"D1I=FED92!E<G)O<@T*06)N;W)M86P@<')O9W)A;2!T97)M:6YA=&EO;@T*
|
||||||
|
M .P$[ 3L
|
||||||
|
M!
|
||||||
|
M
|
||||||
|
M
|
||||||
|
M
|
||||||
|
M
|
||||||
|
M 4E1#($))3U,@9&EA9VYO<W1I8R!E<G)O<B E
|
||||||
|
M8@H $ AC;&]C:U]B871T97)Y!U)/35]C:W-U;09C;VYF:6=?=6YI= 5M96UO
|
||||||
|
M<GE?<VEZ901F:7AE9%]D:7-K VEN=F%L:61?=&EM90!296%L+71I;64@8VQO
|
||||||
|
M8VL@;F]T(&9O=6YD"@ $P("! 4&" @(%!4%$_\6!1$"____________
|
||||||
|
M_____P4%_____________________P__(P+_#_____\3__\" @4/ O___Q/_
|
||||||
|
M_________R/_____(_\3_P!Z WH#>@, 0 D" ( "
|
||||||
|
M * @$ "0 @ @(" H ( $," P
|
||||||
|
M + " !" @0 # @ #_ T ( _P
|
||||||
|
M . " /\ #P @ #_ , _P
|
||||||
|
M ! # /\ @ P #_ , ,
|
||||||
|
M_P $ # /\ !0 P #_ 8 ,
|
||||||
|
M _P ' # /\ " P #_
|
||||||
|
MD , _P * # /\ "P P$@ B "( 2@ J#_
|
||||||
|
M______________________________________\ <')I;G0@<V-A;F8@
|
||||||
|
M.B!F;&]A=&EN9R!P;VEN="!F;W)M871S(&YO="!L:6YK960-"@ - "AN=6QL
|
||||||
|
M*0 P,3(S-#4V-S@Y04)#1$5& !04 105%!04% ( % ,$% D%!04%!04%!044
|
||||||
|
M%!04%!04%!04% \7#P@4%!0'%!84%!04%!04%!0-%!04%!04%!04%! *#P\/
|
||||||
|
G" H4% 84$@L.%!01% P4% T4%!04%!04 -(!T@'9 50+60M9"UD+
|
||||||
|
|
||||||
|
end
|
||||||
331
c/build-tools/os/msdos/ifc.c
Normal file
331
c/build-tools/os/msdos/ifc.c
Normal file
@@ -0,0 +1,331 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <process.h>
|
||||||
|
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
|
void * xmalloc( int size )
|
||||||
|
{
|
||||||
|
void * p = (void *)malloc( size );
|
||||||
|
if ( !p ) {
|
||||||
|
fprintf( stderr, "out of memory\n" );
|
||||||
|
exit( 1 );
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
void * xrealloc( void * old, int size )
|
||||||
|
{
|
||||||
|
void * p = (void *)realloc( old, size );
|
||||||
|
if ( !p ) {
|
||||||
|
fprintf( stderr, "out of memory\n" );
|
||||||
|
exit( 1 );
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
char ** argv_fix( int * argc, char ** argv )
|
||||||
|
{
|
||||||
|
char ** new = NULL;
|
||||||
|
int max = 20;
|
||||||
|
int cnt = 0;
|
||||||
|
int j;
|
||||||
|
|
||||||
|
for ( j = 1; argv[j]; ++j )
|
||||||
|
if ( argv[j][0] == '@' && access(argv[j]+1,0)==0 )
|
||||||
|
break;
|
||||||
|
if ( argv[j] == NULL )
|
||||||
|
return argv;
|
||||||
|
|
||||||
|
new = (char **)xmalloc( max * sizeof *new );
|
||||||
|
new[cnt++] = *argv++;
|
||||||
|
for ( ; *argv; ++argv ) {
|
||||||
|
if ( cnt >= max )
|
||||||
|
new = (char **)realloc( new, (max*=2) * sizeof *new );
|
||||||
|
|
||||||
|
if ( argv[0][0] != '@' || access(argv[0]+1,0) ) {
|
||||||
|
new[cnt++] = *argv;
|
||||||
|
} else {
|
||||||
|
char line[ 1000 ];
|
||||||
|
FILE * f = fopen( argv[0]+1, "r" );
|
||||||
|
if ( !f ) {
|
||||||
|
perror( argv[0]+1 );
|
||||||
|
exit( 2 );
|
||||||
|
}
|
||||||
|
while ( fgets( line, sizeof line, f ) ) {
|
||||||
|
int len = strlen( line );
|
||||||
|
/* delete trailing newlines */
|
||||||
|
while ( line[len-1] == '\n' || line[len-1] == '\r' )
|
||||||
|
line[--len] = '\0';
|
||||||
|
if ( cnt >= max )
|
||||||
|
new = (char **)xrealloc( new, (max*=2) * sizeof *new );
|
||||||
|
new[cnt] = (char *)xmalloc( len+1 );
|
||||||
|
strcpy( new[cnt], line );
|
||||||
|
++cnt;
|
||||||
|
}
|
||||||
|
fclose( f );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( cnt >= max )
|
||||||
|
new = (char **)xrealloc( new, (max+1) * sizeof *new );
|
||||||
|
new[cnt] = NULL;
|
||||||
|
*argc = cnt;
|
||||||
|
return new;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const char * USAGE =
|
||||||
|
"usage: $progname [ -cNvmV ] file [ file ... ] dest-directory-or-file\n"
|
||||||
|
" -v -- verbose\n"
|
||||||
|
" -V suffix -- suffix to append to targets (before any . suffix)\n"
|
||||||
|
" eg: -V _g would change 'foo' to 'foo_g' and\n"
|
||||||
|
" 'libfoo.a' to 'libfoo_g.a'\n"
|
||||||
|
" -m mode -- mode for new file(s)\n"
|
||||||
|
" -c -- copy instead of move (always on)\n"
|
||||||
|
" -N -- copy only if source is newer than target\n"
|
||||||
|
;
|
||||||
|
|
||||||
|
void fatal( char * msg )
|
||||||
|
{
|
||||||
|
if ( msg )
|
||||||
|
fprintf( stderr, "%s\n", msg );
|
||||||
|
fprintf( stderr, "%s", USAGE );
|
||||||
|
exit( 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
char * basename( char * f )
|
||||||
|
{
|
||||||
|
char * b = strrchr( f, '/' );
|
||||||
|
if ( b ) ++b;
|
||||||
|
else b = f;
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <sys/stat.h>
|
||||||
|
int is_dir( char * path )
|
||||||
|
{
|
||||||
|
struct stat buf;
|
||||||
|
if ( stat( path, &buf ) )
|
||||||
|
return 0;
|
||||||
|
return buf.st_mode & S_IFDIR;
|
||||||
|
}
|
||||||
|
int is_file( char * path )
|
||||||
|
{
|
||||||
|
struct stat buf;
|
||||||
|
if ( stat( path, &buf ) )
|
||||||
|
return 0;
|
||||||
|
return buf.st_mode & S_IFREG;
|
||||||
|
}
|
||||||
|
int newer( char * p1, char * p2 )
|
||||||
|
{
|
||||||
|
struct stat buf1;
|
||||||
|
struct stat buf2;
|
||||||
|
if ( stat( p1, &buf1 ) )
|
||||||
|
return 0;
|
||||||
|
if ( stat( p2, &buf2 ) )
|
||||||
|
return 0;
|
||||||
|
return buf1.st_mtime > buf2.st_mtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
int filecopy( char * d, char * s, int preserve_time )
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
int status;
|
||||||
|
char * argv[ 5 ];
|
||||||
|
argv[0] = "cp";
|
||||||
|
argv[1] = "-p";
|
||||||
|
argv[2] = s;
|
||||||
|
argv[3] = d;
|
||||||
|
argv[4] = NULL;
|
||||||
|
status = spawnvp( P_WAIT, argv[0], argv );
|
||||||
|
if ( status )
|
||||||
|
perror( "cp" );
|
||||||
|
return status;
|
||||||
|
#else
|
||||||
|
FILE * fs;
|
||||||
|
FILE * fd;
|
||||||
|
char buffer[ 8192 ];
|
||||||
|
int n;
|
||||||
|
struct ftime When;
|
||||||
|
struct stat Stat;
|
||||||
|
|
||||||
|
fs = fopen( s, "rb" );
|
||||||
|
if ( fs == NULL ) {
|
||||||
|
perror( s );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
fd = fopen( d, "wb" );
|
||||||
|
if ( fd == NULL ) {
|
||||||
|
perror( d );
|
||||||
|
fclose( fs );
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( preserve_time )
|
||||||
|
if ( getftime( fileno(fs), &When ) ) {
|
||||||
|
perror( s );
|
||||||
|
preserve_time = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
n = fread( buffer, 1, sizeof buffer, fs );
|
||||||
|
if ( n > 0 )
|
||||||
|
if ( fwrite( buffer, 1, n, fd ) < 0 ) {
|
||||||
|
perror( d );
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
} while ( n > 0 );
|
||||||
|
|
||||||
|
fclose( fs );
|
||||||
|
|
||||||
|
/* Fix time stamp */
|
||||||
|
if ( preserve_time )
|
||||||
|
if ( setftime( fileno(fd), &When ) ) {
|
||||||
|
perror( s );
|
||||||
|
preserve_time = 0;
|
||||||
|
}
|
||||||
|
fclose( fd );
|
||||||
|
|
||||||
|
/* Fix access rights */
|
||||||
|
if ( stat( s, &Stat ) )
|
||||||
|
perror( s );
|
||||||
|
else if ( chmod( d, Stat.st_mode ) )
|
||||||
|
perror( d );
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int main( int argc, char * argv[] )
|
||||||
|
{
|
||||||
|
char * progname;
|
||||||
|
int verbose = 0;
|
||||||
|
int only_if_newer= 0;
|
||||||
|
char * suffix = NULL;
|
||||||
|
char * mode = NULL;
|
||||||
|
char * dest;
|
||||||
|
char ** pp;
|
||||||
|
|
||||||
|
argv = argv_fix( &argc, argv );
|
||||||
|
|
||||||
|
progname = basename( *argv++ );
|
||||||
|
|
||||||
|
/* process the options */
|
||||||
|
while ( argv[0] && argv[0][0] == '-' ) {
|
||||||
|
switch ( argv[0][1] ) {
|
||||||
|
case 'N':
|
||||||
|
++argv;
|
||||||
|
only_if_newer = 1;
|
||||||
|
break;
|
||||||
|
case 'c':
|
||||||
|
++argv;
|
||||||
|
/* We always copy, regardless */
|
||||||
|
break;
|
||||||
|
case 'v':
|
||||||
|
++argv;
|
||||||
|
verbose = 1;
|
||||||
|
break;
|
||||||
|
case 'V':
|
||||||
|
++argv;
|
||||||
|
suffix = *argv;
|
||||||
|
++argv;
|
||||||
|
break;
|
||||||
|
case 'm':
|
||||||
|
++argv;
|
||||||
|
mode = *argv;
|
||||||
|
++argv;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fatal( NULL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Separate source file(s) from dest directory or file */
|
||||||
|
#if 0
|
||||||
|
if ( !argv[0] || !argv[1] )
|
||||||
|
fatal( "missing files or invalid destination" );
|
||||||
|
#else
|
||||||
|
/* We used to require at least one file; not any more */
|
||||||
|
if ( !argv[0] )
|
||||||
|
fatal( "missing files or invalid destination" );
|
||||||
|
if ( !argv[1] )
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
for ( pp = argv; *pp; ++pp )
|
||||||
|
continue;
|
||||||
|
--pp;
|
||||||
|
dest = *pp;
|
||||||
|
*pp = NULL;
|
||||||
|
|
||||||
|
/* Process the arguments */
|
||||||
|
for (; *argv; ++argv ) {
|
||||||
|
char * f = *argv;
|
||||||
|
char * leaf = basename( f );
|
||||||
|
char target[ 128 ];
|
||||||
|
|
||||||
|
strcpy( target, dest );
|
||||||
|
|
||||||
|
if ( is_dir( target ) ) {
|
||||||
|
strcat( target, "/" );
|
||||||
|
/* if we were given a suffix, then add it as appropriate */
|
||||||
|
if ( suffix ) {
|
||||||
|
char * dot = strchr( leaf, '.' );
|
||||||
|
if ( dot ) {
|
||||||
|
strncat( target, leaf, dot-leaf );
|
||||||
|
strcat( target, suffix );
|
||||||
|
strcat( target, dot );
|
||||||
|
if ( verbose )
|
||||||
|
printf( "%s: %s will be installed as %s",
|
||||||
|
progname, f, strrchr(target,'/')+1 );
|
||||||
|
} else {
|
||||||
|
strcat( target, leaf );
|
||||||
|
strcat( target, suffix );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
strcat( target, leaf );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( access( f, 0 ) ) {
|
||||||
|
char buf[200];
|
||||||
|
sprintf( buf, "cannot read %s", f );
|
||||||
|
fatal( buf );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( only_if_newer && is_file( target ) && !newer( f, target ) ) {
|
||||||
|
if ( verbose )
|
||||||
|
printf( "'%s' not newer than '%s'\n", f, target );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( verbose )
|
||||||
|
printf( "rm -f %s\n", target );
|
||||||
|
if ( chmod( target, 0777 ) )
|
||||||
|
if ( verbose )
|
||||||
|
perror( target );
|
||||||
|
if ( unlink( target ) )
|
||||||
|
if ( verbose )
|
||||||
|
perror( target );
|
||||||
|
if ( verbose )
|
||||||
|
printf( "cp -p %s %s\n", f, target );
|
||||||
|
if ( filecopy( target, f, 1 ) )
|
||||||
|
return 1;
|
||||||
|
if ( mode ) {
|
||||||
|
char buf[ 255 ];
|
||||||
|
sprintf( buf, "chmod %s %s\n", mode, target );
|
||||||
|
if ( verbose )
|
||||||
|
printf( "%s\n", buf );
|
||||||
|
system( buf );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
163
c/build-tools/os/msdos/ifc_exe.uue
Normal file
163
c/build-tools/os/msdos/ifc_exe.uue
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
|
begin 664 ifc.exe
|
||||||
|
M(VEN8VQU9&4@/'-T9&EO+F@^#0HC:6YC;'5D92 \<W1R:6YG+F@^#0HC:6YC
|
||||||
|
M;'5D92 \<')O8V5S<RYH/@T*#0HC:6YC;'5D92 \:6\N:#X-"@T*=F]I9" J
|
||||||
|
M('AM86QL;V,H(&EN="!S:7IE("D-"GL-"B @("!V;VED("H@<" ]("AV;VED
|
||||||
|
M("HI;6%L;&]C*"!S:7IE("D[#0H@(" @:68@*" A<" I("![#0H)9G!R:6YT
|
||||||
|
M9B@@<W1D97)R+" B;W5T(&]F(&UE;6]R>5QN(B I.PT*"65X:70H(#$@*3L-
|
||||||
|
M"B @("!]#0H@(" @<F5T=7)N(' [#0I]#0IV;VED("H@>')E86QL;V,H('9O
|
||||||
|
M:60@*B!O;&0L(&EN="!S:7IE("D-"GL-"B @("!V;VED("H@<" ]("AV;VED
|
||||||
|
M("HI<F5A;&QO8R@@;VQD+"!S:7IE("D[#0H@(" @:68@*" A<" I("![#0H)
|
||||||
|
M9G!R:6YT9B@@<W1D97)R+" B;W5T(&]F(&UE;6]R>5QN(B I.PT*"65X:70H
|
||||||
|
M(#$@*3L-"B @("!]#0H@(" @<F5T=7)N(' [#0I]#0H-"F-H87(@*BH@87)G
|
||||||
|
M=E]F:7@H(&EN=" J(&%R9V,L(&-H87(@*BH@87)G=B I#0I[#0H@(" @8VAA
|
||||||
|
M<B J*B!N97<@/2!.54Q,.PT*(" @(&EN=" @(" @;6%X(#T@,C [#0H@(" @
|
||||||
|
M:6YT"2 @("!C;G0@/2 P.PT*(" @(&EN= D@(" @:CL-"@T*(" @(&9O<B H
|
||||||
|
M(&H@/2 Q.R!A<F=V6VI=.R K*VH@*0T*"6EF("@@87)G=EMJ75LP72 ]/2 G
|
||||||
|
M0"<@)B8@86-C97-S*&%R9W9;:ETK,2PP*3T]," I#0H)(" @(&)R96%K.PT*
|
||||||
|
M(" @(&EF("@@87)G=EMJ72 ]/2!.54Q,("D-"@ER971U<FX@87)G=CL-"@T*
|
||||||
|
M(" @(&YE=R ]("AC:&%R("HJ*7AM86QL;V,H(&UA>" J('-I>F5O9B J;F5W
|
||||||
|
M("D[#0H@(" @;F5W6V-N="LK72 ]("IA<F=V*RL[#0H@(" @9F]R("@@.R J
|
||||||
|
M87)G=CL@*RMA<F=V("D@('L-"@EI9B H(&-N=" ^/2!M87@@*0T*"2 @("!N
|
||||||
|
M97<@/2 H8VAA<B J*BER96%L;&]C*"!N97<L("AM87@J/3(I("H@<VEZ96]F
|
||||||
|
M("IN97<@*3L-"@D@(" @#0H):68@*"!A<F=V6S!=6S!=("$]("= )R!\?"!A
|
||||||
|
M8V-E<W,H87)G=ELP72LQ+# I("D@('L-"@D@(" @;F5W6V-N="LK72 ]("IA
|
||||||
|
M<F=V.PT*"7T@96QS92R(B I.PT*"2 @("!I
|
||||||
|
M9B H("%F("D@('L-"@D)<&5R<F]R*"!A<F=V6S!=*S$@*3L-"@D)97AI="@@
|
||||||
|
M,B I.PT*"2 @("!]#0H)(" @('=H:6QE("@@9F=E=',H(&QI;F4L('-I>F5O
|
||||||
|
M9B!L:6YE+"!F("D@*2 @>PT*"0EI;G0@;&5N(#T@<W1R;&5N*"!L:6YE("D[
|
||||||
|
M#0H)"2\J(&1E;&5T92!T<F%I;&EN9R!N97=L:6YE<R J+PT*"0EW:&EL92 H
|
||||||
|
M(&QI;F5;;&5N+3%=(#T]("=<;B<@?'P@;&EN95ML96XM,5T@/3T@)UQR)R I
|
||||||
|
M#0H)"2 @("!L:6YE6RTM;&5N72 ]("=<,"<[#0H)"6EF("@@8VYT(#X](&UA
|
||||||
|
M>" I#0H)"2 @("!N97<@/2 H8VAA<B J*BEX<F5A;&QO8R@@;F5W+" H;6%X
|
||||||
|
M*CTR*2 J('-I>F5O9B J;F5W("D[#0H)"6YE=UMC;G1=(#T@*&-H87(@*BEX
|
||||||
|
M;6%L;&]C*"!L96XK,2 I.PT*"0ES=')C<'DH(&YE=UMC;G1=+"!L:6YE("D[
|
||||||
|
M#0H)"2LK8VYT.PT*"2 @("!]#0H)(" @(&9C;&]S92@@9B I.PT*"7T)#0H@
|
||||||
|
M(" @?0T*(" @(&EF("@@8VYT(#X](&UA>" I#0H);F5W(#T@*&-H87(@*BHI
|
||||||
|
M>')E86QL;V,H(&YE=RP@*&UA>"LQ*2 J('-I>F5O9B J;F5W("D[#0H@(" @
|
||||||
|
M;F5W6V-N=%T@/2!.54Q,.PT*(" @("IA<F=C(#T@8VYT.PT*(" @(')E='5R
|
||||||
|
M;B!N97<[#0I]#0H-"@T*8V]N<W0@8VAA<B J(%5304=%(#T@#0HB=7-A9V4Z
|
||||||
|
M("1P<F]G;F%M92!;("UC3G9M5B!=(&9I;&4@6R!F:6QE("XN+B!=(&1E<W0M
|
||||||
|
M9&ER96-T;W)Y+6]R+69I;&5<;B(-"B(@(" @(" @("UV(" @(" @(" @("TM
|
||||||
|
M('9E<F)O<V5<;B(-"B(@(" @(" @("U6('-U9F9I>" @("TM('-U9F9I>"!T
|
||||||
|
M;R!A<'!E;F0@=&\@=&%R9V5T<R H8F5F;W)E(&%N>2 N('-U9F9I>"E<;B(-
|
||||||
|
M"B(@(" @(" @(" @(" @(" @(" @(" @("!E9SH@+58@7V<@=V]U;&0@8VAA
|
||||||
|
M;F=E("=F;V\G('1O("=F;V]?9R<@86YD7&XB#0HB(" @(" @(" @(" @(" @
|
||||||
|
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" G;&EB9F]O+F$G('1O
|
||||||
|
M("=L:6)F;V]?9RYA)UQN(@T*(B @(" @(" @+6T@;6]D92 @(" @+2T@;6]D
|
||||||
|
M92!F;W(@;F5W(&9I;&4H<RE<;B(-"B(@(" @(" @("UC(" @(" @(" @("TM
|
||||||
|
M(&-O<'D@:6YS=&5A9"!O9B!M;W9E("AA;'=A>7,@;VXI7&XB#0HB(" @(" @
|
||||||
|
M(" M3B @(" @(" @(" M+2!C;W!Y(&]N;'D@:68@<V]U<F-E(&ES(&YE=V5R
|
||||||
|
M('1H86X@=&%R9V5T7&XB#0H[#0H-"G9O:60@9F%T86PH(&-H87(@*B!M<V<@
|
||||||
|
M*0T*>PT*(" @(&EF("@@;7-G("D-"@EF<')I;G1F*"!S=&1E<G(L("(E<UQN
|
||||||
|
M(BP@;7-G("D[#0H@(" @9G!R:6YT9B@@<W1D97)R+" B)7,B+"!54T%'12 I
|
||||||
|
M.PT*(" @(&5X:70H(#$@*3L-"GT-"@T*8VAA<B J(&)A<V5N86UE*"!C:&%R
|
||||||
|
M("H@9B I#0I[#0H@(" @8VAA<B J(&(@/2!S=')R8VAR*"!F+" G+R<@*3L-
|
||||||
|
M"B @("!I9B H(&(@*0DK*V([#0H@(" @96QS90EB(#T@9CL-"B @("!R971U
|
||||||
|
M<FX@8CL-"GT-"@T*(VEN8VQU9&4@/'-Y<R]S=&%T+F@^#0II;G0@:7-?9&ER
|
||||||
|
M*"!C:&%R("H@<&%T:" I#0I[#0H@(" @<W1R=6-T('-T870@8G5F.PT*(" @
|
||||||
|
M(&EF("@@<W1A="@@<&%T:"P@)F)U9B I("D-"@ER971U<FX@,#L-"B @("!R
|
||||||
|
M971U<FX@8G5F+G-T7VUO9&4@)B!37TE&1$E2.PT*?0T*:6YT(&ES7V9I;&4H
|
||||||
|
M(&-H87(@*B!P871H("D-"GL-"B @("!S=')U8W0@<W1A="!B=68[#0H@(" @
|
||||||
|
M:68@*"!S=&%T*"!P871H+" F8G5F("D@*0T*"7)E='5R;B P.PT*(" @(')E
|
||||||
|
M='5R;B!B=68N<W1?;6]D92 F(%-?249214<[#0I]#0II;G0@;F5W97(H(&-H
|
||||||
|
M87(@*B!P,2P@8VAA<B J(' R("D-"GL-"B @("!S=')U8W0@<W1A="!B=68Q
|
||||||
|
M.PT*(" @('-T<G5C="!S=&%T(&)U9C([#0H@(" @:68@*"!S=&%T*"!P,2P@
|
||||||
|
M)F)U9C$@*2 I#0H)<F5T=7)N(# [#0H@(" @:68@*"!S=&%T*"!P,BP@)F)U
|
||||||
|
M9C(@*2 I#0H)<F5T=7)N(# [#0H@(" @<F5T=7)N(&)U9C$N<W1?;71I;64@
|
||||||
|
M/B!B=68R+G-T7VUT:6UE.PT*?0T*#0II;G0@9FEL96-O<'DH(&-H87(@*B!D
|
||||||
|
M+"!C:&%R("H@<RP@:6YT('!R97-E<G9E7W1I;64@*0T*>PT*(VEF(# -"B @
|
||||||
|
M("!I;G0)"7-T871U<SL-"B @("!C:&%R(" @(" @*B!A<F=V6R U(%T[#0H@
|
||||||
|
M(" @87)G=ELP72 ](")C<"([#0H@(" @87)G=ELQ72 ]("(M<"([#0H@(" @
|
||||||
|
M87)G=ELR72 ](',[#0H@(" @87)G=ELS72 ](&0[#0H@(" @87)G=ELT72 ]
|
||||||
|
M($Y53$P[#0H@(" @<W1A='5S(#T@<W!A=VYV<"@@4%]704E4+"!A<F=V6S!=
|
||||||
|
M+"!A<F=V("D[#0H@(" @:68@*"!S=&%T=7,@*0T*"7!E<G)O<B@@(F-P(B I
|
||||||
|
M.PT*(" @(')E='5R;B!S=&%T=7,[#0HC96QS90T*(" @($9)3$4@(" @(" J
|
||||||
|
M(&9S.PT*(" @($9)3$4@(" @(" J(&9D.PT*(" @(&-H87()8G5F9F5R6R X
|
||||||
|
M,3DR(%T[#0H@(" @:6YT"0EN.PT*(" @('-T<G5C="!F=&EM90E7:&5N.PT*
|
||||||
|
M(" @('-T<G5C="!S=&%T"0E3=&%T.PT*#0H@(" @9G,@/2!F;W!E;B@@<RP@
|
||||||
|
M(G)B(B I.PT*(" @(&EF("@@9G,@/3T@3E5,3" I("![#0H)<&5R<F]R*"!S
|
||||||
|
M("D[#0H)<F5T=7)N(#$[#0H@(" @?0T*(" @(&9D(#T@9F]P96XH(&0L(")W
|
||||||
|
M8B(@*3L-"B @("!I9B H(&9D(#T]($Y53$P@*2 @>PT*"7!E<G)O<B@@9" I
|
||||||
|
M.PT*"69C;&]S92@@9G,@*3L-"@ER971U<FX@,CL-"B @("!]#0H-"B @("!I
|
||||||
|
M9B H('!R97-E<G9E7W1I;64@*0T*"6EF("@@9V5T9G1I;64H(&9I;&5N;RAF
|
||||||
|
M<RDL("97:&5N("D@*2 @>PT*"2 @("!P97)R;W(H(',@*3L-"@D@(" @<')E
|
||||||
|
M<V5R=F5?=&EM92 ](# [#0H)?0T*#0H@(" @9&\@>PT*"6X@/2!F<F5A9"@@
|
||||||
|
M8G5F9F5R+" Q+"!S:7IE;V8@8G5F9F5R+"!F<R I.PT*"6EF("@@;B ^(# @
|
||||||
|
M*0T*"2 @("!I9B H(&9W<FET92@@8G5F9F5R+" Q+"!N+"!F9" I(#P@," I
|
||||||
|
M("![#0H)"7!E<G)O<B@@9" I.PT*"0ER971U<FX@,SL-"@D@(" @?0T*(" @
|
||||||
|
M('T@=VAI;&4@*"!N(#X@," I.R @(" -"@T*(" @(&9C;&]S92@@9G,@*3L-
|
||||||
|
M"@T*(" @("\J($9I>"!T:6UE('-T86UP("HO#0H@(" @:68@*"!P<F5S97)V
|
||||||
|
M95]T:6UE("D-"@EI9B H('-E=&9T:6UE*"!F:6QE;F\H9F0I+" F5VAE;B I
|
||||||
|
M("D@('L-"@D@(" @<&5R<F]R*"!S("D[#0H)(" @('!R97-E<G9E7W1I;64@
|
||||||
|
M/2 P.PT*"7T-"B @("!F8VQO<V4H(&9D("D[#0H-"B @(" O*B!&:7@@86-C
|
||||||
|
M97-S(')I9VAT<R J+PT*(" @(&EF("@@<W1A="@@<RP@)E-T870@*2 I#0H)
|
||||||
|
M<&5R<F]R*"!S("D[#0H@(" @96QS92!I9B H(&-H;6]D*"!D+"!3=&%T+G-T
|
||||||
|
M7VUO9&4@*2 I#0H)<&5R<F]R*"!D("D[#0H-"B @("!R971U<FX@,#L-"B-E
|
||||||
|
M;F1I9@T*?0T*#0H-"@T*#0H-"FEN="!M86EN*"!I;G0@87)G8RP@8VAA<B J
|
||||||
|
M(&%R9W9;72 I#0I[#0H@(" @8VAA<B J"7!R;V=N86UE.PT*(" @(&EN= D)
|
||||||
|
M=F5R8F]S92 ](# [#0H@(" @:6YT"0EO;FQY7VEF7VYE=V5R/2 P.PT*(" @
|
||||||
|
M(&-H87(@*@ES=69F:7@@(#T@3E5,3#L-"B @("!C:&%R("H);6]D90D]($Y5
|
||||||
|
M3$P[#0H@(" @8VAA<B J( ED97-T.PT*(" @(&-H87(@*BH)<' [#0H-"B @
|
||||||
|
M("!A<F=V(#T@87)G=E]F:7@H("9A<F=C+"!A<F=V("D[#0H-"B @("!P<F]G
|
||||||
|
M;F%M92 ](&)A<V5N86UE*" J87)G=BLK("D[#0H-"B @(" O*B!P<F]C97-S
|
||||||
|
M('1H92!O<'1I;VYS("HO#0H@(" @=VAI;&4@*"!A<F=V6S!=(" F)B @87)G
|
||||||
|
M=ELP75LP72 ]/2 G+2<@*2 @>PT*"7-W:71C:" H(&%R9W9;,%U;,5T@*2 @
|
||||||
|
M>PT*"2 @("!C87-E("=.)SH-"@D@(" @(" @("LK87)G=CL-"@D);VYL>5]I
|
||||||
|
M9E]N97=E<B ](#$[#0H)"6)R96%K.PT*"2 @("!C87-E("=C)SH-"@D@(" @
|
||||||
|
M(" @("LK87)G=CL-"@D)+RH@5V4@86QW87ES(&-O<'DL(')E9V%R9&QE<W,@
|
||||||
|
M*B\-"@D)8G)E86L[#0H)(" @(&-A<V4@)W8G.@T*"0DK*V%R9W8[#0H)"79E
|
||||||
|
M<F)O<V4@/2 Q.PT*"0EB<F5A:SL-"@D@(" @8V%S92 G5B<Z#0H)"2LK87)G
|
||||||
|
M=CL-"@D)<W5F9FEX(#T@*F%R9W8[#0H)"2LK87)G=CL-"@D)8G)E86L[#0H)
|
||||||
|
M(" @(&-A<V4@)VTG.@T*"0DK*V%R9W8[#0H)"6UO9&4@/2 J87)G=CL-"@D)
|
||||||
|
M*RMA<F=V.PT*"0EB<F5A:SL-"@D@(" @9&5F875L=#H-"@D)9F%T86PH($Y5
|
||||||
|
M3$P@*3L-"@E]#0H@(" @?0T*#0H@(" @+RH@4V5P87)A=&4@<V]U<F-E(&9I
|
||||||
|
M;&4H<RD@9G)O;2!D97-T(&1I<F5C=&]R>2!O<B!F:6QE("HO#0HC:68@, T*
|
||||||
|
M(" @(&EF("@@(6%R9W9;,%T@?'P@(6%R9W9;,5T@*0T*"69A=&%L*" B;6ES
|
||||||
|
M<VEN9R!F:6QE<R!O<B!I;G9A;&ED(&1E<W1I;F%T:6]N(B I.PT*(V5L<V4-
|
||||||
|
M"B @(" O*B!792!U<V5D('1O(')E<75I<F4@870@;&5A<W0@;VYE(&9I;&4[
|
||||||
|
M(&YO="!A;GD@;6]R92 J+PT*(" @(&EF("@@(6%R9W9;,%T@*0T*"69A=&%L
|
||||||
|
M*" B;6ES<VEN9R!F:6QE<R!O<B!I;G9A;&ED(&1E<W1I;F%T:6]N(B I.PT*
|
||||||
|
M(" @(&EF("@@(6%R9W9;,5T@*0T*"7)E='5R;B P.PT*(V5N9&EF#0H@(" @
|
||||||
|
M9F]R("@@<' @/2!A<F=V.R J<' [("LK<' @*0T*"6-O;G1I;G5E.PT*(" @
|
||||||
|
M("TM<' [#0H@(" @9&5S=" ]("IP<#L-"B @(" J<' @/2!.54Q,.PT*#0H@
|
||||||
|
M(" @+RH@4')O8V5S<R!T:&4@87)G=6UE;G1S("HO#0H@(" @9F]R("@[("IA
|
||||||
|
M<F=V.R K*V%R9W8@*2 @>PT*"6-H87(@*B!F(#T@*F%R9W8[#0H)8VAA<B J
|
||||||
|
M(&QE868@/2!B87-E;F%M92@@9B I.PT*"6-H87(@=&%R9V5T6R Q,C@@73L-
|
||||||
|
M"@T*"7-T<F-P>2@@=&%R9V5T+"!D97-T("D[#0H-"@EI9B H(&ES7V1I<B@@
|
||||||
|
M=&%R9V5T("D@*2 @>PT*"2 @("!S=')C870H('1A<F=E="P@(B\B("D[#0H)
|
||||||
|
M(" @("\J(&EF('=E('=E<F4@9VEV96X@82!S=69F:7@L('1H96X@861D(&ET
|
||||||
|
M(&%S(&%P<')O<')I871E("HO#0H)(" @(&EF("@@<W5F9FEX("D@('L-"@D)
|
||||||
|
M8VAA<B J(&1O=" ]('-T<F-H<B@@;&5A9BP@)RXG("D[#0H)"6EF("@@9&]T
|
||||||
|
M("D@('L-"@D)(" @('-T<FYC870H('1A<F=E="P@;&5A9BP@9&]T+6QE868@
|
||||||
|
M*3L-"@D)(" @('-T<F-A="@@=&%R9V5T+"!S=69F:7@@*3L-"@D)(" @('-T
|
||||||
|
M<F-A="@@=&%R9V5T+"!D;W0@*3L-"@D)(" @(&EF("@@=F5R8F]S92 I#0H)
|
||||||
|
M"0EP<FEN=&8H("(E<SH@)7,@=VEL;"!B92!I;G-T86QL960@87,@)7,B+ T*
|
||||||
|
M"0D)(" @(" @('!R;V=N86UE+"!F+"!S=')R8VAR*'1A<F=E="PG+R<I*S$@
|
||||||
|
M*3L-"@D)?2!E;'-E('L-"@D)(" @('-T<F-A="@@=&%R9V5T+"!L96%F("D[
|
||||||
|
M#0H)"2 @("!S=')C870H('1A<F=E="P@<W5F9FEX("D[#0H)"7T-"@D@(" @
|
||||||
|
M?2!E;'-E('L-"@D)<W1R8V%T*"!T87)G970L(&QE868@*3L-"@D@(" @?0T*
|
||||||
|
M"7T-"@T*"6EF("@@86-C97-S*"!F+" P("D@*2 @>PT*"2 @("!C:&%R(&)U
|
||||||
|
M9ELR,#!=.PT*"2 @("!S<')I;G1F*"!B=68L(")C86YN;W0@<F5A9" E<R(L
|
||||||
|
M(&8@*3L-"@D@(" @9F%T86PH(&)U9B I.PT*"7T-"@T*"6EF("@@;VYL>5]I
|
||||||
|
M9E]N97=E<B F)B!I<U]F:6QE*"!T87)G970@*2 F)B A;F5W97(H(&8L('1A
|
||||||
|
M<F=E=" I("D@('L-"@D@(" @:68@*"!V97)B;W-E("D-"@D)<')I;G1F*" B
|
||||||
|
M)R5S)R!N;W0@;F5W97(@=&AA;B G)7,G7&XB+"!F+"!T87)G970@*3L-"@D@
|
||||||
|
M(" @8V]N=&EN=64[#0H)?0T*#0H):68@*"!V97)B;W-E("D-"@D@(" @<')I
|
||||||
|
M;G1F*" B<FT@+68@)7-<;B(L('1A<F=E=" I.PT*"6EF("@@8VAM;V0H('1A
|
||||||
|
M<F=E="P@,#<W-R I("D-"@D@(" @:68@*"!V97)B;W-E("D-"@D)<&5R<F]R
|
||||||
|
M*"!T87)G970@*3L-"@EI9B H('5N;&EN:R@@=&%R9V5T("D@*0T*"2 @("!I
|
||||||
|
M9B H('9E<F)O<V4@*0T*"0EP97)R;W(H('1A<F=E=" I.PT*"6EF("@@=F5R
|
||||||
|
M8F]S92 I#0H)(" @('!R:6YT9B@@(F-P("UP("5S("5S7&XB+"!F+"!T87)G
|
||||||
|
M970@*3L-"@EI9B H(&9I;&5C;W!Y*"!T87)G970L(&8L(#$@*2 I#0H)(" @
|
||||||
|
M(')E='5R;B Q.PT*"6EF("@@;6]D92 I("![#0H)(" @(&-H87(@8G5F6R R
|
||||||
|
M-34@73L-"@D@(" @<W!R:6YT9B@@8G5F+" B8VAM;V0@)7,@)7-<;B(L(&UO
|
||||||
|
M9&4L('1A<F=E=" I.PT*"2 @("!I9B H('9E<F)O<V4@*0T*"0EP<FEN=&8H
|
||||||
|
M("(E<UQN(BP@8G5F("D[#0H)(" @('-Y<W1E;2@@8G5F("D[#0H)?0T*(" @
|
||||||
|
:('T-"@T*(" @(')E='5R;B P.PT*?0T*#0IE
|
||||||
|
|
||||||
|
end
|
||||||
@@ -1,513 +0,0 @@
|
|||||||
|
|
||||||
/***** P A C K H E X . C ************************************************
|
|
||||||
*
|
|
||||||
* Packhex is a hex-file compaction utility. It attempts to concatenate
|
|
||||||
* hex records to produce more size-efficient packaging.
|
|
||||||
*
|
|
||||||
* Limitations: Input files must be correctly formatted. This utility
|
|
||||||
* is not robust enough to detect hex-record formatting
|
|
||||||
* errors.
|
|
||||||
*
|
|
||||||
* Published: 5/93 Embedded Systems magazine
|
|
||||||
*
|
|
||||||
* Compiler: Microsoft C 6.0
|
|
||||||
* cl /F 1000 packhex.c
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
/* #define SMALLER_RECORDS */
|
|
||||||
#ifdef SMALLER_RECORDS
|
|
||||||
#define MAX_LEN_S1_RECS 128
|
|
||||||
#define MAX_LEN_S2_RECS 128
|
|
||||||
#define MAX_LEN_S3_RECS 128
|
|
||||||
#else
|
|
||||||
#define MAX_LEN_S1_RECS 252
|
|
||||||
#define MAX_LEN_S2_RECS 251
|
|
||||||
#define MAX_LEN_S3_RECS 250
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*--------------------------------- includes ---------------------------------*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#if defined(__unix__) && !defined(EXIT_FAILURE)
|
|
||||||
#define EXIT_FAILURE -1
|
|
||||||
#define EXIT_SUCCESS 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*--------------------------------- defines ----------------------------------*/
|
|
||||||
|
|
||||||
#define YES 1
|
|
||||||
#define MAX_LINE_SIZE 600
|
|
||||||
#define EOS '\0'
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------- macros ----------------------------------*/
|
|
||||||
|
|
||||||
/* Convert ASCII hexadecimal digit to value. */
|
|
||||||
|
|
||||||
#define HEX_DIGIT( C ) ( ( ( ( C ) > '9' ) ? ( C ) + 25 : ( C ) ) & 0xF )
|
|
||||||
|
|
||||||
|
|
||||||
/*--------------------------------- typedefs ---------------------------------*/
|
|
||||||
|
|
||||||
typedef unsigned char Boolean;
|
|
||||||
typedef unsigned char Uchar;
|
|
||||||
typedef unsigned int Uint;
|
|
||||||
typedef unsigned long Ulong;
|
|
||||||
|
|
||||||
typedef struct /* Functions and constant returning Hex-record vital stats. */
|
|
||||||
{
|
|
||||||
Boolean ( *is_data_record )( char * );
|
|
||||||
Ulong ( *get_address )( char * );
|
|
||||||
Uint ( *get_data_count )( char * );
|
|
||||||
const Uint max_data_count;
|
|
||||||
char *( *get_data_start )( char * );
|
|
||||||
void ( *put_data_record )( Uint, Ulong, char * );
|
|
||||||
} Rec_vitals;
|
|
||||||
|
|
||||||
|
|
||||||
/*--------------------------- function prototypes ----------------------------*/
|
|
||||||
|
|
||||||
Rec_vitals * identify_first_data_record( char * );
|
|
||||||
Ulong get_ndigit_hex( char *, int );
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------- Intel Hex format -----------------------------*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Intel Hex data-record layout
|
|
||||||
*
|
|
||||||
* :aabbbbccd...dee
|
|
||||||
*
|
|
||||||
* : - header character
|
|
||||||
* aa - record data byte count, a 2-digit hex value
|
|
||||||
* bbbb - record address, a 4-digit hex value
|
|
||||||
* cc - record type, a 2-digit hex value:
|
|
||||||
* "00" is a data record
|
|
||||||
* "01" is an end-of-data record
|
|
||||||
* "02" is an extended-address record
|
|
||||||
* "03" is a start record
|
|
||||||
* d...d - data (always an even number of chars)
|
|
||||||
* ee - record checksum, a 2-digit hex value
|
|
||||||
* checksum = 2's complement
|
|
||||||
* [ (sum of bytes: aabbbbccd...d) modulo 256 ]
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
Boolean is_intel_data_rec( char * rec_str )
|
|
||||||
{
|
|
||||||
return( ( rec_str[ 0 ] == ':' ) && ( rec_str[ 8 ] == '0' ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
Uint get_intel_rec_data_count( char * rec_str )
|
|
||||||
{
|
|
||||||
return( ( Uint ) get_ndigit_hex( rec_str + 1, 2 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
Ulong get_intel_rec_address( char * rec_str )
|
|
||||||
{
|
|
||||||
return( get_ndigit_hex( rec_str + 3, 4 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
char * get_intel_rec_data_start( char * rec_str )
|
|
||||||
{
|
|
||||||
return( rec_str + 9 );
|
|
||||||
}
|
|
||||||
|
|
||||||
void put_intel_data_rec( Uint count, Ulong address, char * data_str )
|
|
||||||
{
|
|
||||||
char *ptr;
|
|
||||||
Uint sum = count + ( address >> 8 & 0xff ) + ( address & 0xff );
|
|
||||||
|
|
||||||
for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
|
|
||||||
sum += ( Uint ) get_ndigit_hex( ptr, 2 );
|
|
||||||
|
|
||||||
printf(
|
|
||||||
":%02X%04lX00%s%02X\n", count, address, data_str, (~sum + 1) & 0xff
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Rec_vitals intel_hex =
|
|
||||||
{
|
|
||||||
is_intel_data_rec,
|
|
||||||
get_intel_rec_address,
|
|
||||||
get_intel_rec_data_count,
|
|
||||||
255, /* Maximum data bytes in a record. */
|
|
||||||
get_intel_rec_data_start,
|
|
||||||
put_intel_data_rec
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*------------------------- Motorola S1-record format ------------------------*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Motorola S-record data-record layout
|
|
||||||
*
|
|
||||||
* Sabbc...cd...dee
|
|
||||||
*
|
|
||||||
* S - header character
|
|
||||||
* a - record type, a 1-digit value:
|
|
||||||
* "0" is a header record
|
|
||||||
* "1" is a 2-byte-address data record
|
|
||||||
* "2" is a 3-byte-address data record
|
|
||||||
* "3" is a 4-byte-address data record
|
|
||||||
* "7" is a 4-byte-address end-of-data record
|
|
||||||
* "8" is a 3-byte-address end-of-data record
|
|
||||||
* "9" is a 2-byte-address end-of-data record
|
|
||||||
* bb - record length in bytes, a 2-digit hex value
|
|
||||||
* (record length doesn't count the header/type
|
|
||||||
* chars and checksum byte)
|
|
||||||
* c...c - record address, a 4-, 6-, or 8-digit value,
|
|
||||||
* depending on record type
|
|
||||||
* d...d - data (always an even number of chars)
|
|
||||||
* ee - record checksum, a 2-digit hex value
|
|
||||||
* checksum = 1's complement
|
|
||||||
* [ (sum of all bytes: bbc..cd...d) modulo 256 ]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define S1_COUNT_OFFSET 3
|
|
||||||
|
|
||||||
|
|
||||||
Boolean is_moto_s1_data_rec( char * rec_str )
|
|
||||||
{
|
|
||||||
return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '1' ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
Uint get_moto_s1_rec_data_count( char * rec_str )
|
|
||||||
{
|
|
||||||
return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S1_COUNT_OFFSET );
|
|
||||||
}
|
|
||||||
|
|
||||||
Ulong get_moto_s1_rec_address( char * rec_str )
|
|
||||||
{
|
|
||||||
return( get_ndigit_hex( rec_str + 4, 4 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
char * get_moto_s1_rec_data_start( char * rec_str )
|
|
||||||
{
|
|
||||||
return( rec_str + 8 );
|
|
||||||
}
|
|
||||||
|
|
||||||
void put_moto_s1_data_rec( Uint count, Ulong address, char * data_str )
|
|
||||||
{
|
|
||||||
char *ptr;
|
|
||||||
Uint sum = S1_COUNT_OFFSET + count +
|
|
||||||
( address >> 8 & 0xff ) + ( address & 0xff );
|
|
||||||
|
|
||||||
for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
|
|
||||||
sum += ( Uint ) get_ndigit_hex( ptr, 2 );
|
|
||||||
|
|
||||||
printf(
|
|
||||||
"S1%02X%04lX%s%02X\n",
|
|
||||||
count + S1_COUNT_OFFSET, address, data_str, ~sum & 0xff
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Rec_vitals motorola_s1_rec =
|
|
||||||
{
|
|
||||||
is_moto_s1_data_rec,
|
|
||||||
get_moto_s1_rec_address,
|
|
||||||
get_moto_s1_rec_data_count,
|
|
||||||
MAX_LEN_S1_RECS, /* Maximum data bytes in a record. */
|
|
||||||
get_moto_s1_rec_data_start,
|
|
||||||
put_moto_s1_data_rec
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*------------------------- Motorola S2-record format ------------------------*/
|
|
||||||
|
|
||||||
#define S2_COUNT_OFFSET 4
|
|
||||||
|
|
||||||
Boolean is_moto_s2_data_rec( char * rec_str )
|
|
||||||
{
|
|
||||||
return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '2' ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
Uint get_moto_s2_rec_data_count( char * rec_str )
|
|
||||||
{
|
|
||||||
return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S2_COUNT_OFFSET );
|
|
||||||
}
|
|
||||||
|
|
||||||
Ulong get_moto_s2_rec_address( char * rec_str )
|
|
||||||
{
|
|
||||||
return( get_ndigit_hex( rec_str + 4, 6 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
char * get_moto_s2_rec_data_start( char * rec_str )
|
|
||||||
{
|
|
||||||
return( rec_str + 10 );
|
|
||||||
}
|
|
||||||
|
|
||||||
void put_moto_s2_data_rec( Uint count, Ulong address, char * data_str )
|
|
||||||
{
|
|
||||||
char *ptr;
|
|
||||||
Uint sum = S2_COUNT_OFFSET + count + ( address >> 16 & 0xff ) +
|
|
||||||
( address >> 8 & 0xff ) +
|
|
||||||
( address & 0xff );
|
|
||||||
|
|
||||||
for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
|
|
||||||
sum += ( Uint ) get_ndigit_hex( ptr, 2 );
|
|
||||||
|
|
||||||
printf(
|
|
||||||
"S2%02X%06lX%s%02X\n",
|
|
||||||
count + S2_COUNT_OFFSET, address, data_str, ~sum & 0xff
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Rec_vitals motorola_s2_rec =
|
|
||||||
{
|
|
||||||
is_moto_s2_data_rec,
|
|
||||||
get_moto_s2_rec_address,
|
|
||||||
get_moto_s2_rec_data_count,
|
|
||||||
MAX_LEN_S2_RECS, /* Maximum data bytes in a record. */
|
|
||||||
get_moto_s2_rec_data_start,
|
|
||||||
put_moto_s2_data_rec
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*------------------------- Motorola S3-record format ------------------------*/
|
|
||||||
|
|
||||||
#define S3_COUNT_OFFSET 5
|
|
||||||
|
|
||||||
Boolean is_moto_s3_data_rec( char * rec_str )
|
|
||||||
{
|
|
||||||
return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '3' ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
Uint get_moto_s3_rec_data_count( char * rec_str )
|
|
||||||
{
|
|
||||||
return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S3_COUNT_OFFSET );
|
|
||||||
}
|
|
||||||
|
|
||||||
Ulong get_moto_s3_rec_address( char * rec_str )
|
|
||||||
{
|
|
||||||
return( get_ndigit_hex( rec_str + 4, 8 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
char * get_moto_s3_rec_data_start( char * rec_str )
|
|
||||||
{
|
|
||||||
return( rec_str + 12 );
|
|
||||||
}
|
|
||||||
|
|
||||||
void put_moto_s3_data_rec( Uint count, Ulong address, char * data_str )
|
|
||||||
{
|
|
||||||
char *ptr;
|
|
||||||
Uint sum = S3_COUNT_OFFSET + count + ( address >> 24 & 0xff ) +
|
|
||||||
( address >> 16 & 0xff ) +
|
|
||||||
( address >> 8 & 0xff ) +
|
|
||||||
( address & 0xff );
|
|
||||||
|
|
||||||
for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
|
|
||||||
sum += ( Uint ) get_ndigit_hex( ptr, 2 );
|
|
||||||
|
|
||||||
printf(
|
|
||||||
"S3%02X%08lX%s%02X\n",
|
|
||||||
count + S3_COUNT_OFFSET, address, data_str, ~sum & 0xff
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Rec_vitals motorola_s3_rec =
|
|
||||||
{
|
|
||||||
is_moto_s3_data_rec,
|
|
||||||
get_moto_s3_rec_address,
|
|
||||||
get_moto_s3_rec_data_count,
|
|
||||||
MAX_LEN_S3_RECS, /* Maximum data bytes in a record. */
|
|
||||||
get_moto_s3_rec_data_start,
|
|
||||||
put_moto_s3_data_rec
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*-------------------- Put your favorite hex format here ---------------------*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* * * * The following is a template for an additional hex format: * * *
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Boolean is_X_data_rec( char * rec_str ) {}
|
|
||||||
*
|
|
||||||
* Uint get_X_rec_data_count( char * rec_str ) {}
|
|
||||||
*
|
|
||||||
* Ulong get_X_rec_address( char * rec_str ) {}
|
|
||||||
*
|
|
||||||
* char * get_X_rec_data_start( char * rec_str ) {}
|
|
||||||
*
|
|
||||||
* void put_X_data_rec( Uint count, Ulong address, char * data_str ) {}
|
|
||||||
*
|
|
||||||
* Rec_vitals X_rec =
|
|
||||||
* {
|
|
||||||
* is_X_data_rec,
|
|
||||||
* get_X_rec_address,
|
|
||||||
* get_X_rec_data_count,
|
|
||||||
* MAXIMUM DATA BYTES IN A RECORD,
|
|
||||||
* get_X_rec_data_start,
|
|
||||||
* put_X_data_rec
|
|
||||||
* };
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Put address of additional Rec_vitals structures
|
|
||||||
* in this array, before the NULL entry.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Rec_vitals *formats[] =
|
|
||||||
{
|
|
||||||
&intel_hex,
|
|
||||||
&motorola_s1_rec,
|
|
||||||
&motorola_s2_rec,
|
|
||||||
&motorola_s3_rec,
|
|
||||||
( Rec_vitals * ) NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**** main *****************************************************************
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Expects: Nothing (no command-line parameters).
|
|
||||||
*
|
|
||||||
* Returns: Exit status (EXIT_SUCCESS or EXIT_FAILURE).
|
|
||||||
*
|
|
||||||
* Reads hex records on the standard input and attempts to
|
|
||||||
* splice adjacent data fields together. Results appear on
|
|
||||||
* the standard output.
|
|
||||||
*
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
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;
|
|
||||||
Ulong in_rec_addr, out_rec_addr = 0;
|
|
||||||
Rec_vitals *rptr;
|
|
||||||
|
|
||||||
|
|
||||||
/* Sift through file until first hex record is identified. */
|
|
||||||
if ( ( rptr = identify_first_data_record( inbuff ) ) == NULL )
|
|
||||||
{
|
|
||||||
fputs( "No hex records found.\n", stderr );
|
|
||||||
exit( EXIT_FAILURE );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Attempt data-record splicing until end-of-file is reached. */
|
|
||||||
d_total = 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if ( rptr->is_data_record( inbuff ) == YES )
|
|
||||||
{ /* Input record is a data record. */
|
|
||||||
d_count = rptr->get_data_count( inbuff );
|
|
||||||
in_rec_addr = rptr->get_address( inbuff );
|
|
||||||
in_dptr = rptr->get_data_start( inbuff );
|
|
||||||
|
|
||||||
if ( d_total == 0 || in_rec_addr != out_rec_addr + d_total )
|
|
||||||
{ /* Begin a new output record. */
|
|
||||||
if ( d_total != 0 )
|
|
||||||
rptr->put_data_record( d_total, out_rec_addr, outbuff );
|
|
||||||
out_dptr = outbuff;
|
|
||||||
n = d_total = d_count;
|
|
||||||
out_rec_addr = in_rec_addr;
|
|
||||||
}
|
|
||||||
else if
|
|
||||||
( ( d_excess = d_total + d_count - rptr->max_data_count ) > 0 )
|
|
||||||
{ /* Output a maximum-length record, then start a new record. */
|
|
||||||
strncat( outbuff, in_dptr, 2 * ( d_count - d_excess ) );
|
|
||||||
rptr->put_data_record(
|
|
||||||
rptr->max_data_count, out_rec_addr, outbuff
|
|
||||||
);
|
|
||||||
in_dptr += 2 * ( d_count - d_excess );
|
|
||||||
out_dptr = outbuff;
|
|
||||||
n = d_total = d_excess;
|
|
||||||
out_rec_addr += rptr->max_data_count;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ /* Append input record's data field with accumulated data. */
|
|
||||||
out_dptr = outbuff + ( 2 * d_total );
|
|
||||||
d_total += n = d_count;
|
|
||||||
}
|
|
||||||
strncpy( out_dptr, in_dptr, 2 * n );
|
|
||||||
out_dptr[ 2 * n ] = EOS;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ /* Not a data record;
|
|
||||||
* flush accumulated data then echo non-data record.
|
|
||||||
*/
|
|
||||||
if ( d_total != 0 )
|
|
||||||
{
|
|
||||||
rptr->put_data_record( d_total, out_rec_addr, outbuff );
|
|
||||||
d_total = 0;
|
|
||||||
}
|
|
||||||
puts( inbuff );
|
|
||||||
}
|
|
||||||
} while ( gets( inbuff ) != NULL );
|
|
||||||
|
|
||||||
|
|
||||||
exit( EXIT_SUCCESS );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**** identify_first_data_record *******************************************
|
|
||||||
*
|
|
||||||
* Expects: Pointer to hex-record line buffer.
|
|
||||||
*
|
|
||||||
* Returns: Pointer to hex-record structure (NULL if no match found).
|
|
||||||
*
|
|
||||||
* Reads the standard input, line by line, searching for a valid
|
|
||||||
* record header character. If a valid header is found, a pointer
|
|
||||||
* to the hex-record's type structure is returned, otherwise NULL.
|
|
||||||
*
|
|
||||||
* The input-stream pointer is left pointing to the first valid hex record.
|
|
||||||
*
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
Rec_vitals * identify_first_data_record( char * buff_ptr )
|
|
||||||
{
|
|
||||||
Rec_vitals ** ptr;
|
|
||||||
|
|
||||||
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. */
|
|
||||||
|
|
||||||
puts( buff_ptr ); /* Echo non-hex-record line. */
|
|
||||||
}
|
|
||||||
|
|
||||||
return( ( Rec_vitals * ) NULL ); /* Unsuccessful return. */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**** get_ndigit_hex *******************************************************
|
|
||||||
*
|
|
||||||
* Expects: Pointer to first ASCII hexadecimal digit, number of digits.
|
|
||||||
*
|
|
||||||
* Returns: Value of hexadecimal string as an unsigned long.
|
|
||||||
*
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
Ulong get_ndigit_hex( char * cptr, int digits )
|
|
||||||
{
|
|
||||||
Ulong value;
|
|
||||||
|
|
||||||
for ( value = 0 ; --digits >= 0 ; cptr++ )
|
|
||||||
value = ( value * 16L ) + HEX_DIGIT( *cptr );
|
|
||||||
|
|
||||||
return( value );
|
|
||||||
}
|
|
||||||
@@ -10,7 +10,6 @@
|
|||||||
* -v -- verbose
|
* -v -- verbose
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Log$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define GETOPTARGS "l:nNv"
|
#define GETOPTARGS "l:nNv"
|
||||||
@@ -27,6 +26,7 @@ maximum line length. The default maximum line length is 80.\n\
|
|||||||
";
|
";
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -261,8 +261,8 @@ error(int error_flag, ...)
|
|||||||
{
|
{
|
||||||
if (error_flag & ERR_FATAL)
|
if (error_flag & ERR_FATAL)
|
||||||
{
|
{
|
||||||
error(0, local_errno ? "fatal error, exiting" : "exiting");
|
error(0, "fatal error, exiting");
|
||||||
exit(local_errno);
|
exit(local_errno ? local_errno : 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
* -v -- verbose
|
* -v -- verbose
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Log$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define GETOPTARGS "vt"
|
#define GETOPTARGS "vt"
|
||||||
@@ -22,6 +21,7 @@ Strip the white space from the end of every line on the list of files.\n\
|
|||||||
";
|
";
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -248,8 +248,8 @@ error(int error_flag, ...)
|
|||||||
{
|
{
|
||||||
if (error_flag & ERR_FATAL)
|
if (error_flag & ERR_FATAL)
|
||||||
{
|
{
|
||||||
error(0, local_errno ? "fatal error, exiting" : "exiting");
|
error(0, "fatal error, exiting");
|
||||||
exit(local_errno);
|
exit(local_errno ? local_errno : 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
* 10..x data bytes in ascii-hex
|
* 10..x data bytes in ascii-hex
|
||||||
* x+1..x+2 cksum (2's compl of (len+addr+data))
|
* x+1..x+2 cksum (2's compl of (len+addr+data))
|
||||||
* x+3 \n -- newline
|
* x+3 \n -- newline
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char *USAGE = "\
|
char *USAGE = "\
|
||||||
@@ -86,7 +88,7 @@ void error(int errn, ...);
|
|||||||
#define ERR_ABORT (ERR_ERRNO / 4) /* error is fatal; abort */
|
#define ERR_ABORT (ERR_ERRNO / 4) /* error is fatal; abort */
|
||||||
#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
|
#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
|
||||||
|
|
||||||
#define stol(p) strtol(p, (char **) NULL, 0)
|
#define stol(p) strtoul(p, (char **) NULL, 0)
|
||||||
|
|
||||||
int unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
|
int unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
|
||||||
int convert_Intel_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
|
int convert_Intel_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
|
||||||
@@ -706,8 +708,8 @@ error(int error_flag, ...)
|
|||||||
{
|
{
|
||||||
if (error_flag & ERR_FATAL)
|
if (error_flag & ERR_FATAL)
|
||||||
{
|
{
|
||||||
error(0, local_errno ? "fatal error, exiting" : "exiting");
|
error(0, "fatal error, exiting");
|
||||||
exit(local_errno);
|
exit(local_errno ? local_errno : 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,719 +0,0 @@
|
|||||||
/*
|
|
||||||
* unhex
|
|
||||||
* convert a hex file to binary equivalent. If more than one file name
|
|
||||||
* is given, then the output will be logically concatenated together.
|
|
||||||
* stdin and stdout are defaults. Verbose will enable checksum output.
|
|
||||||
*
|
|
||||||
* Supported input formats are Intel hex, Motorola S records, and TI 'B'
|
|
||||||
* records.
|
|
||||||
*
|
|
||||||
* Intel hex input format is
|
|
||||||
* Byte
|
|
||||||
* 1 Colon :
|
|
||||||
* 2..3 Record length, eg: "20"
|
|
||||||
* 4..7 load address nibbles
|
|
||||||
* 8..9 record type: "00" (data) or "02" base addr
|
|
||||||
* 10..x data bytes in ascii-hex
|
|
||||||
* x+1..x+2 cksum (2's compl of (len+addr+data))
|
|
||||||
* x+3 \n -- newline
|
|
||||||
*/
|
|
||||||
|
|
||||||
char *USAGE = "\
|
|
||||||
usage: unhex [-va] [ -o file ] [ file [file ... ] ]\n\
|
|
||||||
-v -- verbose\n\
|
|
||||||
-a base -- 1st byte of output corresponds to this address\n\
|
|
||||||
-l -- linear, just writes data out\n\
|
|
||||||
-o file -- output file; must not be input file\n\
|
|
||||||
-F k_bits -- \"holes\" in input will be filled with 0xFF's\n\
|
|
||||||
up to \"k_bits\" * 1024 bits\n\
|
|
||||||
";
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#define OK 0
|
|
||||||
#define FAILURE (-1)
|
|
||||||
#define Failed(x) ((x) == FAILURE)
|
|
||||||
#define TRUE 1
|
|
||||||
#define FALSE 0
|
|
||||||
typedef char bool;
|
|
||||||
#define STREQ(a,b) (strcmp(a,b) == 0)
|
|
||||||
|
|
||||||
typedef unsigned char u8;
|
|
||||||
typedef unsigned short u16;
|
|
||||||
typedef unsigned long u32;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Pick out designated bytes
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define B0(x) ((x) & 0xff)
|
|
||||||
#define B1(x) B0((x) >> 8)
|
|
||||||
#define B2(x) B0((x) >> 16)
|
|
||||||
#define B3(x) B0((x) >> 24)
|
|
||||||
|
|
||||||
typedef struct buffer_rec {
|
|
||||||
u32 dl_destaddr;
|
|
||||||
u32 dl_jumpaddr;
|
|
||||||
int dl_count;
|
|
||||||
u8 dl_buf[512];
|
|
||||||
} buffer_rec;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* vars controlled by command line options
|
|
||||||
*/
|
|
||||||
|
|
||||||
bool verbose = FALSE; /* be verbose */
|
|
||||||
bool linear = FALSE; /* just write out linear data */
|
|
||||||
char *outfilename = "-"; /* default output is stdout */
|
|
||||||
u32 base = 0L; /* base address */
|
|
||||||
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() */
|
|
||||||
|
|
||||||
void error(int errn, ...);
|
|
||||||
#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
|
|
||||||
#define ERR_FATAL (ERR_ERRNO / 2) /* error is fatal; no return */
|
|
||||||
#define ERR_ABORT (ERR_ERRNO / 4) /* error is fatal; abort */
|
|
||||||
#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
|
|
||||||
|
|
||||||
#define stol(p) strtol(p, (char **) NULL, 0)
|
|
||||||
|
|
||||||
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);
|
|
||||||
int convert_TI_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
|
|
||||||
void write_record(buffer_rec *tb, FILE *fp);
|
|
||||||
int getnibble(char **p);
|
|
||||||
int getbyte(char **p);
|
|
||||||
long getNbytes(char **p, int n);
|
|
||||||
void badformat(char *s, char *fname, char *msg);
|
|
||||||
|
|
||||||
#define get1bytes(p) ((int) getbyte(p))
|
|
||||||
#define get2bytes(p) ((int) getNbytes(p, 2))
|
|
||||||
#define get3bytes(p) getNbytes(p, 3)
|
|
||||||
#define get4bytes(p) getNbytes(p, 4)
|
|
||||||
|
|
||||||
char *BADADDR = "Invalid record address";
|
|
||||||
char *BADLEN = "Invalid record length";
|
|
||||||
char *BADBASE = "Bad base or starting address";
|
|
||||||
char *BADFMT = "Unrecognized record type";
|
|
||||||
char *BADDATA = "Invalid data byte";
|
|
||||||
char *BADCSUM = "Invalid checksum";
|
|
||||||
char *MISCSUM = "Checksum mismatch";
|
|
||||||
char *BADTYPE = "Unrecognized record type";
|
|
||||||
char *MISTYPE = "Incompatible record types";
|
|
||||||
|
|
||||||
int
|
|
||||||
main(argc, argv)
|
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
{
|
|
||||||
register int c;
|
|
||||||
bool showusage = FALSE; /* usage error? */
|
|
||||||
int rc = 0;
|
|
||||||
FILE *outfp, *infp;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* figure out invocation leaf-name
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
|
|
||||||
progname = argv[0];
|
|
||||||
else
|
|
||||||
progname++;
|
|
||||||
|
|
||||||
argv[0] = progname; /* for getopt err reporting */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Check options and arguments.
|
|
||||||
*/
|
|
||||||
|
|
||||||
progname = argv[0];
|
|
||||||
while ((c = getopt(argc, argv, "F:a:o:vl")) != EOF)
|
|
||||||
switch (c)
|
|
||||||
{
|
|
||||||
case 'a': /* base address */
|
|
||||||
base = stol(optarg);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'l': /* linear output */
|
|
||||||
linear = TRUE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'v': /* toggle verbose */
|
|
||||||
verbose = ! verbose;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'o': /* output file */
|
|
||||||
outfilename = optarg;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'F': /* 0xFF fill amount (bytes) */
|
|
||||||
FFfill = stol(optarg) * 1024L / 8L;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '?':
|
|
||||||
showusage = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showusage)
|
|
||||||
{
|
|
||||||
(void) fprintf(stderr, "%s", USAGE);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (linear && (base != 0))
|
|
||||||
{
|
|
||||||
error(0, "-l and -a may not be specified in combination");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (STREQ(outfilename, "-"))
|
|
||||||
{
|
|
||||||
outfp = stdout;
|
|
||||||
outfilename = "stdout";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if ((outfp = fopen(outfilename, "w")) == (FILE *) NULL)
|
|
||||||
{
|
|
||||||
error(-1, "couldn't open '%s' for output", outfilename);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Now process the input files (or stdin, if none specified)
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (argv[optind] == (char *) NULL) /* just stdin */
|
|
||||||
exit(unhex(stdin, "stdin", outfp, outfilename));
|
|
||||||
else
|
|
||||||
for (; (optarg = argv[optind]); optind++)
|
|
||||||
{
|
|
||||||
if (STREQ(optarg, "-"))
|
|
||||||
rc += unhex(stdin, "stdin", outfp, outfilename);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((infp = fopen(optarg, "r")) == (FILE *) NULL)
|
|
||||||
{
|
|
||||||
error(-1, "couldn't open '%s' for input", optarg);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
rc += unhex(infp, optarg, outfp, outfilename);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return(rc);
|
|
||||||
}
|
|
||||||
|
|
||||||
u16 filesum;
|
|
||||||
|
|
||||||
int
|
|
||||||
unhex(FILE *ifp,
|
|
||||||
char *inm,
|
|
||||||
FILE *ofp,
|
|
||||||
char *onm)
|
|
||||||
{
|
|
||||||
int c;
|
|
||||||
|
|
||||||
filesum = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Make sure holes will be filled with 0xFF's if requested. We
|
|
||||||
* do this the easy way by just filling the file with FF's before
|
|
||||||
* getting started. To do it more optimally would be quite a bit
|
|
||||||
* more difficult since the user can skip around as much as he/she
|
|
||||||
* likes in the input hex file addressing.
|
|
||||||
*
|
|
||||||
* We'll clean this up later (after this program has run) with
|
|
||||||
* 'stripffs'
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (FFfill)
|
|
||||||
{
|
|
||||||
(void) fseek(ofp, 0, 0);
|
|
||||||
for (c = FFfill; c > 0; c--)
|
|
||||||
(void) fputc(0xFF, ofp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Read the first char from file and determine record types
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ((c = getc(ifp)) != EOF)
|
|
||||||
{
|
|
||||||
ungetc(c, ifp);
|
|
||||||
switch(c)
|
|
||||||
{
|
|
||||||
case 'S':
|
|
||||||
convert_S_records(ifp, inm, ofp, onm);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ':':
|
|
||||||
convert_Intel_records(ifp, inm, ofp, onm);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '9':
|
|
||||||
case 'B':
|
|
||||||
convert_TI_records(ifp, inm, ofp, onm);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
char tmp[2];
|
|
||||||
tmp[0] = c; tmp[1] = 0;
|
|
||||||
badformat(tmp, inm, BADFMT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (verbose)
|
|
||||||
fprintf(stderr, "'%s' checksum is 0x%04x\n", inm, filesum);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
convert_Intel_records(
|
|
||||||
FILE *ifp,
|
|
||||||
char *inm,
|
|
||||||
FILE *ofp,
|
|
||||||
char *onm)
|
|
||||||
{
|
|
||||||
char buff[512];
|
|
||||||
char *p;
|
|
||||||
u8 cksum;
|
|
||||||
int incksum;
|
|
||||||
int c;
|
|
||||||
int rectype; /* record type */
|
|
||||||
int len; /* data length of current line */
|
|
||||||
u32 addr;
|
|
||||||
u32 base_address = 0;
|
|
||||||
bool endrecord = FALSE;
|
|
||||||
buffer_rec tb;
|
|
||||||
|
|
||||||
while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
|
|
||||||
{
|
|
||||||
p = &buff[0];
|
|
||||||
|
|
||||||
if (p[strlen(p)-1] == '\n') /* get rid of newline */
|
|
||||||
p[strlen(p)-1] = '\0';
|
|
||||||
|
|
||||||
if (p[strlen(p)-1] == '\r') /* get rid of any CR */
|
|
||||||
p[strlen(p)-1] = '\0';
|
|
||||||
|
|
||||||
tb.dl_count = 0;
|
|
||||||
|
|
||||||
if (*p != ':')
|
|
||||||
badformat(p, inm, BADFMT);
|
|
||||||
p++;
|
|
||||||
|
|
||||||
if ((len = getbyte(&p)) == -1) /* record len */
|
|
||||||
badformat(buff, inm, BADLEN);
|
|
||||||
|
|
||||||
if ((addr = get2bytes(&p)) == -1L) /* record addr */
|
|
||||||
badformat(buff, inm, BADADDR);
|
|
||||||
|
|
||||||
rectype = getbyte(&p);
|
|
||||||
|
|
||||||
cksum = len + B0(addr) + B1(addr) + rectype;
|
|
||||||
|
|
||||||
switch (rectype)
|
|
||||||
{
|
|
||||||
case 0x00: /* normal data record */
|
|
||||||
tb.dl_destaddr = base_address + addr;
|
|
||||||
while (len--)
|
|
||||||
{
|
|
||||||
if ((c = getbyte(&p)) == -1)
|
|
||||||
badformat(buff, inm, BADDATA);
|
|
||||||
cksum += c;
|
|
||||||
filesum += c;
|
|
||||||
tb.dl_buf[tb.dl_count++] = c;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x01: /* execution start address */
|
|
||||||
base_address = addr;
|
|
||||||
endrecord = TRUE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x02: /* new base */
|
|
||||||
if ((base_address = get2bytes(&p)) == -1L)
|
|
||||||
badformat(buff, inm, BADBASE);
|
|
||||||
cksum += B0(base_address) + B1(base_address);
|
|
||||||
base_address <<= 4;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x03: /* seg/off execution start address */
|
|
||||||
{
|
|
||||||
u32 seg, off;
|
|
||||||
|
|
||||||
seg = get2bytes(&p);
|
|
||||||
off = get2bytes(&p);
|
|
||||||
if ((seg == -1L) || (off == -1L))
|
|
||||||
badformat(buff, inm, BADADDR);
|
|
||||||
|
|
||||||
cksum += B0(seg) + B1(seg) + B0(off) + B1(off);
|
|
||||||
|
|
||||||
tb.dl_jumpaddr = (seg << 4) + off;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
error(0, "unknown Intel-hex record type: 0x%02x", rectype);
|
|
||||||
badformat(buff, inm, BADTYPE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Verify checksums are correct in file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
cksum = (-cksum) & 0xff;
|
|
||||||
if ((incksum = getbyte(&p)) == -1)
|
|
||||||
badformat(buff, inm, BADCSUM);
|
|
||||||
if (((u8) incksum) != cksum)
|
|
||||||
badformat(buff, inm, MISCSUM);
|
|
||||||
|
|
||||||
if (tb.dl_count)
|
|
||||||
write_record(&tb, ofp);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
convert_S_records(
|
|
||||||
FILE *ifp,
|
|
||||||
char *inm,
|
|
||||||
FILE *ofp,
|
|
||||||
char *onm)
|
|
||||||
{
|
|
||||||
char buff[512];
|
|
||||||
char *p;
|
|
||||||
u8 cksum;
|
|
||||||
int incksum;
|
|
||||||
int c;
|
|
||||||
int len; /* data length of current line */
|
|
||||||
int rectype; /* record type */
|
|
||||||
u32 addr;
|
|
||||||
bool endrecord = FALSE;
|
|
||||||
buffer_rec tb;
|
|
||||||
|
|
||||||
while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
|
|
||||||
{
|
|
||||||
p = &buff[0];
|
|
||||||
|
|
||||||
if (p[strlen(p)-1] == '\n') /* get rid of newline */
|
|
||||||
p[strlen(p)-1] = '\0';
|
|
||||||
|
|
||||||
if (p[strlen(p)-1] == '\r') /* get rid of any CR */
|
|
||||||
p[strlen(p)-1] = '\0';
|
|
||||||
|
|
||||||
tb.dl_count = 0;
|
|
||||||
|
|
||||||
if (*p != 'S')
|
|
||||||
badformat(p, inm, BADFMT);
|
|
||||||
p++;
|
|
||||||
|
|
||||||
if ((rectype = getnibble(&p)) == -1) /* record type */
|
|
||||||
badformat(buff, inm, BADTYPE);
|
|
||||||
|
|
||||||
if ((len = getbyte(&p)) == -1) /* record len */
|
|
||||||
badformat(buff, inm, BADLEN);
|
|
||||||
cksum = len;
|
|
||||||
|
|
||||||
switch (rectype)
|
|
||||||
{
|
|
||||||
case 0x00: /* comment field, ignored */
|
|
||||||
goto write_it;
|
|
||||||
|
|
||||||
case 0x01: /* data record, 16 bit addr */
|
|
||||||
if ((addr = get2bytes(&p)) == -1L)
|
|
||||||
badformat(buff, inm, BADADDR);
|
|
||||||
len -= 3;
|
|
||||||
goto doit;
|
|
||||||
|
|
||||||
case 0x02: /* ... 24 bit addr */
|
|
||||||
if ((addr = get3bytes(&p)) == -1L)
|
|
||||||
badformat(buff, inm, BADADDR);
|
|
||||||
len -= 4;
|
|
||||||
goto doit;
|
|
||||||
|
|
||||||
case 0x03: /* ... 32 bit addr */
|
|
||||||
if ((addr = get4bytes(&p)) == -1L)
|
|
||||||
badformat(buff, inm, BADADDR);
|
|
||||||
len -= 5;
|
|
||||||
doit:
|
|
||||||
cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
|
|
||||||
|
|
||||||
tb.dl_destaddr = addr;
|
|
||||||
while (len--)
|
|
||||||
{
|
|
||||||
if ((c = getbyte(&p)) == -1)
|
|
||||||
badformat(buff, inm, BADDATA);
|
|
||||||
cksum += c;
|
|
||||||
filesum += c;
|
|
||||||
tb.dl_buf[tb.dl_count++] = c;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x07: /* 32 bit end record */
|
|
||||||
if ((addr = get4bytes(&p)) == -1L)
|
|
||||||
badformat(buff, inm, BADADDR);
|
|
||||||
goto end_rec;
|
|
||||||
|
|
||||||
case 0x08: /* 24 bit end record */
|
|
||||||
if ((addr = get3bytes(&p)) == -1L)
|
|
||||||
badformat(buff, inm, BADADDR);
|
|
||||||
goto end_rec;
|
|
||||||
|
|
||||||
case 0x09: /* 16 bit end record */
|
|
||||||
if ((addr = get2bytes(&p)) == -1L)
|
|
||||||
badformat(buff, inm, BADADDR);
|
|
||||||
|
|
||||||
end_rec:
|
|
||||||
cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
|
|
||||||
tb.dl_jumpaddr = addr;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
error(0, "unknown Motorola-S record type: 0x%02x", rectype);
|
|
||||||
badformat(buff, inm, BADTYPE);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Verify checksums are correct in file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
cksum = (~cksum) & 0xff;
|
|
||||||
if ((incksum = getbyte(&p)) == -1)
|
|
||||||
badformat(buff, inm, BADCSUM);
|
|
||||||
if (((u8) incksum) != cksum)
|
|
||||||
badformat(buff, inm, MISCSUM);
|
|
||||||
|
|
||||||
write_it:
|
|
||||||
if (tb.dl_count)
|
|
||||||
write_record(&tb, ofp);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
convert_TI_records(
|
|
||||||
FILE *ifp,
|
|
||||||
char *inm,
|
|
||||||
FILE *ofp,
|
|
||||||
char *onm)
|
|
||||||
{
|
|
||||||
char buff[512];
|
|
||||||
char *p;
|
|
||||||
int c;
|
|
||||||
bool endrecord = FALSE;
|
|
||||||
bool eol;
|
|
||||||
buffer_rec tb;
|
|
||||||
|
|
||||||
while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
|
|
||||||
{
|
|
||||||
if (p[strlen(p)-1] == '\n') /* get rid of newline */
|
|
||||||
p[strlen(p)-1] = '\0';
|
|
||||||
|
|
||||||
if (p[strlen(p)-1] == '\r') /* get rid of any CR */
|
|
||||||
p[strlen(p)-1] = '\0';
|
|
||||||
|
|
||||||
tb.dl_count = 0;
|
|
||||||
|
|
||||||
p = &buff[0];
|
|
||||||
eol = FALSE;
|
|
||||||
while ( ! eol && ! endrecord)
|
|
||||||
{
|
|
||||||
switch (*p++)
|
|
||||||
{
|
|
||||||
case '9':
|
|
||||||
if (tb.dl_count)
|
|
||||||
write_record(&tb, ofp);
|
|
||||||
tb.dl_destaddr = get2bytes(&p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'B':
|
|
||||||
c = getbyte(&p);
|
|
||||||
filesum += c;
|
|
||||||
tb.dl_buf[tb.dl_count++] = c;
|
|
||||||
c = getbyte(&p);
|
|
||||||
filesum += c;
|
|
||||||
tb.dl_buf[tb.dl_count++] = c;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'F':
|
|
||||||
eol = TRUE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ':':
|
|
||||||
endrecord = TRUE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
badformat(p, inm, BADFMT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (tb.dl_count)
|
|
||||||
write_record(&tb, ofp);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
write_record(buffer_rec *tb,
|
|
||||||
FILE *fp)
|
|
||||||
{
|
|
||||||
if ( ! linear)
|
|
||||||
{
|
|
||||||
if (tb->dl_destaddr < base)
|
|
||||||
error(ERR_FATAL, "record at address 0x%x precedes base of 0x%x",
|
|
||||||
tb->dl_destaddr, base);
|
|
||||||
(void) fseek(fp, tb->dl_destaddr - base, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
(void) fwrite(tb->dl_buf, tb->dl_count, 1, fp);
|
|
||||||
tb->dl_destaddr += tb->dl_count;
|
|
||||||
tb->dl_count = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
getnibble(char **p)
|
|
||||||
{
|
|
||||||
register int val;
|
|
||||||
|
|
||||||
**p = toupper(**p);
|
|
||||||
switch (**p)
|
|
||||||
{
|
|
||||||
case '0': case '1': case '2': case '3': case '4':
|
|
||||||
case '5': case '6': case '7': case '8': case '9':
|
|
||||||
val = **p - '0';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
|
|
||||||
val = 10 + (**p - 'A');
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return(-1);
|
|
||||||
}
|
|
||||||
*p += 1;
|
|
||||||
|
|
||||||
return(val & 0x0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
getbyte(char **p)
|
|
||||||
{
|
|
||||||
int n0, n1;
|
|
||||||
|
|
||||||
if ((n0 = getnibble(p)) == -1)
|
|
||||||
return(-1);
|
|
||||||
if ((n1 = getnibble(p)) == -1)
|
|
||||||
return(-1);
|
|
||||||
|
|
||||||
return(((n0 << 4) + n1) & 0xff);
|
|
||||||
}
|
|
||||||
|
|
||||||
long
|
|
||||||
getNbytes(char **p,
|
|
||||||
int n)
|
|
||||||
{
|
|
||||||
int t;
|
|
||||||
u32 val = 0;
|
|
||||||
|
|
||||||
while (n--)
|
|
||||||
{
|
|
||||||
if ((t = getbyte(p)) == -1)
|
|
||||||
return(-1L);
|
|
||||||
val <<= 8;
|
|
||||||
val += t;
|
|
||||||
}
|
|
||||||
|
|
||||||
return(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
badformat(char *s,
|
|
||||||
char *fname,
|
|
||||||
char *msg)
|
|
||||||
{
|
|
||||||
if (s[strlen(s)-1] == '\n') /* get rid of newline */
|
|
||||||
s[strlen(s)-1] = '\0';
|
|
||||||
error(0, "line '%s'::\n\tfrom file '%s'; %s", s, fname, msg);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* error(errn, arglist)
|
|
||||||
* report an error to stderr using printf(3) conventions.
|
|
||||||
* Any output is preceded by '<progname>: '
|
|
||||||
*
|
|
||||||
* Uses ERR_EXIT bit to request exit(errn)
|
|
||||||
* ERR_ABORT to request abort()
|
|
||||||
* ERR_ERRNO to indicate use of errno instead of argument.
|
|
||||||
*
|
|
||||||
* If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
|
|
||||||
* associated error message is appended to the output.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*VARARGS*/
|
|
||||||
|
|
||||||
void
|
|
||||||
error(int error_flag, ...)
|
|
||||||
{
|
|
||||||
va_list arglist;
|
|
||||||
register char *format;
|
|
||||||
extern char *sys_errlist[];
|
|
||||||
extern int sys_nerr;
|
|
||||||
int local_errno;
|
|
||||||
|
|
||||||
extern int errno;
|
|
||||||
|
|
||||||
(void) fflush(stdout); /* in case stdout/stderr same */
|
|
||||||
|
|
||||||
local_errno = error_flag & ~ERR_MASK;
|
|
||||||
if (error_flag & ERR_ERRNO) /* use errno? */
|
|
||||||
local_errno = errno;
|
|
||||||
|
|
||||||
va_start(arglist, error_flag);
|
|
||||||
format = va_arg(arglist, char *);
|
|
||||||
(void) fprintf(stderr, "%s: ", progname);
|
|
||||||
(void) vfprintf(stderr, format, arglist);
|
|
||||||
va_end(arglist);
|
|
||||||
|
|
||||||
if (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);
|
|
||||||
|
|
||||||
if (error_flag & (ERR_FATAL | ERR_ABORT))
|
|
||||||
{
|
|
||||||
if (error_flag & ERR_FATAL)
|
|
||||||
{
|
|
||||||
error(0, local_errno ? "fatal error, exiting" : "exiting");
|
|
||||||
exit(local_errno);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
error(0, "fatal error, aborting");
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
/* clock.h
|
|
||||||
*
|
|
||||||
* This file describes the Clock Driver for all boards.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __CLOCK_DRIVER_h
|
|
||||||
#define __CLOCK_DRIVER_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* variables */
|
|
||||||
|
|
||||||
extern volatile rtems_unsigned32 Clock_driver_ticks;
|
|
||||||
|
|
||||||
/* functions */
|
|
||||||
|
|
||||||
rtems_task Exit_task();
|
|
||||||
void exit_task_init();
|
|
||||||
|
|
||||||
void Install_clock( rtems_isr_entry );
|
|
||||||
void ReInstall_clock( rtems_isr_entry );
|
|
||||||
void Clock_exit();
|
|
||||||
|
|
||||||
rtems_isr Clock_isr(
|
|
||||||
rtems_vector_number
|
|
||||||
);
|
|
||||||
|
|
||||||
/* driver entries */
|
|
||||||
|
|
||||||
#define CLOCK_DRIVER_TABLE_ENTRY \
|
|
||||||
{ Clock_initialize, NULL, NULL, NULL, NULL, NULL }
|
|
||||||
|
|
||||||
rtems_device_driver Clock_initialize(
|
|
||||||
rtems_device_major_number,
|
|
||||||
rtems_device_minor_number,
|
|
||||||
void *,
|
|
||||||
rtems_id,
|
|
||||||
rtems_unsigned32 *
|
|
||||||
);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
/* console.h
|
|
||||||
*
|
|
||||||
* This file describes the Console Device Driver for all boards.
|
|
||||||
* This driver provides support for the standard C Library.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _CONSOLE_DRIVER_h
|
|
||||||
#define _CONSOLE_DRIVER_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CONSOLE_DRIVER_TABLE_ENTRY \
|
|
||||||
{ console_initialize, NULL, NULL, NULL, NULL, NULL }
|
|
||||||
|
|
||||||
rtems_device_driver console_initialize(
|
|
||||||
rtems_device_major_number,
|
|
||||||
rtems_device_minor_number,
|
|
||||||
void *,
|
|
||||||
rtems_id,
|
|
||||||
rtems_unsigned32 *
|
|
||||||
);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
/* iosupp.h
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __IOSUPP_h
|
|
||||||
#define __IOSUPP_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* character constants */
|
|
||||||
|
|
||||||
#define BS 0x08 /* backspace */
|
|
||||||
#define LF 0x0a /* line feed */
|
|
||||||
#define CR 0x0d /* carriage return */
|
|
||||||
#define XON 0x11 /* control-Q */
|
|
||||||
#define XOFF 0x13 /* control-S */
|
|
||||||
|
|
||||||
/* structures */
|
|
||||||
|
|
||||||
#ifdef IOSUPP_INIT
|
|
||||||
#define IOSUPP_EXTERN
|
|
||||||
#else
|
|
||||||
#undef IOSUPP_EXTERN
|
|
||||||
#define IOSUPP_EXTERN extern
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* functions */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
/* libcsupport.h
|
|
||||||
*
|
|
||||||
* This include file contains the information regarding the
|
|
||||||
* RTEMS specific support for the standard C library.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __LIBC_SUPPORT_h
|
|
||||||
#define __LIBC_SUPPORT_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
void RTEMS_Malloc_Initialize(
|
|
||||||
void *start,
|
|
||||||
size_t length,
|
|
||||||
size_t sbrk_amount
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void libc_init(int reentrant);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
/* spurious.h
|
|
||||||
*
|
|
||||||
* This file describes the Spurious Interrupt Driver for all boards.
|
|
||||||
*
|
|
||||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993.
|
|
||||||
* On-Line Applications Research Corporation (OAR).
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __SPURIOUS_h
|
|
||||||
#define __SPURIOUS_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SPURIOUS_DRIVER_TABLE_ENTRY \
|
|
||||||
{ Spurious_Initialize, NULL, NULL, NULL, NULL, NULL }
|
|
||||||
|
|
||||||
rtems_device_driver Spurious_Initialize(
|
|
||||||
rtems_device_major_number,
|
|
||||||
rtems_device_minor_number,
|
|
||||||
void *,
|
|
||||||
rtems_id,
|
|
||||||
rtems_unsigned32 *
|
|
||||||
);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
/* timerdrv.h
|
|
||||||
*
|
|
||||||
* This file describes the Timer Driver for all boards.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __TIMER_DRIVER_h
|
|
||||||
#define __TIMER_DRIVER_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* functions */
|
|
||||||
|
|
||||||
void Timer_initialize( void );
|
|
||||||
|
|
||||||
rtems_unsigned32 Read_timer( void );
|
|
||||||
|
|
||||||
rtems_status_code Empty_function( void );
|
|
||||||
|
|
||||||
void Set_find_average_overhead(
|
|
||||||
rtems_boolean find_flag
|
|
||||||
);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
/*
|
|
||||||
* vmeintr.h
|
|
||||||
*
|
|
||||||
* This file is the specification for the VMEbus interface library
|
|
||||||
* which should be provided by all BSPs for VMEbus Single Board
|
|
||||||
* Computers but currently only a few do so.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __VME_INTERRUPT_h
|
|
||||||
#define __VME_INTERRUPT_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This defines the mask which is used to determine which
|
|
||||||
* interrupt levels are affected by a call to this package.
|
|
||||||
* The LSB corresponds to VME interrupt 0 and the MSB
|
|
||||||
* to VME interrupt 7.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef rtems_unsigned8 VME_interrupt_Mask;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* VME_interrupt_Disable
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void VME_interrupt_Disable (
|
|
||||||
VME_interrupt_Mask mask /* IN */
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* VME_interrupt_Disable
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void VME_interrupt_Enable (
|
|
||||||
VME_interrupt_Mask mask /* IN */
|
|
||||||
);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* end of include file */
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
--
|
|
||||||
-- $Id$
|
|
||||||
--
|
|
||||||
|
|
||||||
Overview of newlib support (newlib is from CYGNUS)
|
|
||||||
Each task can have its own libc state including:
|
|
||||||
open stdio files
|
|
||||||
strtok
|
|
||||||
multi precision arithmetic state
|
|
||||||
etc.
|
|
||||||
|
|
||||||
This is implemented by a reentrancy data structure for each task.
|
|
||||||
|
|
||||||
When a task is "started" (in RTEMS sense) the reentrancy structure
|
|
||||||
is allocated. Its address is stored in notepad[NOTEPAD_LAST].
|
|
||||||
|
|
||||||
When task is switched to, the value of global variable _impure_ptr
|
|
||||||
is changed to the value of the new tasks reentrancy structure.
|
|
||||||
|
|
||||||
When a task is deleted
|
|
||||||
atexit() processing (for that task) happens
|
|
||||||
task's stdio buffers are flushed
|
|
||||||
|
|
||||||
When exit(3) is called
|
|
||||||
calling task's atexit processing done
|
|
||||||
global libc state atexit processing done
|
|
||||||
(this will include any atexit routines installed by drivers)
|
|
||||||
executive is shutdown
|
|
||||||
causes a context switch back to bsp land
|
|
||||||
|
|
||||||
|
|
||||||
NOTE:
|
|
||||||
libc extension are installed by bsp_libc_init()
|
|
||||||
iff we are using clock interrupts.
|
|
||||||
This hack is necessary to allow the tmtests to avoid
|
|
||||||
timing the extensions.
|
|
||||||
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
* RTEMS "Broken" __brk/__sbrk Implementation
|
|
||||||
*
|
|
||||||
* NOTE: sbrk is BSP provided.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <rtems.h>
|
|
||||||
|
|
||||||
#include <signal.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#ifdef RTEMS_NEWLIB
|
|
||||||
#include <reent.h>
|
|
||||||
#endif
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
/* we use RTEMS for memory management. We don't need sbrk */
|
|
||||||
|
|
||||||
void * __sbrk(int incr)
|
|
||||||
{
|
|
||||||
errno = EINVAL;
|
|
||||||
return (void *)0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int __brk( const void *endds )
|
|
||||||
{
|
|
||||||
errno = EINVAL;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
#if !defined(RTEMS_UNIX)
|
|
||||||
/*
|
|
||||||
* RTEMS gettimeofday Implementation
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <rtems.h>
|
|
||||||
|
|
||||||
#ifdef RTEMS_NEWLIB
|
|
||||||
#include <sys/reent.h>
|
|
||||||
#endif
|
|
||||||
#include <time.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* NOTE: The solaris gettimeofday does not have a second parameter.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int gettimeofday(
|
|
||||||
struct timeval *tp,
|
|
||||||
struct timezone *tzp
|
|
||||||
)
|
|
||||||
{
|
|
||||||
rtems_status_code status;
|
|
||||||
rtems_clock_time_value time;
|
|
||||||
|
|
||||||
if ( !tp || !tzp ) {
|
|
||||||
errno = EFAULT;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* "POSIX" does not seem to allow for not having a TOD */
|
|
||||||
status = rtems_clock_get( RTEMS_CLOCK_GET_TIME_VALUE, &time );
|
|
||||||
if ( status != RTEMS_SUCCESSFUL ) {
|
|
||||||
assert( 0 );
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
tp->tv_sec = time.seconds;
|
|
||||||
tp->tv_usec = time.microseconds;
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
tzp->minuteswest = timezone / 60; /* from seconds to minutes */
|
|
||||||
tzp->dsttime = daylight;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* newlib does not have timezone and daylight savings time
|
|
||||||
* yet. When it does this needs to be fixed.
|
|
||||||
*/
|
|
||||||
|
|
||||||
tzp->tz_minuteswest = 0; /* at UTC */
|
|
||||||
tzp->tz_dsttime = 0; /* no daylight savings */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "Reentrant" versions of the above routines implemented above.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
int _gettimeofday_r(
|
|
||||||
struct _reent *ignored_reentrancy_stuff,
|
|
||||||
struct timeval *tp,
|
|
||||||
struct timezone *tzp
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return gettimeofday( tp, tzp );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
/*
|
|
||||||
* RTEMS _times Implementation
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <rtems.h>
|
|
||||||
|
|
||||||
#include <sys/times.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
clock_t _times(
|
|
||||||
struct tms *ptms
|
|
||||||
)
|
|
||||||
{
|
|
||||||
rtems_status_code status;
|
|
||||||
rtems_interval ticks_since_boot;
|
|
||||||
|
|
||||||
if ( !ptms ) {
|
|
||||||
errno = EFAULT;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* "POSIX" does not seem to allow for not having a TOD */
|
|
||||||
status = rtems_clock_get(
|
|
||||||
RTEMS_CLOCK_GET_TICKS_SINCE_BOOT,
|
|
||||||
&ticks_since_boot
|
|
||||||
);
|
|
||||||
if ( status != RTEMS_SUCCESSFUL ) {
|
|
||||||
assert( 0 );
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* RTEMS has no notion of system versus user time and does
|
|
||||||
* not (as of 3.2.0) keep track of CPU usage on a per task basis.
|
|
||||||
*/
|
|
||||||
|
|
||||||
ptms->tms_utime = ticks_since_boot;
|
|
||||||
ptms->tms_stime = 0;
|
|
||||||
ptms->tms_cutime = 0;
|
|
||||||
ptms->tms_cstime = 0;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
clock_t times(
|
|
||||||
struct tms *ptms
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return _times( ptms );
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,280 +0,0 @@
|
|||||||
/*
|
|
||||||
* RTEMS Malloc Family Implementation
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <rtems.h>
|
|
||||||
#ifdef RTEMS_LIBC
|
|
||||||
#include <memory.h>
|
|
||||||
#endif
|
|
||||||
#include "libcsupport.h"
|
|
||||||
#ifdef RTEMS_NEWLIB
|
|
||||||
#include <sys/reent.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* XXX: Do we really need to duplicate these? It appears that they
|
|
||||||
* only cause typing problems.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
void *malloc(size_t);
|
|
||||||
void *calloc(size_t, size_t);
|
|
||||||
void *realloc(void *, size_t);
|
|
||||||
void free(void *);
|
|
||||||
void *sbrk(size_t);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rtems_id RTEMS_Malloc_Heap;
|
|
||||||
size_t RTEMS_Malloc_Sbrk_amount;
|
|
||||||
|
|
||||||
void RTEMS_Malloc_Initialize(
|
|
||||||
void *start,
|
|
||||||
size_t length,
|
|
||||||
size_t sbrk_amount
|
|
||||||
)
|
|
||||||
{
|
|
||||||
rtems_status_code status;
|
|
||||||
void *starting_address;
|
|
||||||
rtems_unsigned32 u32_address;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If the starting address is 0 then we are to attempt to
|
|
||||||
* get length worth of memory using sbrk. Make sure we
|
|
||||||
* align the address that we get back.
|
|
||||||
*/
|
|
||||||
|
|
||||||
starting_address = start;
|
|
||||||
|
|
||||||
if (!starting_address) {
|
|
||||||
u32_address = (unsigned int)sbrk(length);
|
|
||||||
|
|
||||||
if (u32_address == -1) {
|
|
||||||
rtems_fatal_error_occurred( RTEMS_NO_MEMORY );
|
|
||||||
/* DOES NOT RETURN!!! */
|
|
||||||
}
|
|
||||||
|
|
||||||
if (u32_address & (CPU_ALIGNMENT-1)) {
|
|
||||||
u32_address = (u32_address + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
|
|
||||||
/* XXX: if we do any alignment .. then length should be shortened */
|
|
||||||
}
|
|
||||||
|
|
||||||
starting_address = (void *)u32_address;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Unfortunately we cannot use assert if this fails because if this
|
|
||||||
* has failed we do not have a heap and if we do not have a heap
|
|
||||||
* STDIO cannot work because there will be no buffers.
|
|
||||||
*/
|
|
||||||
|
|
||||||
status = rtems_region_create(
|
|
||||||
rtems_build_name( 'H', 'E', 'A', 'P' ),
|
|
||||||
starting_address,
|
|
||||||
length,
|
|
||||||
8, /* XXX : use CPU dependent RTEMS constant */
|
|
||||||
RTEMS_DEFAULT_ATTRIBUTES,
|
|
||||||
&RTEMS_Malloc_Heap
|
|
||||||
);
|
|
||||||
if ( status != RTEMS_SUCCESSFUL )
|
|
||||||
rtems_fatal_error_occurred( status );
|
|
||||||
}
|
|
||||||
|
|
||||||
void *malloc(
|
|
||||||
size_t size
|
|
||||||
)
|
|
||||||
{
|
|
||||||
void *return_this;
|
|
||||||
void *starting_address;
|
|
||||||
rtems_unsigned32 the_size;
|
|
||||||
rtems_unsigned32 sbrk_amount;
|
|
||||||
rtems_status_code status;
|
|
||||||
|
|
||||||
if ( !size )
|
|
||||||
return (void *) 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Try to give a segment in the current region if there is not
|
|
||||||
* enough space then try to grow the region using rtems_region_extend().
|
|
||||||
* If this fails then return a NULL pointer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
status = rtems_region_get_segment(
|
|
||||||
RTEMS_Malloc_Heap,
|
|
||||||
size,
|
|
||||||
RTEMS_NO_WAIT,
|
|
||||||
RTEMS_NO_TIMEOUT,
|
|
||||||
&return_this
|
|
||||||
);
|
|
||||||
|
|
||||||
if ( status != RTEMS_SUCCESSFUL ) {
|
|
||||||
/*
|
|
||||||
* Round to the "requested sbrk amount" so hopefully we won't have
|
|
||||||
* to grow again for a while. This effectively does sbrk() calls
|
|
||||||
* in "page" amounts.
|
|
||||||
*/
|
|
||||||
|
|
||||||
sbrk_amount = RTEMS_Malloc_Sbrk_amount;
|
|
||||||
|
|
||||||
if ( sbrk_amount == 0 )
|
|
||||||
return (void *) 0;
|
|
||||||
|
|
||||||
the_size = ((size + sbrk_amount) / sbrk_amount * sbrk_amount);
|
|
||||||
|
|
||||||
if (((rtems_unsigned32)starting_address = sbrk(the_size)) == -1)
|
|
||||||
return (void *) 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
fprintf(stderr, "Extended the C heap starting at 0x%x for %d bytes\n",
|
|
||||||
(unsigned32)starting_address, the_size);
|
|
||||||
*/
|
|
||||||
|
|
||||||
status = rtems_region_extend(
|
|
||||||
RTEMS_Malloc_Heap,
|
|
||||||
starting_address,
|
|
||||||
the_size
|
|
||||||
);
|
|
||||||
if ( status != RTEMS_SUCCESSFUL ) {
|
|
||||||
sbrk(-the_size);
|
|
||||||
return(FALSE);
|
|
||||||
errno = ENOMEM;
|
|
||||||
return (void *) 0;
|
|
||||||
}
|
|
||||||
status = rtems_region_get_segment(
|
|
||||||
RTEMS_Malloc_Heap,
|
|
||||||
size,
|
|
||||||
RTEMS_NO_WAIT,
|
|
||||||
RTEMS_NO_TIMEOUT,
|
|
||||||
&return_this
|
|
||||||
);
|
|
||||||
if ( status != RTEMS_SUCCESSFUL ) {
|
|
||||||
errno = ENOMEM;
|
|
||||||
return (void *) 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return return_this;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *calloc(
|
|
||||||
size_t nelem,
|
|
||||||
size_t elsize
|
|
||||||
)
|
|
||||||
{
|
|
||||||
register char *cptr;
|
|
||||||
int length;
|
|
||||||
|
|
||||||
length = nelem * elsize;
|
|
||||||
cptr = malloc( length );
|
|
||||||
if ( cptr )
|
|
||||||
memset( cptr, '\0', length );
|
|
||||||
|
|
||||||
return cptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *realloc(
|
|
||||||
void *ptr,
|
|
||||||
size_t size
|
|
||||||
)
|
|
||||||
{
|
|
||||||
rtems_unsigned32 old_size;
|
|
||||||
rtems_status_code status;
|
|
||||||
char *new_area;
|
|
||||||
|
|
||||||
if ( !ptr )
|
|
||||||
return malloc( size );
|
|
||||||
|
|
||||||
if ( !size ) {
|
|
||||||
free( ptr );
|
|
||||||
return (void *) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &old_size );
|
|
||||||
if ( status != RTEMS_SUCCESSFUL ) {
|
|
||||||
errno = EINVAL;
|
|
||||||
return (void *) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
new_area = malloc( size );
|
|
||||||
if ( !new_area ) {
|
|
||||||
free( ptr );
|
|
||||||
return (void *) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
|
|
||||||
free( ptr );
|
|
||||||
|
|
||||||
return new_area;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void free(
|
|
||||||
void *ptr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
rtems_status_code status;
|
|
||||||
|
|
||||||
if ( !ptr )
|
|
||||||
return;
|
|
||||||
|
|
||||||
status = rtems_region_return_segment( RTEMS_Malloc_Heap, ptr );
|
|
||||||
if ( status != RTEMS_SUCCESSFUL ) {
|
|
||||||
errno = EINVAL;
|
|
||||||
assert( 0 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "Reentrant" versions of the above routines implemented above.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef RTEMS_NEWLIB
|
|
||||||
void *malloc_r(
|
|
||||||
struct _reent *ignored,
|
|
||||||
size_t size
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return malloc( size );
|
|
||||||
}
|
|
||||||
|
|
||||||
void *calloc_r(
|
|
||||||
size_t nelem,
|
|
||||||
size_t elsize
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return calloc( nelem, elsize );
|
|
||||||
}
|
|
||||||
|
|
||||||
void *realloc_r(
|
|
||||||
void *ptr,
|
|
||||||
size_t size
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return realloc_r( ptr, size );
|
|
||||||
}
|
|
||||||
|
|
||||||
void free_r(
|
|
||||||
void *ptr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
free( ptr );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,292 +0,0 @@
|
|||||||
/*
|
|
||||||
* @(#)newlibc.c 1.8 - 95/04/25
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(RTEMS_NEWLIB)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* File: $RCSfile$
|
|
||||||
* Project: PixelFlow
|
|
||||||
* Created: 94/12/7
|
|
||||||
* Revision: $Revision$
|
|
||||||
* Last Mod: $Date$
|
|
||||||
*
|
|
||||||
* COPYRIGHT (c) 1994 by Division Incorporated
|
|
||||||
*
|
|
||||||
* To anyone who acknowledges that this file is provided "AS IS"
|
|
||||||
* without any express or implied warranty:
|
|
||||||
* permission to use, copy, modify, and distribute this file
|
|
||||||
* for any purpose is hereby granted without fee, provided that
|
|
||||||
* the above copyright notice and this notice appears in all
|
|
||||||
* copies, and that the name of Division Incorporated not be
|
|
||||||
* used in advertising or publicity pertaining to distribution
|
|
||||||
* of the software without specific, written prior permission.
|
|
||||||
* Division Incorporated makes no representations about the
|
|
||||||
* suitability of this software for any purpose.
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Implementation of hooks for the CYGNUS newlib libc
|
|
||||||
* These hooks set things up so that:
|
|
||||||
* '_REENT' is switched at task switch time.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* TODO:
|
|
||||||
*
|
|
||||||
* NOTE:
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <rtems.h>
|
|
||||||
#include <libcsupport.h>
|
|
||||||
#include <stdlib.h> /* for free() */
|
|
||||||
#include <string.h> /* for memset() */
|
|
||||||
|
|
||||||
#include <sys/reent.h> /* for extern of _REENT (aka _impure_ptr) */
|
|
||||||
|
|
||||||
#include "internal.h"
|
|
||||||
|
|
||||||
#define LIBC_NOTEPAD RTEMS_NOTEPAD_LAST
|
|
||||||
|
|
||||||
|
|
||||||
int libc_reentrant; /* do we think we are reentrant? */
|
|
||||||
struct _reent libc_global_reent = _REENT_INIT(libc_global_reent);;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* CYGNUS newlib routine that does atexit() processing and flushes
|
|
||||||
* stdio streams
|
|
||||||
* undocumented
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern void _wrapup_reent(struct _reent *);
|
|
||||||
extern void _reclaim_reent(struct _reent *);
|
|
||||||
|
|
||||||
void
|
|
||||||
libc_wrapup(void)
|
|
||||||
{
|
|
||||||
_wrapup_reent(0);
|
|
||||||
if (_REENT != &libc_global_reent)
|
|
||||||
{
|
|
||||||
_wrapup_reent(&libc_global_reent);
|
|
||||||
#if 0
|
|
||||||
/* don't reclaim this one, just in case we do printfs */
|
|
||||||
/* on our way out to ROM */
|
|
||||||
_reclaim_reent(&libc_global_reent);
|
|
||||||
#endif
|
|
||||||
_REENT = &libc_global_reent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
rtems_extension
|
|
||||||
libc_create_hook(rtems_tcb *current_task,
|
|
||||||
rtems_tcb *creating_task)
|
|
||||||
{
|
|
||||||
MY_task_set_note(creating_task, LIBC_NOTEPAD, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Called for all user TASKS (system tasks are SYSI and IDLE)
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_extension
|
|
||||||
libc_start_hook(rtems_tcb *current_task,
|
|
||||||
rtems_tcb *starting_task)
|
|
||||||
{
|
|
||||||
struct _reent *ptr;
|
|
||||||
|
|
||||||
/* NOTE: our malloc is reentrant without a reent ptr since
|
|
||||||
* it is based on region manager
|
|
||||||
*/
|
|
||||||
|
|
||||||
ptr = (struct _reent *) malloc(sizeof(struct _reent));
|
|
||||||
|
|
||||||
/* GCC extension: structure constants */
|
|
||||||
*ptr = (struct _reent) _REENT_INIT((*ptr));
|
|
||||||
|
|
||||||
MY_task_set_note(starting_task, LIBC_NOTEPAD, (rtems_unsigned32) ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
rtems_extension
|
|
||||||
libc_switch_hook(rtems_tcb *current_task,
|
|
||||||
rtems_tcb *heir_task)
|
|
||||||
{
|
|
||||||
rtems_unsigned32 impure_value;
|
|
||||||
|
|
||||||
/* XXX We can't use rtems_task_set_note() here since SYSI task has a
|
|
||||||
* tid of 0, which is treated specially (optimized, actually)
|
|
||||||
* by rtems_task_set_note
|
|
||||||
*/
|
|
||||||
|
|
||||||
impure_value = (rtems_unsigned32) _REENT;
|
|
||||||
MY_task_set_note(current_task, LIBC_NOTEPAD, impure_value);
|
|
||||||
|
|
||||||
_REENT = (struct _reent *) MY_task_get_note(heir_task, LIBC_NOTEPAD);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Function: libc_delete_hook
|
|
||||||
* Created: 94/12/10
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Called when a task is deleted.
|
|
||||||
* Must restore the new lib reentrancy state for the new current
|
|
||||||
* task.
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Side Effects:
|
|
||||||
*
|
|
||||||
* Notes:
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Deficiencies/ToDo:
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
rtems_extension
|
|
||||||
libc_delete_hook(rtems_tcb *current_task,
|
|
||||||
rtems_tcb *deleted_task)
|
|
||||||
{
|
|
||||||
struct _reent *ptr;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The reentrancy structure was allocated by newlib using malloc()
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (current_task == deleted_task)
|
|
||||||
{
|
|
||||||
ptr = _REENT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ptr)
|
|
||||||
{
|
|
||||||
_wrapup_reent(ptr);
|
|
||||||
_reclaim_reent(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
MY_task_set_note(deleted_task, LIBC_NOTEPAD, 0);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Require the switch back to another task to install its own
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (current_task == deleted_task)
|
|
||||||
{
|
|
||||||
_REENT = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Function: libc_init
|
|
||||||
* Created: 94/12/10
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Init libc for CYGNUS newlib
|
|
||||||
* Set up _REENT to use our global libc_global_reent.
|
|
||||||
* (newlib provides a global of its own, but we prefer our
|
|
||||||
* own name for it)
|
|
||||||
*
|
|
||||||
* If reentrancy is desired (which it should be), then
|
|
||||||
* we install the task extension hooks to maintain the
|
|
||||||
* newlib reentrancy global variable _REENT on task
|
|
||||||
* create, delete, switch, exit, etc.
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* reentrant non-zero if reentrant library desired.
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
*
|
|
||||||
* Side Effects:
|
|
||||||
* installs libc extensions if reentrant.
|
|
||||||
*
|
|
||||||
* Notes:
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Deficiencies/ToDo:
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
|
||||||
libc_init(int reentrant)
|
|
||||||
{
|
|
||||||
rtems_extensions_table libc_extension;
|
|
||||||
rtems_id extension_id;
|
|
||||||
rtems_status_code rc;
|
|
||||||
|
|
||||||
_REENT = &libc_global_reent;
|
|
||||||
|
|
||||||
if (reentrant)
|
|
||||||
{
|
|
||||||
memset(&libc_extension, 0, sizeof(libc_extension));
|
|
||||||
|
|
||||||
libc_extension.rtems_task_create = libc_create_hook;
|
|
||||||
libc_extension.rtems_task_start = libc_start_hook;
|
|
||||||
libc_extension.task_switch = libc_switch_hook;
|
|
||||||
libc_extension.rtems_task_delete = libc_delete_hook;
|
|
||||||
|
|
||||||
rc = rtems_extension_create(rtems_build_name('L', 'I', 'B', 'C'),
|
|
||||||
&libc_extension, &extension_id);
|
|
||||||
if (rc != RTEMS_SUCCESSFUL)
|
|
||||||
rtems_fatal_error_occurred(rc);
|
|
||||||
|
|
||||||
libc_reentrant = reentrant;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
exit(int status)
|
|
||||||
{
|
|
||||||
libc_wrapup();
|
|
||||||
rtems_shutdown_executive(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Function: _exit
|
|
||||||
* Created: 94/12/10
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Called from exit() after it does atexit() processing and stdio fflush's
|
|
||||||
*
|
|
||||||
* called from bottom of exit() to really delete the task.
|
|
||||||
* If we are using reentrant libc, then let the delete extension
|
|
||||||
* do all the work, otherwise if a shutdown is in progress,
|
|
||||||
* then just do it.
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* exit status
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* does not return
|
|
||||||
*
|
|
||||||
* Side Effects:
|
|
||||||
*
|
|
||||||
* Notes:
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Deficiencies/ToDo:
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef RTEMS_UNIX
|
|
||||||
void _exit(int status)
|
|
||||||
{
|
|
||||||
rtems_shutdown_executive(status);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
#if !defined(RTEMS_LIBC) && !defined(RTEMS_NEWLIB) && !defined(RTEMS_UNIX)
|
|
||||||
|
|
||||||
/* no_libc.h
|
|
||||||
*
|
|
||||||
* This file contains stubs for the reentrancy hooks when
|
|
||||||
* an unknown C library is used.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include <rtems.h>
|
|
||||||
|
|
||||||
#include "libcsupport.h"
|
|
||||||
#include "internal.h"
|
|
||||||
|
|
||||||
#include <stdlib.h> /* for free() */
|
|
||||||
|
|
||||||
void
|
|
||||||
libc_init(int reentrant)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void libc_suspend_main(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void libc_global_exit(rtems_unsigned32 code)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void _exit(int status)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#if defined(RTEMS_UNIXLIB)
|
|
||||||
|
|
||||||
void libc_init(int reentrant)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/modes.h>
|
#include <rtems/rtems/modes.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@@ -54,11 +54,12 @@ typedef rtems_asr ( *rtems_asr_entry )(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
rtems_asr_entry handler; /* address of RTEMS_ASR */
|
boolean is_enabled; /* are ASRs enabled currently? */
|
||||||
rtems_mode mode_set; /* RTEMS_ASR mode */
|
rtems_asr_entry handler; /* address of RTEMS_ASR */
|
||||||
rtems_signal_set signals_posted; /* signal set */
|
Modes_Control mode_set; /* RTEMS_ASR mode */
|
||||||
rtems_signal_set signals_pending; /* pending signal set */
|
rtems_signal_set signals_posted; /* signal set */
|
||||||
unsigned32 nest_level; /* nest level of RTEMS_ASR */
|
rtems_signal_set signals_pending; /* pending signal set */
|
||||||
|
unsigned32 nest_level; /* nest level of RTEMS_ASR */
|
||||||
} ASR_Information;
|
} ASR_Information;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -99,75 +100,9 @@ typedef struct {
|
|||||||
#define RTEMS_SIGNAL_30 0x40000000
|
#define RTEMS_SIGNAL_30 0x40000000
|
||||||
#define RTEMS_SIGNAL_31 0x80000000
|
#define RTEMS_SIGNAL_31 0x80000000
|
||||||
|
|
||||||
/*
|
#ifndef __RTEMS_APPLICATION__
|
||||||
* _ASR_Initialize
|
#include <rtems/rtems/asr.inl>
|
||||||
*
|
#endif
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine initializes the given RTEMS_ASR information record.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _ASR_Initialize (
|
|
||||||
ASR_Information *information
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _ASR_Swap_signals
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine atomically swaps the pending and posted signal
|
|
||||||
* sets. This is done when the thread alters its mode in such a
|
|
||||||
* way that the RTEMS_ASR disable/enable flag changes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _ASR_Swap_signals (
|
|
||||||
ASR_Information *information
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _ASR_Is_null_handler
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the given asr_handler is NULL and
|
|
||||||
* FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _ASR_Is_null_handler (
|
|
||||||
rtems_asr_entry asr_handler
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _ASR_Are_signals_pending
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if there are signals pending in the
|
|
||||||
* given RTEMS_ASR information record and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _ASR_Are_signals_pending (
|
|
||||||
ASR_Information *information
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _ASR_Post_signals
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine posts the given signals into the signal_set
|
|
||||||
* passed in. The result is returned to the user in signal_set.
|
|
||||||
*
|
|
||||||
* NOTE: This must be implemented as a macro.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _ASR_Post_signals(
|
|
||||||
rtems_signal_set signals,
|
|
||||||
rtems_signal_set *signal_set
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/asr.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ typedef unsigned32 rtems_attribute;
|
|||||||
|
|
||||||
/* constants */
|
/* constants */
|
||||||
|
|
||||||
#define RTEMS_DEFAULT_ATTRIBUTES 0x00000000
|
#define RTEMS_DEFAULT_ATTRIBUTES 0x00000000
|
||||||
|
|
||||||
#define RTEMS_NO_FLOATING_POINT 0x00000000 /* don't use FP HW */
|
#define RTEMS_NO_FLOATING_POINT 0x00000000 /* don't use FP HW */
|
||||||
#define RTEMS_FLOATING_POINT 0x00000001 /* utilize coprocessor */
|
#define RTEMS_FLOATING_POINT 0x00000001 /* utilize coprocessor */
|
||||||
@@ -38,15 +38,15 @@ typedef unsigned32 rtems_attribute;
|
|||||||
#define RTEMS_FIFO 0x00000000 /* process RTEMS_FIFO */
|
#define RTEMS_FIFO 0x00000000 /* process RTEMS_FIFO */
|
||||||
#define RTEMS_PRIORITY 0x00000004 /* process by priority */
|
#define RTEMS_PRIORITY 0x00000004 /* process by priority */
|
||||||
|
|
||||||
#define RTEMS_NO_LIMIT 0x00000000 /* unlimited Q entries */
|
|
||||||
#define RTEMS_LIMIT 0x00000008 /* limit Q entries */
|
|
||||||
|
|
||||||
#define RTEMS_COUNTING_SEMAPHORE 0x00000000
|
#define RTEMS_COUNTING_SEMAPHORE 0x00000000
|
||||||
#define RTEMS_BINARY_SEMAPHORE 0x00000010
|
#define RTEMS_BINARY_SEMAPHORE 0x00000010
|
||||||
|
|
||||||
#define RTEMS_NO_INHERIT_PRIORITY 0x00000000
|
#define RTEMS_NO_INHERIT_PRIORITY 0x00000000
|
||||||
#define RTEMS_INHERIT_PRIORITY 0x00000020
|
#define RTEMS_INHERIT_PRIORITY 0x00000020
|
||||||
|
|
||||||
|
#define RTEMS_NO_PRIORITY_CEILING 0x00000000
|
||||||
|
#define RTEMS_PRIORITY_CEILING 0x00000040
|
||||||
|
|
||||||
#if ( CPU_HARDWARE_FP == TRUE )
|
#if ( CPU_HARDWARE_FP == TRUE )
|
||||||
#define ATTRIBUTES_NOT_SUPPORTED 0
|
#define ATTRIBUTES_NOT_SUPPORTED 0
|
||||||
#else
|
#else
|
||||||
@@ -72,113 +72,9 @@ typedef unsigned32 rtems_attribute;
|
|||||||
|
|
||||||
#define _Attributes_Handler_initialization()
|
#define _Attributes_Handler_initialization()
|
||||||
|
|
||||||
/*
|
#ifndef __RTEMS_APPLICATION__
|
||||||
* _Attributes_Set
|
#include <rtems/rtems/attr.inl>
|
||||||
*
|
#endif
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function sets the requested new_attributes in the attribute_set
|
|
||||||
* passed in. The result is returned to the user.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE rtems_attribute _Attributes_Set (
|
|
||||||
rtems_attribute new_attributes,
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Clear
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function clears the requested new_attributes in the attribute_set
|
|
||||||
* passed in. The result is returned to the user.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE rtems_attribute _Attributes_Clear (
|
|
||||||
rtems_attribute attribute_set,
|
|
||||||
rtems_attribute mask
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Is_floating_point
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the floating point attribute is
|
|
||||||
* enabled in the attribute_set and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_floating_point(
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Is_global
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the global object attribute is
|
|
||||||
* enabled in the attribute_set and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_global(
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Is_priority
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the priority attribute is
|
|
||||||
* enabled in the attribute_set and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_priority(
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Is_limit
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the limited attribute is
|
|
||||||
* enabled in the attribute_set and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_limit(
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Is_binary_semaphore
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the binary semaphore attribute is
|
|
||||||
* enabled in the attribute_set and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_binary_semaphore(
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Is_inherit_priority
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the priority inheritance attribute
|
|
||||||
* is enabled in the attribute_set and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_inherit_priority(
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/attr.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
|
#include <rtems/rtems/types.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* List of things which can be returned by the rtems_clock_get directive.
|
* List of things which can be returned by the rtems_clock_get directive.
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/object.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following structure defines the port control block. Each port
|
* The following structure defines the port control block. Each port
|
||||||
@@ -78,7 +78,7 @@ void _Dual_ported_memory_Manager_initialization(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_port_create(
|
rtems_status_code rtems_port_create(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
void *internal_start,
|
void *internal_start,
|
||||||
void *external_start,
|
void *external_start,
|
||||||
unsigned32 length,
|
unsigned32 length,
|
||||||
@@ -96,7 +96,7 @@ rtems_status_code rtems_port_create(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_port_ident(
|
rtems_status_code rtems_port_ident(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -145,62 +145,9 @@ rtems_status_code rtems_port_internal_to_external(
|
|||||||
void **external
|
void **external
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
#ifndef __RTEMS_APPLICATION__
|
||||||
* _Dual_ported_memory_Allocate
|
#include <rtems/rtems/dpmem.inl>
|
||||||
*
|
#endif
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine allocates a port control block from the inactive chain
|
|
||||||
* of free port control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Dual_ported_memory_Control
|
|
||||||
*_Dual_ported_memory_Allocate ( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Dual_ported_memory_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a port control block to the inactive chain
|
|
||||||
* of free port control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Dual_ported_memory_Free (
|
|
||||||
Dual_ported_memory_Control *the_port
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Dual_ported_memory_Get
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function maps port IDs to port control blocks. If ID
|
|
||||||
* corresponds to a local port, then it returns the_port control
|
|
||||||
* pointer which maps to ID and location is set to OBJECTS_LOCAL.
|
|
||||||
* Global ports are not supported, thus if ID does not map to a
|
|
||||||
* local port, location is set to OBJECTS_ERROR and the_port is
|
|
||||||
* undefined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
|
|
||||||
Objects_Id id,
|
|
||||||
Objects_Locations *location
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Dual_ported_memory_Is_null
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_port is NULL and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Dual_ported_memory_Is_null(
|
|
||||||
Dual_ported_memory_Control *the_port
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/dpmem.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,11 +28,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/options.h>
|
#include <rtems/rtems/types.h>
|
||||||
#include <rtems/thread.h>
|
#include <rtems/rtems/options.h>
|
||||||
#include <rtems/watchdog.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/eventset.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
#include <rtems/rtems/eventset.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This constant is passed as the event_in to the
|
* This constant is passed as the event_in to the
|
||||||
@@ -42,14 +43,16 @@ extern "C" {
|
|||||||
#define EVENT_CURRENT 0
|
#define EVENT_CURRENT 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _Event_Manager_initialization
|
* The following enumerated types indicate what happened while the event
|
||||||
*
|
* manager was in the synchronization window.
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the initialization necessary for this manager.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE void _Event_Manager_initialization( void );
|
typedef enum {
|
||||||
|
EVENT_SYNC_SYNCHRONIZED,
|
||||||
|
EVENT_SYNC_NOTHING_HAPPENED,
|
||||||
|
EVENT_SYNC_TIMEOUT,
|
||||||
|
EVENT_SYNC_SATISFIED
|
||||||
|
} Event_Sync_states;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* rtems_event_send
|
* rtems_event_send
|
||||||
@@ -104,9 +107,10 @@ rtems_status_code rtems_event_receive (
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void _Event_Seize (
|
void _Event_Seize (
|
||||||
rtems_event_set event_in,
|
rtems_event_set event_in,
|
||||||
rtems_option option_set,
|
rtems_option option_set,
|
||||||
rtems_interval ticks
|
rtems_interval ticks,
|
||||||
|
rtems_event_set *event_out
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -145,10 +149,12 @@ void _Event_Timeout (
|
|||||||
* executing thread are received properly.
|
* executing thread are received properly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EXTERN boolean _Event_Sync; /* event manager sync flag */
|
EXTERN volatile Event_Sync_states _Event_Sync_state;
|
||||||
|
|
||||||
#include <rtems/event.inl>
|
#include <rtems/rtems/eventmp.h>
|
||||||
#include <rtems/eventmp.h>
|
#ifndef __RTEMS_APPLICATION__
|
||||||
|
#include <rtems/rtems/event.inl>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/event.h>
|
#include <rtems/rtems/event.h>
|
||||||
#include <rtems/mppkt.h>
|
#include <rtems/score/mppkt.h>
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following enumerated type defines the list of
|
* The following enumerated type defines the list of
|
||||||
@@ -34,7 +34,7 @@ extern "C" {
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EVENT_MP_SEND_REQUEST = 0,
|
EVENT_MP_SEND_REQUEST = 0,
|
||||||
EVENT_MP_SEND_RESPONSE = 1,
|
EVENT_MP_SEND_RESPONSE = 1
|
||||||
} Event_MP_Remote_operations;
|
} Event_MP_Remote_operations;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -43,9 +43,9 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
rtems_packet_prefix Prefix;
|
rtems_packet_prefix Prefix;
|
||||||
Event_MP_Remote_operations operation;
|
Event_MP_Remote_operations operation;
|
||||||
rtems_event_set event_in;
|
rtems_event_set event_in;
|
||||||
} Event_MP_Packet;
|
} Event_MP_Packet;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -77,62 +77,9 @@ typedef unsigned32 rtems_event_set;
|
|||||||
|
|
||||||
#define EVENT_SETS_NONE_PENDING 0
|
#define EVENT_SETS_NONE_PENDING 0
|
||||||
|
|
||||||
/*
|
#ifndef __RTEMS_APPLICATION__
|
||||||
* _Event_sets_Is_empty
|
#include <rtems/rtems/eventset.inl>
|
||||||
*
|
#endif
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if on events are posted in the event_set,
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Event_sets_Is_empty(
|
|
||||||
rtems_event_set the_event_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_sets_Post
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine posts the given new_events into the event_set
|
|
||||||
* passed in. The result is returned to the user in event_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Event_sets_Post(
|
|
||||||
rtems_event_set the_new_events,
|
|
||||||
rtems_event_set *the_event_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_sets_Get
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns the events in event_condition which are
|
|
||||||
* set in event_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE rtems_event_set _Event_sets_Get(
|
|
||||||
rtems_event_set the_event_set,
|
|
||||||
rtems_event_set the_event_condition
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_sets_Clear
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function removes the events in mask from the event_set
|
|
||||||
* passed in. The result is returned to the user in event_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE rtems_event_set _Event_sets_Clear(
|
|
||||||
rtems_event_set the_event_set,
|
|
||||||
rtems_event_set the_mask
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/eventset.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/isr.h>
|
#include <rtems/score/isr.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Interrupt level type
|
* Interrupt level type
|
||||||
@@ -29,6 +29,27 @@ extern "C" {
|
|||||||
|
|
||||||
typedef ISR_Level rtems_interrupt_level;
|
typedef ISR_Level rtems_interrupt_level;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following type defines the control block used to manage
|
||||||
|
* the vectors.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef ISR_Vector_number rtems_vector_number;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return type for ISR Handler
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef void rtems_isr;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Pointer to an ISR Handler
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef rtems_isr ( *rtems_isr_entry )(
|
||||||
|
rtems_vector_number
|
||||||
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _Interrupt_Manager_initialization
|
* _Interrupt_Manager_initialization
|
||||||
*
|
*
|
||||||
@@ -93,6 +114,20 @@ rtems_status_code rtems_interrupt_catch(
|
|||||||
#define rtems_interrupt_flash( _isr_cookie ) \
|
#define rtems_interrupt_flash( _isr_cookie ) \
|
||||||
_ISR_Flash(_isr_cookie)
|
_ISR_Flash(_isr_cookie)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* rtems_interrupt_is_in_progress
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if the processor is currently servicing
|
||||||
|
* and interrupt and FALSE otherwise. A return value of TRUE indicates
|
||||||
|
* that the caller is an interrupt service routine, NOT a thread. The
|
||||||
|
* directives available to an interrupt service routine are restricted.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define rtems_interrupt_is_in_progress() \
|
||||||
|
_ISR_Is_in_progress()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* rtems_interrupt_cause
|
* rtems_interrupt_cause
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -34,31 +34,23 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/chain.h>
|
#include <rtems/rtems/types.h>
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/chain.h>
|
||||||
#include <rtems/threadq.h>
|
#include <rtems/score/object.h>
|
||||||
|
#include <rtems/rtems/attr.h>
|
||||||
|
#include <rtems/score/threadq.h>
|
||||||
|
#include <rtems/score/coremsg.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following defines the data types needed to manipulate
|
* The following enumerated type details the modes in which a message
|
||||||
* the contents of message buffers.
|
* may be submitted to a message queue. The message may be posted
|
||||||
|
* in a send or urgent fashion.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef enum {
|
||||||
unsigned32 field1;
|
MESSAGE_QUEUE_SEND_REQUEST = 0,
|
||||||
unsigned32 field2;
|
MESSAGE_QUEUE_URGENT_REQUEST = 1
|
||||||
unsigned32 field3;
|
} Message_queue_Submit_types;
|
||||||
unsigned32 field4;
|
|
||||||
} Message_queue_Buffer;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following records define the organization of a message
|
|
||||||
* buffer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
Chain_Node Node;
|
|
||||||
Message_queue_Buffer Contents;
|
|
||||||
} Message_queue_Buffer_control;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following records define the control block used to manage
|
* The following records define the control block used to manage
|
||||||
@@ -66,12 +58,9 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Objects_Control Object;
|
Objects_Control Object;
|
||||||
Thread_queue_Control Wait_queue;
|
rtems_attribute attribute_set;
|
||||||
rtems_attribute attribute_set;
|
CORE_message_queue_Control message_queue;
|
||||||
unsigned32 maximum_pending_messages;
|
|
||||||
unsigned32 number_of_pending_messages;
|
|
||||||
Chain_Control Pending_messages;
|
|
||||||
} Message_queue_Control;
|
} Message_queue_Control;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -81,24 +70,6 @@ typedef struct {
|
|||||||
|
|
||||||
EXTERN Objects_Information _Message_queue_Information;
|
EXTERN Objects_Information _Message_queue_Information;
|
||||||
|
|
||||||
/*
|
|
||||||
* The following defines the data structures used to
|
|
||||||
* manage the pool of inactive message buffers.
|
|
||||||
*/
|
|
||||||
|
|
||||||
EXTERN Chain_Control _Message_queue_Inactive_messages;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following enumerated type details the modes in which a message
|
|
||||||
* may be submitted to a message queue. The message may be posted
|
|
||||||
* in a send or urgent fashion.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
MESSAGE_QUEUE_SEND_REQUEST = 0,
|
|
||||||
MESSAGE_QUEUE_URGENT_REQUEST = 1
|
|
||||||
} Message_queue_Submit_types;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _Message_queue_Manager_initialization
|
* _Message_queue_Manager_initialization
|
||||||
*
|
*
|
||||||
@@ -108,8 +79,7 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void _Message_queue_Manager_initialization(
|
void _Message_queue_Manager_initialization(
|
||||||
unsigned32 maximum_message_queues,
|
unsigned32 maximum_message_queues
|
||||||
unsigned32 maximum_messages
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -126,10 +96,11 @@ void _Message_queue_Manager_initialization(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_message_queue_create(
|
rtems_status_code rtems_message_queue_create(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
unsigned32 count,
|
unsigned32 count,
|
||||||
|
unsigned32 max_message_size,
|
||||||
rtems_attribute attribute_set,
|
rtems_attribute attribute_set,
|
||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -147,7 +118,7 @@ rtems_status_code rtems_message_queue_create(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_message_queue_ident(
|
rtems_status_code rtems_message_queue_ident(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
unsigned32 node,
|
unsigned32 node,
|
||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
);
|
);
|
||||||
@@ -183,7 +154,8 @@ rtems_status_code rtems_message_queue_delete(
|
|||||||
|
|
||||||
rtems_status_code rtems_message_queue_send(
|
rtems_status_code rtems_message_queue_send(
|
||||||
Objects_Id id,
|
Objects_Id id,
|
||||||
void *buffer
|
void *buffer,
|
||||||
|
unsigned32 size
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -204,7 +176,8 @@ rtems_status_code rtems_message_queue_send(
|
|||||||
|
|
||||||
rtems_status_code rtems_message_queue_urgent(
|
rtems_status_code rtems_message_queue_urgent(
|
||||||
Objects_Id id,
|
Objects_Id id,
|
||||||
void *buffer
|
void *buffer,
|
||||||
|
unsigned32 size
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -226,6 +199,7 @@ rtems_status_code rtems_message_queue_urgent(
|
|||||||
rtems_status_code rtems_message_queue_broadcast(
|
rtems_status_code rtems_message_queue_broadcast(
|
||||||
Objects_Id id,
|
Objects_Id id,
|
||||||
void *buffer,
|
void *buffer,
|
||||||
|
unsigned32 size,
|
||||||
unsigned32 *count
|
unsigned32 *count
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -246,8 +220,9 @@ rtems_status_code rtems_message_queue_broadcast(
|
|||||||
rtems_status_code rtems_message_queue_receive(
|
rtems_status_code rtems_message_queue_receive(
|
||||||
Objects_Id id,
|
Objects_Id id,
|
||||||
void *buffer,
|
void *buffer,
|
||||||
|
unsigned32 *size,
|
||||||
unsigned32 option_set,
|
unsigned32 option_set,
|
||||||
rtems_interval timeout
|
rtems_interval timeout
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -266,146 +241,26 @@ rtems_status_code rtems_message_queue_flush(
|
|||||||
unsigned32 *count
|
unsigned32 *count
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Copy_buffer
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine copies the contents of the source message buffer
|
|
||||||
* to the destination message buffer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Copy_buffer (
|
|
||||||
Message_queue_Buffer *source,
|
|
||||||
Message_queue_Buffer *destination
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Seize
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine attempts to receive a message from the_message_queue.
|
|
||||||
* If a message is available or if the RTEMS_NO_WAIT option is enabled in
|
|
||||||
* option_set, then the routine returns. Otherwise, the calling task
|
|
||||||
* is blocked until a message is available. If a message is returned
|
|
||||||
* to the task, then buffer will contain its contents.
|
|
||||||
*/
|
|
||||||
|
|
||||||
boolean _Message_queue_Seize(
|
|
||||||
Message_queue_Control *the_message_queue,
|
|
||||||
unsigned32 option_set,
|
|
||||||
Message_queue_Buffer *buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Flush_support
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine flushes all outstanding messages and returns
|
|
||||||
* them to the inactive message chain.
|
|
||||||
*/
|
|
||||||
|
|
||||||
unsigned32 _Message_queue_Flush_support(
|
|
||||||
Message_queue_Control *the_message_queue
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _Message_queue_Submit
|
* _Message_queue_Submit
|
||||||
*
|
*
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
*
|
*
|
||||||
* This routine provides the common foundation for the
|
* This routine implements the directives rtems_message_queue_send
|
||||||
* rtems_message_queue_send and rtems_message_queue_urgent directives.
|
* and rtems_message_queue_urgent. It processes a message that is
|
||||||
|
* to be submitted to the designated message queue. The message will
|
||||||
|
* either be processed as a send send message which it will be inserted
|
||||||
|
* at the rear of the queue or it will be processed as an urgent message
|
||||||
|
* which will be inserted at the front of the queue.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code _Message_queue_Submit(
|
rtems_status_code _Message_queue_Submit(
|
||||||
Objects_Id id,
|
Objects_Id id,
|
||||||
Message_queue_Buffer *buffer,
|
void *buffer,
|
||||||
|
unsigned32 size,
|
||||||
Message_queue_Submit_types submit_type
|
Message_queue_Submit_types submit_type
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Allocate_message_buffer
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function allocates a message buffer from the inactive
|
|
||||||
* message buffer chain.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Message_queue_Buffer_control *
|
|
||||||
_Message_queue_Allocate_message_buffer ( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Free_message_buffer
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a message buffer to the inactive
|
|
||||||
* message buffer chain.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Free_message_buffer (
|
|
||||||
Message_queue_Buffer_control *the_message
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Get_pending_message
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function removes the first message from the_message_queue
|
|
||||||
* and returns a pointer to it.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE
|
|
||||||
Message_queue_Buffer_control *_Message_queue_Get_pending_message (
|
|
||||||
Message_queue_Control *the_message_queue
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Append
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine places the_message at the rear of the outstanding
|
|
||||||
* messages on the_message_queue.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Append (
|
|
||||||
Message_queue_Control *the_message_queue,
|
|
||||||
Message_queue_Buffer_control *the_message
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Prepend
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine places the_message at the rear of the outstanding
|
|
||||||
* messages on the_message_queue.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Prepend (
|
|
||||||
Message_queue_Control *the_message_queue,
|
|
||||||
Message_queue_Buffer_control *the_message
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Is_null
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function places the_message at the rear of the outstanding
|
|
||||||
* messages on the_message_queue.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Message_queue_Is_null (
|
|
||||||
Message_queue_Control *the_message_queue
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _Message_queue_Allocate
|
* _Message_queue_Allocate
|
||||||
*
|
*
|
||||||
@@ -415,43 +270,44 @@ STATIC INLINE boolean _Message_queue_Is_null (
|
|||||||
* the inactive chain of free message queue control blocks.
|
* the inactive chain of free message queue control blocks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE Message_queue_Control *_Message_queue_Allocate ( void );
|
Message_queue_Control *_Message_queue_Allocate (
|
||||||
|
unsigned32 count,
|
||||||
/*
|
unsigned32 max_message_size
|
||||||
* _Message_queue_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine allocates a message queue control block from
|
|
||||||
* the inactive chain of free message queue control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Free (
|
|
||||||
Message_queue_Control *the_message_queue
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _Message_queue_Get
|
* _Message_queue_Translate_core_message_queue_return_code
|
||||||
*
|
*
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
*
|
*
|
||||||
* This function maps message queue IDs to message queue control
|
* This function returns a RTEMS status code based on the core message queue
|
||||||
* blocks. If ID corresponds to a local message queue, then it
|
* status code specified.
|
||||||
* returns the_message_queue 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_message_queue is undefined.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE Message_queue_Control *_Message_queue_Get (
|
rtems_status_code _Message_queue_Translate_core_message_queue_return_code (
|
||||||
Objects_Id id,
|
unsigned32 the_message_queue_status
|
||||||
Objects_Locations *location
|
|
||||||
);
|
);
|
||||||
|
|
||||||
#include <rtems/message.inl>
|
/*
|
||||||
#include <rtems/msgmp.h>
|
*
|
||||||
|
* _Message_queue_Core_message_queue_mp_support
|
||||||
|
*
|
||||||
|
* Input parameters:
|
||||||
|
* the_thread - the remote thread the message was submitted to
|
||||||
|
* id - id of the message queue
|
||||||
|
*
|
||||||
|
* Output parameters: NONE
|
||||||
|
*/
|
||||||
|
|
||||||
|
void _Message_queue_Core_message_queue_mp_support (
|
||||||
|
Thread_Control *the_thread,
|
||||||
|
Objects_Id id
|
||||||
|
);
|
||||||
|
|
||||||
|
#ifndef __RTEMS_APPLICATION__
|
||||||
|
#include <rtems/rtems/message.inl>
|
||||||
|
#endif
|
||||||
|
#include <rtems/rtems/msgmp.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,14 +21,14 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/isr.h>
|
#include <rtems/score/isr.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following type defines the control block used to manage
|
* The following type defines the control block used to manage
|
||||||
* each a mode set.
|
* each a mode set.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef unsigned32 rtems_mode;
|
typedef unsigned32 Modes_Control;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following constants define the individual modes and masks
|
* The following constants define the individual modes and masks
|
||||||
@@ -59,7 +59,8 @@ typedef unsigned32 rtems_mode;
|
|||||||
* RTEMS supports 0 to 256 levels in bits 0-7 of the mode.
|
* RTEMS supports 0 to 256 levels in bits 0-7 of the mode.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*PAGE
|
||||||
|
*
|
||||||
* RTEMS_INTERRUPT_LEVEL
|
* RTEMS_INTERRUPT_LEVEL
|
||||||
*
|
*
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
@@ -72,108 +73,13 @@ typedef unsigned32 rtems_mode;
|
|||||||
* particular CPU, fewer than 256 levels may be supported.
|
* particular CPU, fewer than 256 levels may be supported.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE unsigned32 RTEMS_INTERRUPT_LEVEL (
|
#define RTEMS_INTERRUPT_LEVEL( _mode_set ) \
|
||||||
rtems_mode mode_set
|
( (_mode_set) & RTEMS_INTERRUPT_MASK )
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
#ifndef __RTEMS_APPLICATION__
|
||||||
* _Modes_Mask_changed
|
#include <rtems/rtems/modes.inl>
|
||||||
*
|
#endif
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if any of the mode flags in mask
|
|
||||||
* are set in mode_set, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Modes_Mask_changed (
|
|
||||||
rtems_mode mode_set,
|
|
||||||
rtems_mode masks
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Modes_Is_asr_disabled
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if mode_set indicates that Asynchronous
|
|
||||||
* Signal Processing is disabled, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Modes_Is_asr_disabled (
|
|
||||||
rtems_mode mode_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Modes_Is_preempt
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if mode_set indicates that preemption
|
|
||||||
* is enabled, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Modes_Is_preempt (
|
|
||||||
rtems_mode mode_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Modes_Is_timeslice
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if mode_set indicates that timeslicing
|
|
||||||
* is enabled, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Modes_Is_timeslice (
|
|
||||||
rtems_mode mode_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Modes_Get_interrupt_level
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns the interrupt level portion of the mode_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE ISR_Level _Modes_Get_interrupt_level (
|
|
||||||
rtems_mode mode_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Modes_Set_interrupt_level
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine sets the current interrupt level to that specified
|
|
||||||
* in the mode_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Modes_Set_interrupt_level (
|
|
||||||
rtems_mode mode_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Modes_Change
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine changes the modes in old_mode_set indicated by
|
|
||||||
* mask to the requested values in new_mode_set. The resulting
|
|
||||||
* mode set is returned in out_mode_set and the modes that changed
|
|
||||||
* is returned in changed.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Modes_Change (
|
|
||||||
rtems_mode old_mode_set,
|
|
||||||
rtems_mode new_mode_set,
|
|
||||||
rtems_mode mask,
|
|
||||||
rtems_mode *out_mode_set,
|
|
||||||
rtems_mode *changed
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/modes.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,20 +45,6 @@ void _Multiprocessing_Manager_initialization ( void );
|
|||||||
|
|
||||||
void rtems_multiprocessing_announce ( void );
|
void rtems_multiprocessing_announce ( void );
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* _Multiprocessing_Receive_server
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine is a server thread which processes remote requests
|
|
||||||
* from other nodes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Thread _Multiprocessing_Receive_server (
|
|
||||||
Thread_Argument ignored
|
|
||||||
);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -21,12 +21,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/message.h>
|
#include <rtems/rtems/message.h>
|
||||||
#include <rtems/mppkt.h>
|
#include <rtems/score/mppkt.h>
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/options.h>
|
#include <rtems/rtems/options.h>
|
||||||
#include <rtems/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following enumerated type defines the list of
|
* The following enumerated type defines the list of
|
||||||
@@ -55,16 +55,15 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
rtems_packet_prefix Prefix;
|
rtems_packet_prefix Prefix;
|
||||||
Message_queue_MP_Remote_operations operation;
|
Message_queue_MP_Remote_operations operation;
|
||||||
Objects_Name name;
|
rtems_name name;
|
||||||
rtems_option option_set;
|
rtems_option option_set;
|
||||||
Objects_Id proxy_id;
|
Objects_Id proxy_id;
|
||||||
unsigned32 count;
|
unsigned32 count;
|
||||||
|
unsigned32 size;
|
||||||
unsigned32 pad0;
|
unsigned32 pad0;
|
||||||
unsigned32 pad1;
|
CORE_message_queue_Buffer Buffer;
|
||||||
unsigned32 pad2;
|
|
||||||
Message_queue_Buffer Buffer;
|
|
||||||
} Message_queue_MP_Packet;
|
} Message_queue_MP_Packet;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -79,7 +78,7 @@ typedef struct {
|
|||||||
void _Message_queue_MP_Send_process_packet (
|
void _Message_queue_MP_Send_process_packet (
|
||||||
Message_queue_MP_Remote_operations operation,
|
Message_queue_MP_Remote_operations operation,
|
||||||
Objects_Id message_queue_id,
|
Objects_Id message_queue_id,
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
Objects_Id proxy_id
|
Objects_Id proxy_id
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -95,9 +94,10 @@ void _Message_queue_MP_Send_process_packet (
|
|||||||
rtems_status_code _Message_queue_MP_Send_request_packet (
|
rtems_status_code _Message_queue_MP_Send_request_packet (
|
||||||
Message_queue_MP_Remote_operations operation,
|
Message_queue_MP_Remote_operations operation,
|
||||||
Objects_Id message_queue_id,
|
Objects_Id message_queue_id,
|
||||||
Message_queue_Buffer *buffer,
|
void *buffer,
|
||||||
rtems_option option_set,
|
unsigned32 *size_p,
|
||||||
rtems_interval timeout
|
rtems_option option_set,
|
||||||
|
Watchdog_Interval timeout
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -41,35 +41,9 @@ typedef unsigned32 rtems_option;
|
|||||||
#define RTEMS_EVENT_ALL 0x00000000 /* wait for all events */
|
#define RTEMS_EVENT_ALL 0x00000000 /* wait for all events */
|
||||||
#define RTEMS_EVENT_ANY 0x00000002 /* wait on any event */
|
#define RTEMS_EVENT_ANY 0x00000002 /* wait on any event */
|
||||||
|
|
||||||
/*
|
#ifndef __RTEMS_APPLICATION__
|
||||||
* _Options_Is_no_wait
|
#include <rtems/rtems/options.inl>
|
||||||
*
|
#endif
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the RTEMS_NO_WAIT option is enabled in
|
|
||||||
* option_set, and FALSE otherwise.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Options_Is_no_wait (
|
|
||||||
rtems_option option_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Options_Is_any
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the RTEMS_EVENT_ANY option is enabled in
|
|
||||||
* OPTION_SET, and FALSE otherwise.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Options_Is_any (
|
|
||||||
rtems_option option_set
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/options.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,9 +31,10 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/address.h>
|
#include <rtems/score/address.h>
|
||||||
#include <rtems/attr.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/object.h>
|
#include <rtems/rtems/attr.h>
|
||||||
|
#include <rtems/rtems/types.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following defines the control block used to manage each partition.
|
* The following defines the control block used to manage each partition.
|
||||||
@@ -83,7 +84,7 @@ void _Partition_Manager_initialization(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_partition_create(
|
rtems_status_code rtems_partition_create(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
void *starting_address,
|
void *starting_address,
|
||||||
unsigned32 length,
|
unsigned32 length,
|
||||||
unsigned32 buffer_size,
|
unsigned32 buffer_size,
|
||||||
@@ -106,7 +107,7 @@ rtems_status_code rtems_partition_create(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_partition_ident(
|
rtems_status_code rtems_partition_ident(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
unsigned32 node,
|
unsigned32 node,
|
||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
);
|
);
|
||||||
@@ -154,133 +155,10 @@ rtems_status_code rtems_partition_return_buffer(
|
|||||||
void *buffer
|
void *buffer
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
#ifndef __RTEMS_APPLICATION__
|
||||||
* _Partition_Allocate_buffer
|
#include <rtems/rtems/part.inl>
|
||||||
*
|
#endif
|
||||||
* DESCRIPTION:
|
#include <rtems/rtems/partmp.h>
|
||||||
*
|
|
||||||
* This function attempts to allocate a buffer from the_partition.
|
|
||||||
* If successful, it returns the address of the allocated buffer.
|
|
||||||
* Otherwise, it returns NULL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void *_Partition_Allocate_buffer (
|
|
||||||
Partition_Control *the_partition
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Free_buffer
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees the_buffer to the_partition.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Partition_Free_buffer (
|
|
||||||
Partition_Control *the_partition,
|
|
||||||
Chain_Node *the_buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Is_buffer_on_boundary
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_buffer is on a valid buffer
|
|
||||||
* boundary for the_partition, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Partition_Is_buffer_on_boundary (
|
|
||||||
void *the_buffer,
|
|
||||||
Partition_Control *the_partition
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Is_buffer_valid
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_buffer is a valid buffer from
|
|
||||||
* the_partition, otherwise FALSE is returned.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Partition_Is_buffer_valid (
|
|
||||||
Chain_Node *the_buffer,
|
|
||||||
Partition_Control *the_partition
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Is_buffer_size_aligned
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the use of the specified buffer_size
|
|
||||||
* will result in the allocation of buffers whose first byte is
|
|
||||||
* properly aligned, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Partition_Is_buffer_size_aligned (
|
|
||||||
unsigned32 buffer_size
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Allocate
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function allocates a partition control block from
|
|
||||||
* the inactive chain of free partition control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Partition_Control *_Partition_Allocate ( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a partition control block to the
|
|
||||||
* inactive chain of free partition control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Partition_Free (
|
|
||||||
Partition_Control *the_partition
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Get
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function maps partition IDs to partition control blocks.
|
|
||||||
* If ID corresponds to a local partition, then it returns
|
|
||||||
* the_partition control pointer which maps to ID and location
|
|
||||||
* is set to OBJECTS_LOCAL. If the partition ID is global and
|
|
||||||
* resides on a remote node, then location is set to OBJECTS_REMOTE,
|
|
||||||
* and the_partition is undefined. Otherwise, location is set
|
|
||||||
* to OBJECTS_ERROR and the_partition is undefined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Partition_Control *_Partition_Get (
|
|
||||||
Objects_Id id,
|
|
||||||
Objects_Locations *location
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Is_null
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_partition is NULL
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Partition_Is_null (
|
|
||||||
Partition_Control *the_partition
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/part.inl>
|
|
||||||
#include <rtems/partmp.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/mppkt.h>
|
#include <rtems/score/mppkt.h>
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/options.h>
|
#include <rtems/rtems/options.h>
|
||||||
#include <rtems/part.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/thread.h>
|
|
||||||
|
#include <rtems/rtems/part.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following enumerated type defines the list of
|
* The following enumerated type defines the list of
|
||||||
@@ -39,7 +40,7 @@ typedef enum {
|
|||||||
PARTITION_MP_GET_BUFFER_REQUEST = 3,
|
PARTITION_MP_GET_BUFFER_REQUEST = 3,
|
||||||
PARTITION_MP_GET_BUFFER_RESPONSE = 4,
|
PARTITION_MP_GET_BUFFER_RESPONSE = 4,
|
||||||
PARTITION_MP_RETURN_BUFFER_REQUEST = 5,
|
PARTITION_MP_RETURN_BUFFER_REQUEST = 5,
|
||||||
PARTITION_MP_RETURN_BUFFER_RESPONSE = 6,
|
PARTITION_MP_RETURN_BUFFER_RESPONSE = 6
|
||||||
} Partition_MP_Remote_operations;
|
} Partition_MP_Remote_operations;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -48,9 +49,9 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
rtems_packet_prefix Prefix;
|
rtems_packet_prefix Prefix;
|
||||||
Partition_MP_Remote_operations operation;
|
Partition_MP_Remote_operations operation;
|
||||||
Objects_Name name;
|
rtems_name name;
|
||||||
void *buffer;
|
void *buffer;
|
||||||
Objects_Id proxy_id;
|
Objects_Id proxy_id;
|
||||||
} Partition_MP_Packet;
|
} Partition_MP_Packet;
|
||||||
@@ -67,7 +68,7 @@ typedef struct {
|
|||||||
void _Partition_MP_Send_process_packet (
|
void _Partition_MP_Send_process_packet (
|
||||||
Partition_MP_Remote_operations operation,
|
Partition_MP_Remote_operations operation,
|
||||||
Objects_Id partition_id,
|
Objects_Id partition_id,
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
Objects_Id proxy_id
|
Objects_Id proxy_id
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,9 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following enumerated type defines the states in which a
|
* The following enumerated type defines the states in which a
|
||||||
@@ -39,9 +39,13 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
RATE_MONOTONIC_INACTIVE, /* off chain, never initialized */
|
RATE_MONOTONIC_INACTIVE, /* off chain, never initialized */
|
||||||
RATE_MONOTONIC_ACTIVE, /* on chain, running continuously */
|
RATE_MONOTONIC_OWNER_IS_BLOCKING, /* on chain, owner is blocking on it */
|
||||||
RATE_MONOTONIC_EXPIRED /* off chain, will be reset by next rm_period */
|
RATE_MONOTONIC_ACTIVE, /* on chain, running continuously */
|
||||||
|
RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING, /* on chain, expired while owner was */
|
||||||
|
/* was blocking on it */
|
||||||
|
RATE_MONOTONIC_EXPIRED /* off chain, will be reset by next */
|
||||||
|
/* rtems_rate_monotonic_period */
|
||||||
} Rate_Monotonic_Period_states;
|
} Rate_Monotonic_Period_states;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -49,7 +53,7 @@ typedef enum {
|
|||||||
* directive to obtain status information.
|
* directive to obtain status information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define RTEMS_PERIOD_STATUS RTEMS_NO_TIMEOUT
|
#define RTEMS_PERIOD_STATUS WATCHDOG_NO_TIMEOUT
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following structure defines the control block used to manage
|
* The following structure defines the control block used to manage
|
||||||
@@ -88,7 +92,7 @@ void _Rate_monotonic_Manager_initialization(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_rate_monotonic_create(
|
rtems_status_code rtems_rate_monotonic_create(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -104,7 +108,7 @@ rtems_status_code rtems_rate_monotonic_create(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_rate_monotonic_ident(
|
rtems_status_code rtems_rate_monotonic_ident(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -147,63 +151,8 @@ rtems_status_code rtems_rate_monotonic_delete(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_rate_monotonic_period(
|
rtems_status_code rtems_rate_monotonic_period(
|
||||||
Objects_Id id,
|
Objects_Id id,
|
||||||
rtems_interval length
|
rtems_interval length
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Allocate
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function allocates a period control block from
|
|
||||||
* the inactive chain of free period control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine allocates a period control block from
|
|
||||||
* the inactive chain of free period control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Rate_monotonic_Free (
|
|
||||||
Rate_monotonic_Control *the_period
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Get
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function maps period IDs to period control blocks.
|
|
||||||
* If ID corresponds to a local period, then it returns
|
|
||||||
* the_period control pointer which maps to ID and location
|
|
||||||
* is set to OBJECTS_LOCAL. Otherwise, location is set
|
|
||||||
* to OBJECTS_ERROR and the_period is undefined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Rate_monotonic_Control *_Rate_monotonic_Get (
|
|
||||||
Objects_Id id,
|
|
||||||
Objects_Locations *location
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Set_state
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function blocks the calling task so that it is waiting for
|
|
||||||
* a period to expire. It returns TRUE if the task was successfully
|
|
||||||
* blocked, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
boolean _Rate_monotonic_Set_state(
|
|
||||||
Rate_monotonic_Control *the_period
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -224,58 +173,9 @@ void _Rate_monotonic_Timeout (
|
|||||||
void *ignored
|
void *ignored
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
#ifndef __RTEMS_APPLICATION__
|
||||||
* _Rate_monotonic_Is_active
|
#include <rtems/rtems/ratemon.inl>
|
||||||
*
|
#endif
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_period is in the ACTIVE state,
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Rate_monotonic_Is_active (
|
|
||||||
Rate_monotonic_Control *the_period
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Is_inactive
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_period is in the ACTIVE state,
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Rate_monotonic_Is_inactive (
|
|
||||||
Rate_monotonic_Control *the_period
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Is_expired
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_period is in the EXPIRED state,
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Rate_monotonic_Is_expired (
|
|
||||||
Rate_monotonic_Control *the_period
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Is_null
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_period is NULL and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Rate_monotonic_Is_null (
|
|
||||||
Rate_monotonic_Control *the_period
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/ratemon.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,10 +30,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/threadq.h>
|
#include <rtems/score/threadq.h>
|
||||||
#include <rtems/heap.h>
|
#include <rtems/score/heap.h>
|
||||||
#include <rtems/debug.h>
|
#include <rtems/debug.h>
|
||||||
|
#include <rtems/rtems/attr.h>
|
||||||
|
#include <rtems/rtems/types.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following records define the control block used to manage
|
* The following records define the control block used to manage
|
||||||
@@ -86,7 +88,7 @@ void _Region_Manager_initialization(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_region_create(
|
rtems_status_code rtems_region_create(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
void *starting_address,
|
void *starting_address,
|
||||||
unsigned32 length,
|
unsigned32 length,
|
||||||
unsigned32 page_size,
|
unsigned32 page_size,
|
||||||
@@ -123,7 +125,7 @@ rtems_status_code rtems_region_extend(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_region_ident(
|
rtems_status_code rtems_region_ident(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -157,8 +159,8 @@ rtems_status_code rtems_region_delete(
|
|||||||
rtems_status_code rtems_region_get_segment(
|
rtems_status_code rtems_region_get_segment(
|
||||||
Objects_Id id,
|
Objects_Id id,
|
||||||
unsigned32 size,
|
unsigned32 size,
|
||||||
rtems_option option_set,
|
rtems_option option_set,
|
||||||
rtems_interval timeout,
|
rtems_interval timeout,
|
||||||
void **segment
|
void **segment
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -196,89 +198,10 @@ rtems_status_code rtems_region_return_segment(
|
|||||||
void *segment
|
void *segment
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
#ifndef __RTEMS_APPLICATION__
|
||||||
* _Region_Allocate
|
#include <rtems/rtems/region.inl>
|
||||||
*
|
#endif
|
||||||
* DESCRIPTION:
|
#include <rtems/rtems/regionmp.h>
|
||||||
*
|
|
||||||
* This function allocates a region control block from
|
|
||||||
* the inactive chain of free region control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Region_Control *_Region_Allocate( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a region control block to the
|
|
||||||
* inactive chain of free region control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Region_Free (
|
|
||||||
Region_Control *the_region
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_Get
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function maps region IDs to region control blocks.
|
|
||||||
* If ID corresponds to a local region, then it returns
|
|
||||||
* the_region control pointer which maps to ID and location
|
|
||||||
* is set to OBJECTS_LOCAL. Otherwise, location is set
|
|
||||||
* to OBJECTS_ERROR and the_region is undefined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Region_Control *_Region_Get (
|
|
||||||
Objects_Id id,
|
|
||||||
Objects_Locations *location
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_Allocate_segment
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function attempts to allocate a segment from the_region.
|
|
||||||
* If successful, it returns the address of the allocated segment.
|
|
||||||
* Otherwise, it returns NULL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void *_Region_Allocate_segment (
|
|
||||||
Region_Control *the_region,
|
|
||||||
unsigned32 size
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_Free_segment
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function frees the_segment to the_region.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Region_Free_segment (
|
|
||||||
Region_Control *the_region,
|
|
||||||
void *the_segment
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_Is_null
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_region is NULL and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Region_Is_null (
|
|
||||||
Region_Control *the_region
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/region.inl>
|
|
||||||
#include <rtems/regionmp.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _Region_Debug_Walk
|
* _Region_Debug_Walk
|
||||||
|
|||||||
@@ -21,11 +21,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/mppkt.h>
|
#include <rtems/score/mppkt.h>
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/options.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/region.h>
|
|
||||||
#include <rtems/thread.h>
|
#include <rtems/rtems/options.h>
|
||||||
|
#include <rtems/rtems/region.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following enumerated type defines the list of
|
* The following enumerated type defines the list of
|
||||||
@@ -39,7 +40,7 @@ typedef enum {
|
|||||||
REGION_MP_GET_SEGMENT_REQUEST = 3,
|
REGION_MP_GET_SEGMENT_REQUEST = 3,
|
||||||
REGION_MP_GET_SEGMENT_RESPONSE = 4,
|
REGION_MP_GET_SEGMENT_RESPONSE = 4,
|
||||||
REGION_MP_RETURN_SEGMENT_REQUEST = 5,
|
REGION_MP_RETURN_SEGMENT_REQUEST = 5,
|
||||||
REGION_MP_RETURN_SEGMENT_RESPONSE = 6,
|
REGION_MP_RETURN_SEGMENT_RESPONSE = 6
|
||||||
} Region_MP_Remote_operations;
|
} Region_MP_Remote_operations;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -48,10 +49,10 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
rtems_packet_prefix Prefix;
|
rtems_packet_prefix Prefix;
|
||||||
Region_MP_Remote_operations operation;
|
Region_MP_Remote_operations operation;
|
||||||
Objects_Name name;
|
rtems_name name;
|
||||||
rtems_option option_set;
|
rtems_option option_set;
|
||||||
unsigned32 size;
|
unsigned32 size;
|
||||||
Objects_Id proxy_id;
|
Objects_Id proxy_id;
|
||||||
void *segment;
|
void *segment;
|
||||||
@@ -69,7 +70,7 @@ typedef struct {
|
|||||||
void _Region_MP_Send_process_packet (
|
void _Region_MP_Send_process_packet (
|
||||||
Region_MP_Remote_operations operation,
|
Region_MP_Remote_operations operation,
|
||||||
Objects_Id region_id,
|
Objects_Id region_id,
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
Objects_Id proxy_id
|
Objects_Id proxy_id
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -87,8 +88,8 @@ rtems_status_code _Region_MP_Send_request_packet (
|
|||||||
Objects_Id region_id,
|
Objects_Id region_id,
|
||||||
void *segment,
|
void *segment,
|
||||||
unsigned32 size,
|
unsigned32 size,
|
||||||
rtems_option option_set,
|
rtems_option option_set,
|
||||||
rtems_interval timeout
|
rtems_interval timeout
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -23,54 +23,96 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/init.h>
|
|
||||||
#include <rtems/tasks.h>
|
|
||||||
#include <rtems/intr.h>
|
|
||||||
#include <rtems/clock.h>
|
|
||||||
#include <rtems/extension.h>
|
|
||||||
#include <rtems/timer.h>
|
|
||||||
#include <rtems/sem.h>
|
|
||||||
#include <rtems/message.h>
|
|
||||||
#include <rtems/event.h>
|
|
||||||
#include <rtems/signal.h>
|
|
||||||
#include <rtems/event.h>
|
|
||||||
#include <rtems/part.h>
|
|
||||||
#include <rtems/region.h>
|
|
||||||
#include <rtems/dpmem.h>
|
|
||||||
#include <rtems/io.h>
|
|
||||||
#include <rtems/fatal.h>
|
|
||||||
#include <rtems/ratemon.h>
|
|
||||||
#include <rtems/mp.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RTEMS basic type definitions
|
* Unless told otherwise, the RTEMS include files will hide some stuff
|
||||||
|
* from normal application code. Defining this crosses a boundary which
|
||||||
|
* is undesirable since it means your application is using RTEMS features
|
||||||
|
* which are not included in the formally defined and supported API.
|
||||||
|
* Define this at your own risk.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef unsigned8 rtems_unsigned8; /* unsigned 8-bit value */
|
#ifndef __RTEMS_VIOLATE_KERNEL_VISIBILITY__
|
||||||
typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */
|
#define __RTEMS_APPLICATION__
|
||||||
typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */
|
#endif
|
||||||
typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */
|
|
||||||
|
|
||||||
typedef signed8 rtems_signed8; /* signed 8-bit value */
|
#include <rtems/system.h>
|
||||||
typedef signed16 rtems_signed16; /* signed 16-bit value */
|
#include <rtems/rtems/status.h>
|
||||||
typedef signed32 rtems_signed32; /* signed 32-bit value */
|
#include <rtems/rtems/types.h>
|
||||||
typedef signed64 rtems_signed64; /* signed 64-bit value */
|
|
||||||
|
|
||||||
typedef single_precision rtems_single; /* single precision float */
|
#include <rtems/config.h>
|
||||||
typedef double_precision rtems_double; /* double precision float */
|
#include <rtems/init.h>
|
||||||
|
#include <rtems/rtems/tasks.h>
|
||||||
|
#include <rtems/rtems/intr.h>
|
||||||
|
#include <rtems/rtems/clock.h>
|
||||||
|
#include <rtems/extension.h>
|
||||||
|
#include <rtems/rtems/timer.h>
|
||||||
|
#include <rtems/rtems/sem.h>
|
||||||
|
#include <rtems/rtems/message.h>
|
||||||
|
#include <rtems/rtems/event.h>
|
||||||
|
#include <rtems/rtems/signal.h>
|
||||||
|
#include <rtems/rtems/event.h>
|
||||||
|
#include <rtems/rtems/part.h>
|
||||||
|
#include <rtems/rtems/region.h>
|
||||||
|
#include <rtems/rtems/dpmem.h>
|
||||||
|
#include <rtems/io.h>
|
||||||
|
#include <rtems/fatal.h>
|
||||||
|
#include <rtems/rtems/ratemon.h>
|
||||||
|
#include <rtems/rtems/mp.h>
|
||||||
|
|
||||||
typedef boolean rtems_boolean;
|
#include <rtems/rtems/support.h>
|
||||||
|
#include <rtems/score/sysstate.h>
|
||||||
typedef Objects_Name rtems_name;
|
|
||||||
typedef Objects_Id rtems_id;
|
|
||||||
|
|
||||||
typedef Context_Control rtems_context;
|
|
||||||
typedef Context_Control_fp rtems_context_fp;
|
|
||||||
typedef CPU_Interrupt_frame rtems_interrupt_frame;
|
|
||||||
|
|
||||||
#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP
|
#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following define the constants which may be used in name searches.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define RTEMS_SEARCH_ALL_NODES OBJECTS_SEARCH_ALL_NODES
|
||||||
|
#define RTEMS_SEARCH_OTHER_NODES OBJECTS_SEARCH_OTHER_NODES
|
||||||
|
#define RTEMS_SEARCH_LOCAL_NODE OBJECTS_SEARCH_LOCAL_NODE
|
||||||
|
#define RTEMS_WHO_AM_I OBJECTS_WHO_AM_I
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Parameters and return id's for _Objects_Get_next
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define RTEMS_OBJECT_ID_INITIAL_INDEX OBJECTS_ID_INITIAL_INDEX
|
||||||
|
#define RTEMS_OBJECT_ID_FINAL_INDEX OBJECTS_ID_FINAL_INDEX
|
||||||
|
|
||||||
|
#define RTEMS_OBJECT_ID_INITIAL(class, node) OBJECTS_ID_INITIAL(class, node)
|
||||||
|
#define RTEMS_OBJECT_ID_FINAL OBJECTS_ID_FINAL
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following constant defines the minimum stack size which every
|
||||||
|
* thread must exceed.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define RTEMS_MINIMUM_STACK_SIZE STACK_MINIMUM_SIZE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constant for indefinite wait. (actually an illegal interval)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define RTEMS_NO_TIMEOUT WATCHDOG_NO_TIMEOUT
|
||||||
|
|
||||||
|
/*
|
||||||
|
* An MPCI must support packets of at least this size.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define RTEMS_MINIMUM_PACKET_SIZE MP_PACKET_MINIMUM_PACKET_SIZE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following constant defines the number of unsigned32's
|
||||||
|
* in a packet which must be converted to native format in a
|
||||||
|
* heterogeneous system. In packets longer than
|
||||||
|
* MP_PACKET_MINIMUN_HETERO_CONVERSION unsigned32's, some of the "extra" data
|
||||||
|
* may a user message buffer which is not automatically endian swapped.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define RTEMS_MINIMUN_HETERO_CONVERSION MP_PACKET_MINIMUN_HETERO_CONVERSION
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* macros/event.h
|
/*
|
||||||
|
* RTEMS API Support
|
||||||
*
|
*
|
||||||
* This include file contains the implementation of macros for
|
* NOTE:
|
||||||
* the Event Manager.
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
@@ -13,16 +13,22 @@
|
|||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __RTEMS_API_h
|
||||||
|
#define __RTEMS_API_h
|
||||||
|
|
||||||
|
#include <rtems/config.h>
|
||||||
|
|
||||||
#ifndef __MACROS_EVENT_h
|
/*PAGE
|
||||||
#define __MACROS_EVENT_h
|
*
|
||||||
|
* _RTEMS_API_Initialize
|
||||||
/*
|
*
|
||||||
* Event_Manager_initialization
|
* XXX
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _Event_Manager_initialization() \
|
void _RTEMS_API_Initialize(
|
||||||
_Event_Sync = FALSE
|
rtems_configuration_table *configuration_table
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/* end of include file */
|
/* end of include file */
|
||||||
@@ -31,22 +31,26 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/attr.h>
|
#include <rtems/rtems/types.h>
|
||||||
#include <rtems/object.h>
|
#include <rtems/rtems/support.h>
|
||||||
#include <rtems/threadq.h>
|
#include <rtems/rtems/tasks.h>
|
||||||
|
#include <rtems/rtems/attr.h>
|
||||||
|
#include <rtems/score/coremutex.h>
|
||||||
|
#include <rtems/score/object.h>
|
||||||
|
#include <rtems/score/coresem.h>
|
||||||
|
#include <rtems/score/threadq.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following defines the control block used to manage each semaphore.
|
* The following defines the control block used to manage each semaphore.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Objects_Control Object;
|
Objects_Control Object;
|
||||||
Thread_queue_Control Wait_queue;
|
rtems_attribute attribute_set;
|
||||||
rtems_attribute attribute_set;
|
union {
|
||||||
unsigned32 count;
|
CORE_mutex_Control mutex;
|
||||||
unsigned32 nest_count;
|
CORE_semaphore_Control semaphore;
|
||||||
Thread_Control *holder;
|
} Core_control;
|
||||||
Objects_Id holder_id;
|
|
||||||
} Semaphore_Control;
|
} Semaphore_Control;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -81,10 +85,11 @@ void _Semaphore_Manager_initialization(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_semaphore_create(
|
rtems_status_code rtems_semaphore_create(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
unsigned32 count,
|
unsigned32 count,
|
||||||
rtems_attribute attribute_set,
|
rtems_attribute attribute_set,
|
||||||
Objects_Id *id
|
rtems_task_priority priority_ceiling,
|
||||||
|
rtems_id *id
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -102,9 +107,9 @@ rtems_status_code rtems_semaphore_create(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_semaphore_ident(
|
rtems_status_code rtems_semaphore_ident(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
unsigned32 node,
|
unsigned32 node,
|
||||||
Objects_Id *id
|
rtems_id *id
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -117,7 +122,7 @@ rtems_status_code rtems_semaphore_ident(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_semaphore_delete(
|
rtems_status_code rtems_semaphore_delete(
|
||||||
Objects_Id id
|
rtems_id id
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -135,8 +140,8 @@ rtems_status_code rtems_semaphore_delete(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_semaphore_obtain(
|
rtems_status_code rtems_semaphore_obtain(
|
||||||
Objects_Id id,
|
rtems_id id,
|
||||||
unsigned32 option_set,
|
unsigned32 option_set,
|
||||||
rtems_interval timeout
|
rtems_interval timeout
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -153,7 +158,7 @@ rtems_status_code rtems_semaphore_obtain(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_semaphore_release(
|
rtems_status_code rtems_semaphore_release(
|
||||||
Objects_Id id
|
rtems_id id
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -173,62 +178,67 @@ boolean _Semaphore_Seize(
|
|||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _Semaphore_Allocate
|
* _Semaphore_Translate_core_mutex_return_code
|
||||||
*
|
*
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
*
|
*
|
||||||
* This function allocates a semaphore control block from
|
* This function returns a RTEMS status code based on the mutex
|
||||||
* the inactive chain of free semaphore control blocks.
|
* status code specified.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE Semaphore_Control *_Semaphore_Allocate( void );
|
rtems_status_code _Semaphore_Translate_core_mutex_return_code (
|
||||||
|
unsigned32 the_mutex_status
|
||||||
/*
|
|
||||||
* _Semaphore_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a semaphore control block to the
|
|
||||||
* inactive chain of free semaphore control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Semaphore_Free (
|
|
||||||
Semaphore_Control *the_semaphore
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _Semaphore_Get
|
* _Semaphore_Translate_core_semaphore_return_code
|
||||||
*
|
*
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
*
|
*
|
||||||
* This function maps semaphore IDs to semaphore control blocks.
|
* This function returns a RTEMS status code based on the semaphore
|
||||||
* If ID corresponds to a local semaphore, then it returns
|
* status code specified.
|
||||||
* 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.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE Semaphore_Control *_Semaphore_Get (
|
rtems_status_code _Semaphore_Translate_core_semaphore_return_code (
|
||||||
Objects_Id id,
|
unsigned32 the_mutex_status
|
||||||
Objects_Locations *location
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*PAGE
|
||||||
* _Semaphore_Is_null
|
*
|
||||||
|
* _Semaphore_Core_mutex_mp_support
|
||||||
*
|
*
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
*
|
*
|
||||||
* This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
|
* This function processes the global actions necessary for remote
|
||||||
|
* accesses to a global semaphore based on a core mutex. This function
|
||||||
|
* is called by the core.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Semaphore_Is_null (
|
void _Semaphore_Core_mutex_mp_support (
|
||||||
Semaphore_Control *the_semaphore
|
Thread_Control *the_thread,
|
||||||
|
rtems_id id
|
||||||
);
|
);
|
||||||
|
|
||||||
#include <rtems/sem.inl>
|
/*PAGE
|
||||||
#include <rtems/semmp.h>
|
*
|
||||||
|
* _Semaphore_Core_mp_support
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function processes the global actions necessary for remote
|
||||||
|
* accesses to a global semaphore based on a core semaphore. This function
|
||||||
|
* is called by the core.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void _Semaphore_Core_semaphore_mp_support (
|
||||||
|
Thread_Control *the_thread,
|
||||||
|
rtems_id id
|
||||||
|
);
|
||||||
|
|
||||||
|
#ifndef __RTEMS_APPLICATION__
|
||||||
|
#include <rtems/rtems/sem.inl>
|
||||||
|
#endif
|
||||||
|
#include <rtems/rtems/semmp.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,12 +21,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/mppkt.h>
|
#include <rtems/score/mppkt.h>
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/options.h>
|
#include <rtems/rtems/options.h>
|
||||||
#include <rtems/sem.h>
|
#include <rtems/rtems/sem.h>
|
||||||
#include <rtems/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following enumerated type defines the list of
|
* The following enumerated type defines the list of
|
||||||
@@ -40,7 +40,7 @@ typedef enum {
|
|||||||
SEMAPHORE_MP_OBTAIN_REQUEST = 3,
|
SEMAPHORE_MP_OBTAIN_REQUEST = 3,
|
||||||
SEMAPHORE_MP_OBTAIN_RESPONSE = 4,
|
SEMAPHORE_MP_OBTAIN_RESPONSE = 4,
|
||||||
SEMAPHORE_MP_RELEASE_REQUEST = 5,
|
SEMAPHORE_MP_RELEASE_REQUEST = 5,
|
||||||
SEMAPHORE_MP_RELEASE_RESPONSE = 6,
|
SEMAPHORE_MP_RELEASE_RESPONSE = 6
|
||||||
} Semaphore_MP_Remote_operations;
|
} Semaphore_MP_Remote_operations;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -49,11 +49,11 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
rtems_packet_prefix Prefix;
|
rtems_packet_prefix Prefix;
|
||||||
Semaphore_MP_Remote_operations operation;
|
Semaphore_MP_Remote_operations operation;
|
||||||
Objects_Name name;
|
rtems_name name;
|
||||||
rtems_option option_set;
|
rtems_option option_set;
|
||||||
Objects_Id proxy_id;
|
Objects_Id proxy_id;
|
||||||
} Semaphore_MP_Packet;
|
} Semaphore_MP_Packet;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -68,7 +68,7 @@ typedef struct {
|
|||||||
void _Semaphore_MP_Send_process_packet (
|
void _Semaphore_MP_Send_process_packet (
|
||||||
Semaphore_MP_Remote_operations operation,
|
Semaphore_MP_Remote_operations operation,
|
||||||
Objects_Id semaphore_id,
|
Objects_Id semaphore_id,
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
Objects_Id proxy_id
|
Objects_Id proxy_id
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -84,8 +84,8 @@ void _Semaphore_MP_Send_process_packet (
|
|||||||
rtems_status_code _Semaphore_MP_Send_request_packet (
|
rtems_status_code _Semaphore_MP_Send_request_packet (
|
||||||
Semaphore_MP_Remote_operations operation,
|
Semaphore_MP_Remote_operations operation,
|
||||||
Objects_Id semaphore_id,
|
Objects_Id semaphore_id,
|
||||||
rtems_option option_set,
|
rtems_option option_set,
|
||||||
rtems_interval timeout
|
rtems_interval timeout
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -27,10 +27,21 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/asr.h>
|
#include <rtems/rtems/asr.h>
|
||||||
#include <rtems/modes.h>
|
#include <rtems/rtems/modes.h>
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/status.h>
|
#include <rtems/rtems/status.h>
|
||||||
|
#include <rtems/rtems/types.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* _Signal_Manager_initialization
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine performs the initialization necessary for this manager.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void _Signal_Manager_initialization( void );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* rtems_signal_catch
|
* rtems_signal_catch
|
||||||
@@ -45,7 +56,7 @@ extern "C" {
|
|||||||
|
|
||||||
rtems_status_code rtems_signal_catch(
|
rtems_status_code rtems_signal_catch(
|
||||||
rtems_asr_entry asr_handler,
|
rtems_asr_entry asr_handler,
|
||||||
rtems_mode mode_set
|
rtems_mode mode_set
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -62,7 +73,7 @@ rtems_status_code rtems_signal_send(
|
|||||||
rtems_signal_set signal_set
|
rtems_signal_set signal_set
|
||||||
);
|
);
|
||||||
|
|
||||||
#include <rtems/signalmp.h>
|
#include <rtems/rtems/signalmp.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/asr.h>
|
#include <rtems/rtems/asr.h>
|
||||||
#include <rtems/mppkt.h>
|
#include <rtems/score/mppkt.h>
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following enumerated type defines the list of
|
* The following enumerated type defines the list of
|
||||||
@@ -34,7 +34,7 @@ extern "C" {
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SIGNAL_MP_SEND_REQUEST = 0,
|
SIGNAL_MP_SEND_REQUEST = 0,
|
||||||
SIGNAL_MP_SEND_RESPONSE = 1,
|
SIGNAL_MP_SEND_RESPONSE = 1
|
||||||
} Signal_MP_Remote_operations;
|
} Signal_MP_Remote_operations;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -43,9 +43,9 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
rtems_packet_prefix Prefix;
|
rtems_packet_prefix Prefix;
|
||||||
Signal_MP_Remote_operations operation;
|
Signal_MP_Remote_operations operation;
|
||||||
rtems_signal_set signal_in;
|
rtems_signal_set signal_in;
|
||||||
} Signal_MP_Packet;
|
} Signal_MP_Packet;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -52,54 +52,27 @@ typedef enum {
|
|||||||
RTEMS_NOT_OWNER_OF_RESOURCE = 23, /* not owner of resource */
|
RTEMS_NOT_OWNER_OF_RESOURCE = 23, /* not owner of resource */
|
||||||
RTEMS_NOT_IMPLEMENTED = 24, /* directive not implemented */
|
RTEMS_NOT_IMPLEMENTED = 24, /* directive not implemented */
|
||||||
RTEMS_INTERNAL_ERROR = 25, /* RTEMS inconsistency detected */
|
RTEMS_INTERNAL_ERROR = 25, /* RTEMS inconsistency detected */
|
||||||
RTEMS_PROXY_BLOCKING = 26, /* internal multiprocessing only */
|
RTEMS_NO_MEMORY = 26 /* could not get enough memory */
|
||||||
RTEMS_NO_MEMORY = 27 /* could not get enough memory */
|
|
||||||
} rtems_status_code;
|
} rtems_status_code;
|
||||||
|
|
||||||
#define RTEMS_STATUS_CODES_FIRST RTEMS_SUCCESSFUL
|
#define RTEMS_STATUS_CODES_FIRST RTEMS_SUCCESSFUL
|
||||||
#define RTEMS_STATUS_CODES_LAST RTEMS_NO_MEMORY
|
#define RTEMS_STATUS_CODES_LAST RTEMS_NO_MEMORY
|
||||||
|
|
||||||
/*
|
extern rtems_status_code _Status_Object_name_errors_to_status[];
|
||||||
* rtems_is_status_successful
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the status code is equal to RTEMS_SUCCESSFUL,
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean rtems_is_status_successful (
|
#ifdef INIT
|
||||||
rtems_status_code code
|
rtems_status_code _Status_Object_name_errors_to_status[] = {
|
||||||
);
|
RTEMS_SUCCESSFUL, /* OBJECTS_SUCCESSFUL */
|
||||||
|
RTEMS_INVALID_NAME, /* OBJECTS_INVALID_NAME */
|
||||||
|
RTEMS_INVALID_NODE /* OBJECTS_INVALID_NODE */
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* rtems_are_statuses_equal
|
* Applications are allowed to use the macros to compare status codes.
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the status code1 is equal to code2,
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean rtems_are_statuses_equal (
|
#include <rtems/rtems/status.inl>
|
||||||
rtems_status_code code1,
|
|
||||||
rtems_status_code code2
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Status_Is_proxy_blocking
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the status code is equal to the
|
|
||||||
* status which indicates that a proxy is blocking, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Status_Is_proxy_blocking (
|
|
||||||
rtems_status_code code
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/status.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
95
c/src/exec/rtems/headers/support.h
Normal file
95
c/src/exec/rtems/headers/support.h
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
/* support.h
|
||||||
|
*
|
||||||
|
* This include file contains information about support functions for
|
||||||
|
* the RTEMS API.
|
||||||
|
*
|
||||||
|
* 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 file and its derivatives.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __RTEMS_RTEMS_SUPPORT_h
|
||||||
|
#define __RTEMS_RTEMS_SUPPORT_h
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <rtems/rtems/types.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* rtems_build_name
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns an object name composed of the four characters
|
||||||
|
* C1, C2, C3, and C4.
|
||||||
|
*
|
||||||
|
* NOTE:
|
||||||
|
*
|
||||||
|
* This must be implemented as a macro for use in Configuration Tables.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define rtems_build_name( _C1, _C2, _C3, _C4 ) \
|
||||||
|
( (_C1) << 24 | (_C2) << 16 | (_C3) << 8 | (_C4) )
|
||||||
|
|
||||||
|
/*
|
||||||
|
* rtems_get_class
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns the class portion of the ID.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define rtems_get_class( _id ) \
|
||||||
|
_Objects_Get_class( _id )
|
||||||
|
|
||||||
|
/*
|
||||||
|
* rtems_get_node
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns the node portion of the ID.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define rtems_get_node( _id ) \
|
||||||
|
_Objects_Get_node( _id )
|
||||||
|
|
||||||
|
/*
|
||||||
|
* rtems_get_index
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns the index portion of the ID.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define rtems_get_index( _id ) \
|
||||||
|
_Objects_Get_index( _id )
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Time related
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) \
|
||||||
|
TOD_MILLISECONDS_TO_MICROSECONDS(_ms)
|
||||||
|
#define RTEMS_MILLISECONDS_TO_TICKS(_ms) \
|
||||||
|
TOD_MILLISECONDS_TO_TICKS(_ms)
|
||||||
|
|
||||||
|
#include <rtems/rtems/support.inl>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
/* end of include file */
|
||||||
@@ -21,12 +21,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/mppkt.h>
|
#include <rtems/score/mppkt.h>
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/options.h>
|
#include <rtems/rtems/options.h>
|
||||||
#include <rtems/priority.h>
|
#include <rtems/score/priority.h>
|
||||||
#include <rtems/tasks.h>
|
#include <rtems/rtems/tasks.h>
|
||||||
#include <rtems/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following enumerated type defines the list of
|
* The following enumerated type defines the list of
|
||||||
@@ -45,7 +45,7 @@ typedef enum {
|
|||||||
RTEMS_TASKS_MP_GET_NOTE_REQUEST = 8,
|
RTEMS_TASKS_MP_GET_NOTE_REQUEST = 8,
|
||||||
RTEMS_TASKS_MP_GET_NOTE_RESPONSE = 9,
|
RTEMS_TASKS_MP_GET_NOTE_RESPONSE = 9,
|
||||||
RTEMS_TASKS_MP_SET_NOTE_REQUEST = 10,
|
RTEMS_TASKS_MP_SET_NOTE_REQUEST = 10,
|
||||||
RTEMS_TASKS_MP_SET_NOTE_RESPONSE = 11,
|
RTEMS_TASKS_MP_SET_NOTE_RESPONSE = 11
|
||||||
} RTEMS_tasks_MP_Remote_operations;
|
} RTEMS_tasks_MP_Remote_operations;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -54,12 +54,12 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
rtems_packet_prefix Prefix;
|
rtems_packet_prefix Prefix;
|
||||||
RTEMS_tasks_MP_Remote_operations operation;
|
RTEMS_tasks_MP_Remote_operations operation;
|
||||||
Objects_Name name;
|
rtems_name name;
|
||||||
rtems_task_priority the_priority;
|
rtems_task_priority the_priority;
|
||||||
unsigned32 notepad;
|
unsigned32 notepad;
|
||||||
unsigned32 note;
|
unsigned32 note;
|
||||||
} RTEMS_tasks_MP_Packet;
|
} RTEMS_tasks_MP_Packet;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -74,7 +74,7 @@ typedef struct {
|
|||||||
void _RTEMS_tasks_MP_Send_process_packet (
|
void _RTEMS_tasks_MP_Send_process_packet (
|
||||||
RTEMS_tasks_MP_Remote_operations operation,
|
RTEMS_tasks_MP_Remote_operations operation,
|
||||||
Objects_Id task_id,
|
Objects_Id task_id,
|
||||||
Objects_Name name
|
rtems_name name
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -38,14 +38,13 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/message.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/states.h>
|
||||||
#include <rtems/part.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/region.h>
|
#include <rtems/rtems/types.h>
|
||||||
#include <rtems/sem.h>
|
#include <rtems/rtems/eventset.h>
|
||||||
#include <rtems/states.h>
|
#include <rtems/rtems/asr.h>
|
||||||
#include <rtems/thread.h>
|
#include <rtems/rtems/attr.h>
|
||||||
#include <rtems/threadq.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constant to be used as the ID of current task
|
* Constant to be used as the ID of current task
|
||||||
@@ -58,7 +57,134 @@ extern "C" {
|
|||||||
* interval when a task wishes to yield the CPU.
|
* interval when a task wishes to yield the CPU.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define RTEMS_YIELD_PROCESSOR RTEMS_NO_TIMEOUT
|
#define RTEMS_YIELD_PROCESSOR WATCHDOG_NO_TIMEOUT
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Define the type for an RTEMS API task priority.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef Priority_Control rtems_task_priority;
|
||||||
|
|
||||||
|
#define RTEMS_NO_PRIORITY RTEMS_CURRENT_PRIORITY
|
||||||
|
|
||||||
|
#define RTEMS_MINIMUM_PRIORITY (PRIORITY_MINIMUM + 1)
|
||||||
|
#define RTEMS_MAXIMUM_PRIORITY PRIORITY_MAXIMUM
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following constant is passed to rtems_task_set_priority when the
|
||||||
|
* caller wants to obtain the current priority.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define RTEMS_CURRENT_PRIORITY PRIORITY_MINIMUM
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Notepads constants (indices into notepad array)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define RTEMS_NOTEPAD_FIRST 0 /* lowest numbered notepad */
|
||||||
|
#define RTEMS_NOTEPAD_0 0 /* notepad location 0 */
|
||||||
|
#define RTEMS_NOTEPAD_1 1 /* notepad location 1 */
|
||||||
|
#define RTEMS_NOTEPAD_2 2 /* notepad location 2 */
|
||||||
|
#define RTEMS_NOTEPAD_3 3 /* notepad location 3 */
|
||||||
|
#define RTEMS_NOTEPAD_4 4 /* notepad location 4 */
|
||||||
|
#define RTEMS_NOTEPAD_5 5 /* notepad location 5 */
|
||||||
|
#define RTEMS_NOTEPAD_6 6 /* notepad location 6 */
|
||||||
|
#define RTEMS_NOTEPAD_7 7 /* notepad location 7 */
|
||||||
|
#define RTEMS_NOTEPAD_8 8 /* notepad location 8 */
|
||||||
|
#define RTEMS_NOTEPAD_9 9 /* notepad location 9 */
|
||||||
|
#define RTEMS_NOTEPAD_10 10 /* notepad location 10 */
|
||||||
|
#define RTEMS_NOTEPAD_11 11 /* notepad location 11 */
|
||||||
|
#define RTEMS_NOTEPAD_12 12 /* notepad location 12 */
|
||||||
|
#define RTEMS_NOTEPAD_13 13 /* notepad location 13 */
|
||||||
|
#define RTEMS_NOTEPAD_14 14 /* notepad location 14 */
|
||||||
|
#define RTEMS_NOTEPAD_15 15 /* notepad location 15 */
|
||||||
|
#define RTEMS_NOTEPAD_LAST RTEMS_NOTEPAD_15 /* highest numbered notepad */
|
||||||
|
|
||||||
|
#define RTEMS_NUMBER_NOTEPADS (RTEMS_NOTEPAD_LAST+1)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* External API name for Thread_Control
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef Thread_Control rtems_tcb;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following defines the "return type" of an RTEMS task.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef void rtems_task;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following defines the argument to an RTEMS task.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef unsigned32 rtems_task_argument;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following defines the type for the entry point of an RTEMS task.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef rtems_task ( *rtems_task_entry )(
|
||||||
|
rtems_task_argument
|
||||||
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following records define the Initialization Tasks Table.
|
||||||
|
* Each entry contains the information required by RTEMS to
|
||||||
|
* create and start a user task automatically at executive
|
||||||
|
* initialization time.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
rtems_name name; /* task name */
|
||||||
|
unsigned32 stack_size; /* task stack size */
|
||||||
|
rtems_task_priority initial_priority; /* task priority */
|
||||||
|
rtems_attribute attribute_set; /* task attributes */
|
||||||
|
rtems_task_entry entry_point; /* task entry point */
|
||||||
|
rtems_mode mode_set; /* task initial mode */
|
||||||
|
unsigned32 argument; /* task argument */
|
||||||
|
} rtems_initialization_tasks_table;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is the API specific information required by each thread for
|
||||||
|
* the RTEMS API to function correctly.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
unsigned32 Notepads[ RTEMS_NUMBER_NOTEPADS ];
|
||||||
|
rtems_event_set pending_events;
|
||||||
|
rtems_event_set event_condition;
|
||||||
|
ASR_Information Signal;
|
||||||
|
} RTEMS_API_Control;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following defines the information control block used to
|
||||||
|
* manage this class of objects.
|
||||||
|
*/
|
||||||
|
|
||||||
|
EXTERN Objects_Information _RTEMS_tasks_Information;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These are used to manage the user initialization tasks.
|
||||||
|
*/
|
||||||
|
|
||||||
|
EXTERN rtems_initialization_tasks_table *_RTEMS_tasks_User_initialization_tasks;
|
||||||
|
EXTERN unsigned32 _RTEMS_tasks_Number_of_initialization_tasks;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* _RTEMS_tasks_Manager_initialization
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine initializes all Task Manager related data structures.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void _RTEMS_tasks_Manager_initialization(
|
||||||
|
unsigned32 maximum_tasks,
|
||||||
|
unsigned32 number_of_initialization_tasks,
|
||||||
|
rtems_initialization_tasks_table *user_tasks
|
||||||
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* rtems_task_create
|
* rtems_task_create
|
||||||
@@ -74,12 +200,12 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_task_create(
|
rtems_status_code rtems_task_create(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
rtems_task_priority initial_priority,
|
rtems_task_priority initial_priority,
|
||||||
unsigned32 stack_size,
|
unsigned32 stack_size,
|
||||||
rtems_mode initial_modes,
|
rtems_mode initial_modes,
|
||||||
rtems_attribute attribute_set,
|
rtems_attribute attribute_set,
|
||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -97,7 +223,7 @@ rtems_status_code rtems_task_create(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_task_ident(
|
rtems_status_code rtems_task_ident(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
unsigned32 node,
|
unsigned32 node,
|
||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
);
|
);
|
||||||
@@ -217,7 +343,7 @@ rtems_status_code rtems_task_resume(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_task_set_priority(
|
rtems_status_code rtems_task_set_priority(
|
||||||
Objects_Id id,
|
Objects_Id id,
|
||||||
rtems_task_priority new_priority,
|
rtems_task_priority new_priority,
|
||||||
rtems_task_priority *old_priority
|
rtems_task_priority *old_priority
|
||||||
);
|
);
|
||||||
@@ -263,49 +389,27 @@ rtems_status_code rtems_task_wake_when(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_task_wake_after(
|
rtems_status_code rtems_task_wake_after(
|
||||||
rtems_interval ticks
|
rtems_interval ticks
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*PAGE
|
||||||
* _RTEMS_tasks_Allocate
|
|
||||||
*
|
*
|
||||||
* DESCRIPTION:
|
* _RTEMS_tasks_Initialize_user_tasks
|
||||||
*
|
*
|
||||||
* This function allocates a task control block from
|
* This routine creates and starts all configured user
|
||||||
* the inactive chain of free task control blocks.
|
* initialzation threads.
|
||||||
|
*
|
||||||
|
* Input parameters: NONE
|
||||||
|
*
|
||||||
|
* Output parameters: NONE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void _RTEMS_tasks_Initialize_user_tasks( void );
|
||||||
|
|
||||||
STATIC INLINE Thread_Control *_RTEMS_tasks_Allocate( void );
|
#ifndef __RTEMS_APPLICATION__
|
||||||
|
#include <rtems/rtems/tasks.inl>
|
||||||
/*
|
#endif
|
||||||
* _RTEMS_tasks_Free
|
#include <rtems/rtems/taskmp.h>
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a task control block to the
|
|
||||||
* inactive chain of free task control blocks.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _RTEMS_tasks_Free (
|
|
||||||
Thread_Control *the_task
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _RTEMS_tasks_Cancel_wait
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine unblocks the_thread and cancels any timers
|
|
||||||
* which the_thread has active.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _RTEMS_tasks_Cancel_wait(
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/tasks.inl>
|
|
||||||
#include <rtems/taskmp.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/object.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following enumerated type details the classes to which a timer
|
* The following enumerated type details the classes to which a timer
|
||||||
@@ -49,10 +49,15 @@ typedef enum {
|
|||||||
} Timer_Classes;
|
} Timer_Classes;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following defines the type of a Timer Service Routine.
|
* The following types define a pointer to a timer service routine.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef rtems_timer_service_routine_entry Timer_Service;
|
typedef void rtems_timer_service_routine;
|
||||||
|
|
||||||
|
typedef rtems_timer_service_routine ( *rtems_timer_service_routine_entry )(
|
||||||
|
rtems_id,
|
||||||
|
void *
|
||||||
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following defines the information control block used to manage
|
* The following defines the information control block used to manage
|
||||||
@@ -95,7 +100,7 @@ void _Timer_Manager_initialization(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_timer_create(
|
rtems_status_code rtems_timer_create(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -111,7 +116,7 @@ rtems_status_code rtems_timer_create(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_timer_ident(
|
rtems_status_code rtems_timer_ident(
|
||||||
Objects_Name name,
|
rtems_name name,
|
||||||
Objects_Id *id
|
Objects_Id *id
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -152,10 +157,10 @@ rtems_status_code rtems_timer_delete(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_timer_fire_after(
|
rtems_status_code rtems_timer_fire_after(
|
||||||
Objects_Id id,
|
Objects_Id id,
|
||||||
rtems_interval ticks,
|
rtems_interval ticks,
|
||||||
Timer_Service routine,
|
rtems_timer_service_routine_entry routine,
|
||||||
void *user_data
|
void *user_data
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -169,10 +174,10 @@ rtems_status_code rtems_timer_fire_after(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code rtems_timer_fire_when(
|
rtems_status_code rtems_timer_fire_when(
|
||||||
Objects_Id id,
|
Objects_Id id,
|
||||||
rtems_time_of_day *wall_time,
|
rtems_time_of_day *wall_time,
|
||||||
Timer_Service routine,
|
rtems_timer_service_routine_entry routine,
|
||||||
void *user_data
|
void *user_data
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -190,99 +195,9 @@ rtems_status_code rtems_timer_reset(
|
|||||||
Objects_Id id
|
Objects_Id id
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
#ifndef __RTEMS_APPLICATION__
|
||||||
* _Timer_Allocate
|
#include <rtems/rtems/timer.inl>
|
||||||
*
|
#endif
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function allocates a timer control block from
|
|
||||||
* the inactive chain of free timer control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Timer_Control *_Timer_Allocate( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a timer control block to the
|
|
||||||
* inactive chain of free timer control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Timer_Free (
|
|
||||||
Timer_Control *the_timer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Get
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function maps timer IDs to timer control blocks.
|
|
||||||
* If ID corresponds to a local timer, then it returns
|
|
||||||
* the timer control pointer which maps to ID and location
|
|
||||||
* is set to OBJECTS_LOCAL. Otherwise, location is set
|
|
||||||
* to OBJECTS_ERROR and the returned value is undefined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Timer_Control *_Timer_Get (
|
|
||||||
Objects_Id id,
|
|
||||||
Objects_Locations *location
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Is_interval_class
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the class is that of an INTERVAL
|
|
||||||
* timer, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Timer_Is_interval_class (
|
|
||||||
Timer_Classes the_class
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Is_time_of_day_class
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the class is that of an INTERVAL
|
|
||||||
* timer, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Timer_Is_timer_of_day_class (
|
|
||||||
Timer_Classes the_class
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Is_dormant_class
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the class is that of a DORMANT
|
|
||||||
* timer, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Timer_Is_dormant_class (
|
|
||||||
Timer_Classes the_class
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Is_null
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_timer is NULL and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Timer_Is_null (
|
|
||||||
Timer_Control *the_timer
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/timer.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
/* rtems.h
|
/* types.h
|
||||||
*
|
*
|
||||||
* This include file contains information about RTEMS executive that
|
* This include file defines the types used by the RTEMS API.
|
||||||
* is required by the application and is CPU independent. It includes
|
|
||||||
* two (2) CPU dependent files to tailor its data structures for a
|
|
||||||
* particular processor.
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
@@ -16,32 +13,18 @@
|
|||||||
* $Id$
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __RTEMS_RTEMS_GENERIC_h
|
#ifndef __RTEMS_RTEMS_TYPES_h
|
||||||
#define __RTEMS_RTEMS_GENERIC_h
|
#define __RTEMS_RTEMS_TYPES_h
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/init.h>
|
#include <rtems/score/priority.h>
|
||||||
#include <rtems/tasks.h>
|
#include <rtems/rtems/modes.h>
|
||||||
#include <rtems/intr.h>
|
#include <rtems/score/mpci.h>
|
||||||
#include <rtems/clock.h>
|
#include <rtems/score/mppkt.h>
|
||||||
#include <rtems/extension.h>
|
|
||||||
#include <rtems/timer.h>
|
|
||||||
#include <rtems/sem.h>
|
|
||||||
#include <rtems/message.h>
|
|
||||||
#include <rtems/event.h>
|
|
||||||
#include <rtems/signal.h>
|
|
||||||
#include <rtems/event.h>
|
|
||||||
#include <rtems/part.h>
|
|
||||||
#include <rtems/region.h>
|
|
||||||
#include <rtems/dpmem.h>
|
|
||||||
#include <rtems/io.h>
|
|
||||||
#include <rtems/fatal.h>
|
|
||||||
#include <rtems/ratemon.h>
|
|
||||||
#include <rtems/mp.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RTEMS basic type definitions
|
* RTEMS basic type definitions
|
||||||
@@ -50,26 +33,60 @@ extern "C" {
|
|||||||
typedef unsigned8 rtems_unsigned8; /* unsigned 8-bit value */
|
typedef unsigned8 rtems_unsigned8; /* unsigned 8-bit value */
|
||||||
typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */
|
typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */
|
||||||
typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */
|
typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */
|
||||||
typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */
|
|
||||||
|
|
||||||
typedef signed8 rtems_signed8; /* signed 8-bit value */
|
typedef signed8 rtems_signed8; /* signed 8-bit value */
|
||||||
typedef signed16 rtems_signed16; /* signed 16-bit value */
|
typedef signed16 rtems_signed16; /* signed 16-bit value */
|
||||||
typedef signed32 rtems_signed32; /* signed 32-bit value */
|
typedef signed32 rtems_signed32; /* signed 32-bit value */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* some C++ compilers (eg: HP's) don't do 'long long'
|
||||||
|
*/
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */
|
||||||
typedef signed64 rtems_signed64; /* signed 64-bit value */
|
typedef signed64 rtems_signed64; /* signed 64-bit value */
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef single_precision rtems_single; /* single precision float */
|
typedef single_precision rtems_single; /* single precision float */
|
||||||
typedef double_precision rtems_double; /* double precision float */
|
typedef double_precision rtems_double; /* double precision float */
|
||||||
|
|
||||||
typedef boolean rtems_boolean;
|
typedef boolean rtems_boolean;
|
||||||
|
|
||||||
typedef Objects_Name rtems_name;
|
typedef unsigned32 rtems_name;
|
||||||
typedef Objects_Id rtems_id;
|
typedef Objects_Id rtems_id;
|
||||||
|
|
||||||
typedef Context_Control rtems_context;
|
typedef Context_Control rtems_context;
|
||||||
typedef Context_Control_fp rtems_context_fp;
|
typedef Context_Control_fp rtems_context_fp;
|
||||||
typedef CPU_Interrupt_frame rtems_interrupt_frame;
|
typedef CPU_Interrupt_frame rtems_interrupt_frame;
|
||||||
|
|
||||||
#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP
|
/*
|
||||||
|
* Time related
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef Watchdog_Interval rtems_interval;
|
||||||
|
typedef TOD_Control rtems_time_of_day;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Define the type for an RTEMS API task mode.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef Modes_Control rtems_mode;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MPCI related entries
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef MP_packet_Classes rtems_mp_packet_classes;
|
||||||
|
typedef MP_packet_Prefix rtems_packet_prefix;
|
||||||
|
|
||||||
|
typedef MPCI_initialization_entry rtems_mpci_initialization_entry;
|
||||||
|
typedef MPCI_get_packet_entry rtems_mpci_get_packet_entry;
|
||||||
|
typedef MPCI_return_packet_entry rtems_mpci_return_packet_entry;
|
||||||
|
typedef MPCI_send_entry rtems_mpci_send_packet_entry;
|
||||||
|
typedef MPCI_receive_entry rtems_mpci_receive_packet_entry;
|
||||||
|
|
||||||
|
typedef MPCI_Entry rtems_mpci_entry;
|
||||||
|
|
||||||
|
typedef MPCI_Control rtems_mpci_table;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
/* rtems.h
|
|
||||||
*
|
|
||||||
* This include file contains information about RTEMS executive that
|
|
||||||
* is required by the application and is CPU independent. It includes
|
|
||||||
* two (2) CPU dependent files to tailor its data structures for a
|
|
||||||
* particular processor.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_RTEMS_GENERIC_h
|
|
||||||
#define __RTEMS_RTEMS_GENERIC_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/init.h>
|
|
||||||
#include <rtems/tasks.h>
|
|
||||||
#include <rtems/intr.h>
|
|
||||||
#include <rtems/clock.h>
|
|
||||||
#include <rtems/extension.h>
|
|
||||||
#include <rtems/timer.h>
|
|
||||||
#include <rtems/sem.h>
|
|
||||||
#include <rtems/message.h>
|
|
||||||
#include <rtems/event.h>
|
|
||||||
#include <rtems/signal.h>
|
|
||||||
#include <rtems/event.h>
|
|
||||||
#include <rtems/part.h>
|
|
||||||
#include <rtems/region.h>
|
|
||||||
#include <rtems/dpmem.h>
|
|
||||||
#include <rtems/io.h>
|
|
||||||
#include <rtems/fatal.h>
|
|
||||||
#include <rtems/ratemon.h>
|
|
||||||
#include <rtems/mp.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* RTEMS basic type definitions
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef unsigned8 rtems_unsigned8; /* unsigned 8-bit value */
|
|
||||||
typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */
|
|
||||||
typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */
|
|
||||||
typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */
|
|
||||||
|
|
||||||
typedef signed8 rtems_signed8; /* signed 8-bit value */
|
|
||||||
typedef signed16 rtems_signed16; /* signed 16-bit value */
|
|
||||||
typedef signed32 rtems_signed32; /* signed 32-bit value */
|
|
||||||
typedef signed64 rtems_signed64; /* signed 64-bit value */
|
|
||||||
|
|
||||||
typedef single_precision rtems_single; /* single precision float */
|
|
||||||
typedef double_precision rtems_double; /* double precision float */
|
|
||||||
|
|
||||||
typedef boolean rtems_boolean;
|
|
||||||
|
|
||||||
typedef Objects_Name rtems_name;
|
|
||||||
typedef Objects_Id rtems_id;
|
|
||||||
|
|
||||||
typedef Context_Control rtems_context;
|
|
||||||
typedef Context_Control_fp rtems_context_fp;
|
|
||||||
typedef CPU_Interrupt_frame rtems_interrupt_frame;
|
|
||||||
|
|
||||||
#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,177 +0,0 @@
|
|||||||
/* asr.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Asynchronous Signal Handler. This Handler provides the low-level
|
|
||||||
* support required by the Signal Manager.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_ASR_h
|
|
||||||
#define __RTEMS_ASR_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/modes.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* The following type defines the control block used to manage
|
|
||||||
* each signal set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef unsigned32 rtems_signal_set;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return type for ASR Handler
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef void rtems_asr;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following type corresponds to the applications asynchronous
|
|
||||||
* signal processing routine.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef rtems_asr ( *rtems_asr_entry )(
|
|
||||||
rtems_signal_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* The following defines the control structure used to manage
|
|
||||||
* signals. Each thread has a copy of this record.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
rtems_asr_entry handler; /* address of RTEMS_ASR */
|
|
||||||
rtems_mode mode_set; /* RTEMS_ASR mode */
|
|
||||||
rtems_signal_set signals_posted; /* signal set */
|
|
||||||
rtems_signal_set signals_pending; /* pending signal set */
|
|
||||||
unsigned32 nest_level; /* nest level of RTEMS_ASR */
|
|
||||||
} ASR_Information;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following constants define the individual signals which may
|
|
||||||
* be used to compose a signal set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define RTEMS_SIGNAL_0 0x00000001
|
|
||||||
#define RTEMS_SIGNAL_1 0x00000002
|
|
||||||
#define RTEMS_SIGNAL_2 0x00000004
|
|
||||||
#define RTEMS_SIGNAL_3 0x00000008
|
|
||||||
#define RTEMS_SIGNAL_4 0x00000010
|
|
||||||
#define RTEMS_SIGNAL_5 0x00000020
|
|
||||||
#define RTEMS_SIGNAL_6 0x00000040
|
|
||||||
#define RTEMS_SIGNAL_7 0x00000080
|
|
||||||
#define RTEMS_SIGNAL_8 0x00000100
|
|
||||||
#define RTEMS_SIGNAL_9 0x00000200
|
|
||||||
#define RTEMS_SIGNAL_10 0x00000400
|
|
||||||
#define RTEMS_SIGNAL_11 0x00000800
|
|
||||||
#define RTEMS_SIGNAL_12 0x00001000
|
|
||||||
#define RTEMS_SIGNAL_13 0x00002000
|
|
||||||
#define RTEMS_SIGNAL_14 0x00004000
|
|
||||||
#define RTEMS_SIGNAL_15 0x00008000
|
|
||||||
#define RTEMS_SIGNAL_16 0x00010000
|
|
||||||
#define RTEMS_SIGNAL_17 0x00020000
|
|
||||||
#define RTEMS_SIGNAL_18 0x00040000
|
|
||||||
#define RTEMS_SIGNAL_19 0x00080000
|
|
||||||
#define RTEMS_SIGNAL_20 0x00100000
|
|
||||||
#define RTEMS_SIGNAL_21 0x00200000
|
|
||||||
#define RTEMS_SIGNAL_22 0x00400000
|
|
||||||
#define RTEMS_SIGNAL_23 0x00800000
|
|
||||||
#define RTEMS_SIGNAL_24 0x01000000
|
|
||||||
#define RTEMS_SIGNAL_25 0x02000000
|
|
||||||
#define RTEMS_SIGNAL_26 0x04000000
|
|
||||||
#define RTEMS_SIGNAL_27 0x08000000
|
|
||||||
#define RTEMS_SIGNAL_28 0x10000000
|
|
||||||
#define RTEMS_SIGNAL_29 0x20000000
|
|
||||||
#define RTEMS_SIGNAL_30 0x40000000
|
|
||||||
#define RTEMS_SIGNAL_31 0x80000000
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _ASR_Initialize
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine initializes the given RTEMS_ASR information record.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _ASR_Initialize (
|
|
||||||
ASR_Information *information
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _ASR_Swap_signals
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine atomically swaps the pending and posted signal
|
|
||||||
* sets. This is done when the thread alters its mode in such a
|
|
||||||
* way that the RTEMS_ASR disable/enable flag changes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _ASR_Swap_signals (
|
|
||||||
ASR_Information *information
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _ASR_Is_null_handler
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the given asr_handler is NULL and
|
|
||||||
* FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _ASR_Is_null_handler (
|
|
||||||
rtems_asr_entry asr_handler
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _ASR_Are_signals_pending
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if there are signals pending in the
|
|
||||||
* given RTEMS_ASR information record and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _ASR_Are_signals_pending (
|
|
||||||
ASR_Information *information
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _ASR_Post_signals
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine posts the given signals into the signal_set
|
|
||||||
* passed in. The result is returned to the user in signal_set.
|
|
||||||
*
|
|
||||||
* NOTE: This must be implemented as a macro.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _ASR_Post_signals(
|
|
||||||
rtems_signal_set signals,
|
|
||||||
rtems_signal_set *signal_set
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/asr.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,188 +0,0 @@
|
|||||||
/* attr.h
|
|
||||||
*
|
|
||||||
* This include file contains all information about the Object Attributes
|
|
||||||
* Handler.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_ATTRIBUTES_h
|
|
||||||
#define __RTEMS_ATTRIBUTES_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* types */
|
|
||||||
|
|
||||||
typedef unsigned32 rtems_attribute;
|
|
||||||
|
|
||||||
/* constants */
|
|
||||||
|
|
||||||
#define RTEMS_DEFAULT_ATTRIBUTES 0x00000000
|
|
||||||
|
|
||||||
#define RTEMS_NO_FLOATING_POINT 0x00000000 /* don't use FP HW */
|
|
||||||
#define RTEMS_FLOATING_POINT 0x00000001 /* utilize coprocessor */
|
|
||||||
|
|
||||||
#define RTEMS_LOCAL 0x00000000 /* local resource */
|
|
||||||
#define RTEMS_GLOBAL 0x00000002 /* global resource */
|
|
||||||
|
|
||||||
#define RTEMS_FIFO 0x00000000 /* process RTEMS_FIFO */
|
|
||||||
#define RTEMS_PRIORITY 0x00000004 /* process by priority */
|
|
||||||
|
|
||||||
#define RTEMS_NO_LIMIT 0x00000000 /* unlimited Q entries */
|
|
||||||
#define RTEMS_LIMIT 0x00000008 /* limit Q entries */
|
|
||||||
|
|
||||||
#define RTEMS_COUNTING_SEMAPHORE 0x00000000
|
|
||||||
#define RTEMS_BINARY_SEMAPHORE 0x00000010
|
|
||||||
|
|
||||||
#define RTEMS_NO_INHERIT_PRIORITY 0x00000000
|
|
||||||
#define RTEMS_INHERIT_PRIORITY 0x00000020
|
|
||||||
|
|
||||||
#if ( CPU_HARDWARE_FP == TRUE )
|
|
||||||
#define ATTRIBUTES_NOT_SUPPORTED 0
|
|
||||||
#else
|
|
||||||
#define ATTRIBUTES_NOT_SUPPORTED RTEMS_FLOATING_POINT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ( CPU_ALL_TASKS_ARE_FP == TRUE )
|
|
||||||
#define ATTRIBUTES_REQUIRED RTEMS_FLOATING_POINT
|
|
||||||
#else
|
|
||||||
#define ATTRIBUTES_REQUIRED 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Handler_initialization
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs initialization for this handler.
|
|
||||||
*
|
|
||||||
* NOTE: There is no initialization required in C. Conditional compilation
|
|
||||||
* takes care of this in C.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define _Attributes_Handler_initialization()
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Set
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function sets the requested new_attributes in the attribute_set
|
|
||||||
* passed in. The result is returned to the user.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE rtems_attribute _Attributes_Set (
|
|
||||||
rtems_attribute new_attributes,
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Clear
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function clears the requested new_attributes in the attribute_set
|
|
||||||
* passed in. The result is returned to the user.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE rtems_attribute _Attributes_Clear (
|
|
||||||
rtems_attribute attribute_set,
|
|
||||||
rtems_attribute mask
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Is_floating_point
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the floating point attribute is
|
|
||||||
* enabled in the attribute_set and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_floating_point(
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Is_global
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the global object attribute is
|
|
||||||
* enabled in the attribute_set and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_global(
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Is_priority
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the priority attribute is
|
|
||||||
* enabled in the attribute_set and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_priority(
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Is_limit
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the limited attribute is
|
|
||||||
* enabled in the attribute_set and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_limit(
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Is_binary_semaphore
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the binary semaphore attribute is
|
|
||||||
* enabled in the attribute_set and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_binary_semaphore(
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Attributes_Is_inherit_priority
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the priority inheritance attribute
|
|
||||||
* is enabled in the attribute_set and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_inherit_priority(
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/attr.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
/* clock.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Clock Manager. This manager provides facilities to set, obtain,
|
|
||||||
* and continually update the current date and time.
|
|
||||||
*
|
|
||||||
* This manager provides directives to:
|
|
||||||
*
|
|
||||||
* + set the current date and time
|
|
||||||
* + obtain the current date and time
|
|
||||||
* + announce a clock tick
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_CLOCK_h
|
|
||||||
#define __RTEMS_CLOCK_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/tod.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* List of things which can be returned by the rtems_clock_get directive.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
RTEMS_CLOCK_GET_TOD,
|
|
||||||
RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH,
|
|
||||||
RTEMS_CLOCK_GET_TICKS_SINCE_BOOT,
|
|
||||||
RTEMS_CLOCK_GET_TICKS_PER_SECOND,
|
|
||||||
RTEMS_CLOCK_GET_TIME_VALUE
|
|
||||||
} rtems_clock_get_options;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Standard flavor style to return TOD in for a rtems_clock_get option.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
unsigned32 seconds;
|
|
||||||
unsigned32 microseconds;
|
|
||||||
} rtems_clock_time_value;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_clock_get
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_clock_get directive. It returns
|
|
||||||
* one of the following:
|
|
||||||
* + current time of day
|
|
||||||
* + seconds since epoch
|
|
||||||
* + ticks since boot
|
|
||||||
* + ticks per second
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_clock_get(
|
|
||||||
rtems_clock_get_options option,
|
|
||||||
void *time_buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_clock_set
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_clock_set directive. It sets
|
|
||||||
* the current time of day to that in the time_buffer record.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_clock_set(
|
|
||||||
rtems_time_of_day *time_buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_clock_tick
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_clock_tick directive. It is invoked
|
|
||||||
* to inform RTEMS of the occurrence of a clock tick.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_clock_tick( void );
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,210 +0,0 @@
|
|||||||
/* dpmem.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Dual Ported Memory Manager. This manager provides a mechanism
|
|
||||||
* for converting addresses between internal and external representations
|
|
||||||
* for multiple dual-ported memory areas.
|
|
||||||
*
|
|
||||||
* Directives provided are:
|
|
||||||
*
|
|
||||||
* + create a port
|
|
||||||
* + get ID of a port
|
|
||||||
* + delete a port
|
|
||||||
* + convert external to internal address
|
|
||||||
* + convert internal to external address
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_DUAL_PORTED_MEMORY_h
|
|
||||||
#define __RTEMS_DUAL_PORTED_MEMORY_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/object.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following structure defines the port control block. Each port
|
|
||||||
* has a control block associated with it. This control block contains
|
|
||||||
* all information required to support the port related operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
Objects_Control Object;
|
|
||||||
void *internal_base; /* base internal address */
|
|
||||||
void *external_base; /* base external address */
|
|
||||||
unsigned32 length; /* length of dual-ported area */
|
|
||||||
} Dual_ported_memory_Control;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following define the internal Dual Ported Memory information.
|
|
||||||
*/
|
|
||||||
|
|
||||||
EXTERN Objects_Information _Dual_ported_memory_Information;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Dual_ported_memory_Manager_initialization
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the initialization necessary for this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Dual_ported_memory_Manager_initialization(
|
|
||||||
unsigned32 maximum_ports
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_port_create
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_port_create directive. The port
|
|
||||||
* will have the name name. The port maps onto an area of dual ported
|
|
||||||
* memory of length bytes which has internal_start and external_start
|
|
||||||
* as the internal and external starting addresses, respectively.
|
|
||||||
* It returns the id of the created port in ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_port_create(
|
|
||||||
Objects_Name name,
|
|
||||||
void *internal_start,
|
|
||||||
void *external_start,
|
|
||||||
unsigned32 length,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_port_ident
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_port_ident directive. This directive
|
|
||||||
* returns the port ID associated with name. If more than one port is
|
|
||||||
* named name, then the port to which the ID belongs is arbitrary.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_port_ident(
|
|
||||||
Objects_Name name,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_port_delete
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_port_delete directive. It deletes
|
|
||||||
* the port associated with ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_port_delete(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_port_external_to_internal
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_port_external_to_internal directive.
|
|
||||||
* It returns the internal port address which maps to the provided
|
|
||||||
* external port address for the specified port ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_port_external_to_internal(
|
|
||||||
Objects_Id id,
|
|
||||||
void *external,
|
|
||||||
void **internal
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_port_internal_to_external
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the Port_internal_to_external directive.
|
|
||||||
* It returns the external port address which maps to the provided
|
|
||||||
* internal port address for the specified port ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_port_internal_to_external(
|
|
||||||
Objects_Id id,
|
|
||||||
void *internal,
|
|
||||||
void **external
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Dual_ported_memory_Allocate
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine allocates a port control block from the inactive chain
|
|
||||||
* of free port control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Dual_ported_memory_Control
|
|
||||||
*_Dual_ported_memory_Allocate ( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Dual_ported_memory_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a port control block to the inactive chain
|
|
||||||
* of free port control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Dual_ported_memory_Free (
|
|
||||||
Dual_ported_memory_Control *the_port
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Dual_ported_memory_Get
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function maps port IDs to port control blocks. If ID
|
|
||||||
* corresponds to a local port, then it returns the_port control
|
|
||||||
* pointer which maps to ID and location is set to OBJECTS_LOCAL.
|
|
||||||
* Global ports are not supported, thus if ID does not map to a
|
|
||||||
* local port, location is set to OBJECTS_ERROR and the_port is
|
|
||||||
* undefined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
|
|
||||||
Objects_Id id,
|
|
||||||
Objects_Locations *location
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Dual_ported_memory_Is_null
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_port is NULL and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Dual_ported_memory_Is_null(
|
|
||||||
Dual_ported_memory_Control *the_port
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/dpmem.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,158 +0,0 @@
|
|||||||
/* event.h
|
|
||||||
*
|
|
||||||
* This include file contains the information pertaining to the Event
|
|
||||||
* Manager. This manager provides a high performance method of communication
|
|
||||||
* and synchronization.
|
|
||||||
*
|
|
||||||
* Directives provided are:
|
|
||||||
*
|
|
||||||
* + send an event set to a task
|
|
||||||
* + receive event condition
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_EVENT_h
|
|
||||||
#define __RTEMS_EVENT_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/options.h>
|
|
||||||
#include <rtems/thread.h>
|
|
||||||
#include <rtems/watchdog.h>
|
|
||||||
#include <rtems/eventset.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This constant is passed as the event_in to the
|
|
||||||
* rtems_event_receive directive to determine which events are pending.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define EVENT_CURRENT 0
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_Manager_initialization
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the initialization necessary for this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Event_Manager_initialization( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_event_send
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_event_send directive. It sends
|
|
||||||
* event_in to the task specified by ID. If the task is blocked
|
|
||||||
* waiting to receive events and the posting of event_in satisfies
|
|
||||||
* the task's event condition, then it is unblocked.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_event_send (
|
|
||||||
Objects_Id id,
|
|
||||||
rtems_event_set event_in
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_event_receive
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_event_receive directive. This
|
|
||||||
* directive is invoked when the calling task wishes to receive
|
|
||||||
* the event_in event condition. One of the fields in the option_set
|
|
||||||
* parameter determines whether the receive request is satisfied if
|
|
||||||
* any or all of the events are pending. If the event condition
|
|
||||||
* is not satisfied immediately, then the task may block with an
|
|
||||||
* optional timeout of TICKS clock ticks or return immediately.
|
|
||||||
* This determination is based on another field in the option_set
|
|
||||||
* parameter. This directive returns the events received in the
|
|
||||||
* event_out parameter.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_event_receive (
|
|
||||||
rtems_event_set event_in,
|
|
||||||
rtems_option option_set,
|
|
||||||
rtems_interval ticks,
|
|
||||||
rtems_event_set *event_out
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_Seize
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine determines if the event condition event_in is
|
|
||||||
* satisfied. If so or if the no_wait option is enabled in option_set,
|
|
||||||
* then the procedure returns immediately. If neither of these
|
|
||||||
* conditions is true, then the calling task is blocked with an
|
|
||||||
* optional timeout of ticks clock ticks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Event_Seize (
|
|
||||||
rtems_event_set event_in,
|
|
||||||
rtems_option option_set,
|
|
||||||
rtems_interval ticks
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_Surrender
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine determines if the event condition of the_thread
|
|
||||||
* has been satisfied. If so, it unblocks the_thread.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Event_Surrender (
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_Timeout
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine is invoked when a task's event receive request
|
|
||||||
* has not been satisfied after the specified timeout interval.
|
|
||||||
* The task represented by ID will be unblocked and its status
|
|
||||||
* code will be set in it's control block to indicate that a timeout
|
|
||||||
* has occurred.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Event_Timeout (
|
|
||||||
Objects_Id id,
|
|
||||||
void *ignored
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following defines the synchronization flag used by the
|
|
||||||
* Event Manager to insure that signals sent to the currently
|
|
||||||
* executing thread are received properly.
|
|
||||||
*/
|
|
||||||
|
|
||||||
EXTERN boolean _Event_Sync; /* event manager sync flag */
|
|
||||||
|
|
||||||
#include <rtems/event.inl>
|
|
||||||
#include <rtems/eventmp.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,147 +0,0 @@
|
|||||||
/* eventmp.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Multiprocessing Support in the Event Manager.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_EVENT_MP_h
|
|
||||||
#define __RTEMS_EVENT_MP_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/event.h>
|
|
||||||
#include <rtems/mppkt.h>
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/thread.h>
|
|
||||||
#include <rtems/watchdog.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following enumerated type defines the list of
|
|
||||||
* remote event operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
EVENT_MP_SEND_REQUEST = 0,
|
|
||||||
EVENT_MP_SEND_RESPONSE = 1,
|
|
||||||
} Event_MP_Remote_operations;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following data structure defines the packet used to perform
|
|
||||||
* remote event operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
rtems_packet_prefix Prefix;
|
|
||||||
Event_MP_Remote_operations operation;
|
|
||||||
rtems_event_set event_in;
|
|
||||||
} Event_MP_Packet;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_MP_Send_process_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* process operation can be performed on another node.
|
|
||||||
*
|
|
||||||
* This routine is not needed since there are no process
|
|
||||||
* packets to be sent by this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_MP_Send_request_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* directive operation can be initiated on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code _Event_MP_Send_request_packet (
|
|
||||||
Event_MP_Remote_operations operation,
|
|
||||||
Objects_Id event_id,
|
|
||||||
rtems_event_set event_in
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_MP_Send_response_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* directive can be performed on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Event_MP_Send_response_packet (
|
|
||||||
Event_MP_Remote_operations operation,
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* _Event_MP_Process_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the actions specific to this package for
|
|
||||||
* the request from another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Event_MP_Process_packet (
|
|
||||||
rtems_packet_prefix *the_packet_prefix
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_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.
|
|
||||||
*
|
|
||||||
* This routine is not needed since there are no objects
|
|
||||||
* deleted by this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_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.
|
|
||||||
*
|
|
||||||
* This routine is not needed since there are no objects
|
|
||||||
* deleted by this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_MP_Get_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function is used to obtain a event mp packet.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Event_MP_Packet *_Event_MP_Get_packet ( void );
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of file */
|
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
/* eventset.h
|
|
||||||
*
|
|
||||||
* This include file contains the information pertaining to the
|
|
||||||
* Event Sets Handler. This handler provides methods for the manipulation
|
|
||||||
* of event sets which will be sent and received by tasks.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_EVENT_SET_h
|
|
||||||
#define __RTEMS_EVENT_SET_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following defines the type used to control event sets.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef unsigned32 rtems_event_set;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following constants define the individual events which may
|
|
||||||
* be used to compose an event set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define RTEMS_PENDING_EVENTS 0 /* receive pending events */
|
|
||||||
#define RTEMS_ALL_EVENTS 0xFFFFFFFF
|
|
||||||
|
|
||||||
#define RTEMS_EVENT_0 0x00000001
|
|
||||||
#define RTEMS_EVENT_1 0x00000002
|
|
||||||
#define RTEMS_EVENT_2 0x00000004
|
|
||||||
#define RTEMS_EVENT_3 0x00000008
|
|
||||||
#define RTEMS_EVENT_4 0x00000010
|
|
||||||
#define RTEMS_EVENT_5 0x00000020
|
|
||||||
#define RTEMS_EVENT_6 0x00000040
|
|
||||||
#define RTEMS_EVENT_7 0x00000080
|
|
||||||
#define RTEMS_EVENT_8 0x00000100
|
|
||||||
#define RTEMS_EVENT_9 0x00000200
|
|
||||||
#define RTEMS_EVENT_10 0x00000400
|
|
||||||
#define RTEMS_EVENT_11 0x00000800
|
|
||||||
#define RTEMS_EVENT_12 0x00001000
|
|
||||||
#define RTEMS_EVENT_13 0x00002000
|
|
||||||
#define RTEMS_EVENT_14 0x00004000
|
|
||||||
#define RTEMS_EVENT_15 0x00008000
|
|
||||||
#define RTEMS_EVENT_16 0x00010000
|
|
||||||
#define RTEMS_EVENT_17 0x00020000
|
|
||||||
#define RTEMS_EVENT_18 0x00040000
|
|
||||||
#define RTEMS_EVENT_19 0x00080000
|
|
||||||
#define RTEMS_EVENT_20 0x00100000
|
|
||||||
#define RTEMS_EVENT_21 0x00200000
|
|
||||||
#define RTEMS_EVENT_22 0x00400000
|
|
||||||
#define RTEMS_EVENT_23 0x00800000
|
|
||||||
#define RTEMS_EVENT_24 0x01000000
|
|
||||||
#define RTEMS_EVENT_25 0x02000000
|
|
||||||
#define RTEMS_EVENT_26 0x04000000
|
|
||||||
#define RTEMS_EVENT_27 0x08000000
|
|
||||||
#define RTEMS_EVENT_28 0x10000000
|
|
||||||
#define RTEMS_EVENT_29 0x20000000
|
|
||||||
#define RTEMS_EVENT_30 0x40000000
|
|
||||||
#define RTEMS_EVENT_31 0x80000000
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following constant is the value of an event set which
|
|
||||||
* has no events pending.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define EVENT_SETS_NONE_PENDING 0
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_sets_Is_empty
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if on events are posted in the event_set,
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Event_sets_Is_empty(
|
|
||||||
rtems_event_set the_event_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_sets_Post
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine posts the given new_events into the event_set
|
|
||||||
* passed in. The result is returned to the user in event_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Event_sets_Post(
|
|
||||||
rtems_event_set the_new_events,
|
|
||||||
rtems_event_set *the_event_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_sets_Get
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns the events in event_condition which are
|
|
||||||
* set in event_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE rtems_event_set _Event_sets_Get(
|
|
||||||
rtems_event_set the_event_set,
|
|
||||||
rtems_event_set the_event_condition
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Event_sets_Clear
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function removes the events in mask from the event_set
|
|
||||||
* passed in. The result is returned to the user in event_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE rtems_event_set _Event_sets_Clear(
|
|
||||||
rtems_event_set the_event_set,
|
|
||||||
rtems_event_set the_mask
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/eventset.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
/* intr.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Interrupt Manager.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_INTERRUPT_h
|
|
||||||
#define __RTEMS_INTERRUPT_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/isr.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Interrupt level type
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef ISR_Level rtems_interrupt_level;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Interrupt_Manager_initialization
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine initializes the interrupt manager.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Interrupt_Manager_initialization( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_interrupt_catch
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_interrupt_catch directive. This
|
|
||||||
* directive installs new_isr_handler as the RTEMS interrupt service
|
|
||||||
* routine for vector. The previous RTEMS interrupt service
|
|
||||||
* routine is returned in old_isr_handler.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_interrupt_catch(
|
|
||||||
rtems_isr_entry new_isr_handler,
|
|
||||||
rtems_vector_number vector,
|
|
||||||
rtems_isr_entry *old_isr_handler
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_interrupt_disable
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine disables all maskable interrupts and returns the
|
|
||||||
* previous level in _isr_cookie.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define rtems_interrupt_disable( _isr_cookie ) \
|
|
||||||
_ISR_Disable(_isr_cookie)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_interrupt_enable
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine enables maskable interrupts to the level indicated
|
|
||||||
* _isr_cookie.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define rtems_interrupt_enable( _isr_cookie ) \
|
|
||||||
_ISR_Enable(_isr_cookie)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_interrupt_flash
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine temporarily enables maskable interrupts to the
|
|
||||||
* level in _isr_cookie before redisabling them.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define rtems_interrupt_flash( _isr_cookie ) \
|
|
||||||
_ISR_Flash(_isr_cookie)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_interrupt_cause
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine generates an interrupt.
|
|
||||||
*
|
|
||||||
* NOTE: No implementation.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define rtems_interrupt_cause( _interrupt_to_cause )
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_interrupt_cause
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine clears the specified interrupt.
|
|
||||||
*
|
|
||||||
* NOTE: No implementation.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define rtems_interrupt_clear( _interrupt_to_clear )
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,461 +0,0 @@
|
|||||||
/* message.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Message Queue Manager. This manager provides a mechanism for
|
|
||||||
* communication and synchronization between tasks using messages.
|
|
||||||
*
|
|
||||||
* Directives provided are:
|
|
||||||
*
|
|
||||||
* + create a queue
|
|
||||||
* + get ID of a queue
|
|
||||||
* + delete a queue
|
|
||||||
* + put a message at the rear of a queue
|
|
||||||
* + put a message at the front of a queue
|
|
||||||
* + broadcast N messages to a queue
|
|
||||||
* + receive message from a queue
|
|
||||||
* + flush all messages on a queue
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_MESSAGE_QUEUE_h
|
|
||||||
#define __RTEMS_MESSAGE_QUEUE_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/chain.h>
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/threadq.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following defines the data types needed to manipulate
|
|
||||||
* the contents of message buffers.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
unsigned32 field1;
|
|
||||||
unsigned32 field2;
|
|
||||||
unsigned32 field3;
|
|
||||||
unsigned32 field4;
|
|
||||||
} Message_queue_Buffer;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following records define the organization of a message
|
|
||||||
* buffer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
Chain_Node Node;
|
|
||||||
Message_queue_Buffer Contents;
|
|
||||||
} Message_queue_Buffer_control;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following records define the control block used to manage
|
|
||||||
* each message queue.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
Objects_Control Object;
|
|
||||||
Thread_queue_Control Wait_queue;
|
|
||||||
rtems_attribute attribute_set;
|
|
||||||
unsigned32 maximum_pending_messages;
|
|
||||||
unsigned32 number_of_pending_messages;
|
|
||||||
Chain_Control Pending_messages;
|
|
||||||
} Message_queue_Control;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following defines the information control block used to
|
|
||||||
* manage this class of objects.
|
|
||||||
*/
|
|
||||||
|
|
||||||
EXTERN Objects_Information _Message_queue_Information;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following defines the data structures used to
|
|
||||||
* manage the pool of inactive message buffers.
|
|
||||||
*/
|
|
||||||
|
|
||||||
EXTERN Chain_Control _Message_queue_Inactive_messages;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following enumerated type details the modes in which a message
|
|
||||||
* may be submitted to a message queue. The message may be posted
|
|
||||||
* in a send or urgent fashion.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
MESSAGE_QUEUE_SEND_REQUEST = 0,
|
|
||||||
MESSAGE_QUEUE_URGENT_REQUEST = 1
|
|
||||||
} Message_queue_Submit_types;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Manager_initialization
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the initialization necessary for this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Message_queue_Manager_initialization(
|
|
||||||
unsigned32 maximum_message_queues,
|
|
||||||
unsigned32 maximum_messages
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_message_queue_create
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_message_queue_create directive. The
|
|
||||||
* message queue will have the name name. If the attribute_set indicates
|
|
||||||
* that the message queue is to be limited in the number of messages
|
|
||||||
* that can be outstanding, then count indicates the maximum number of
|
|
||||||
* messages that will be held. It returns the id of the created
|
|
||||||
* message queue in ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_message_queue_create(
|
|
||||||
Objects_Name name,
|
|
||||||
unsigned32 count,
|
|
||||||
rtems_attribute attribute_set,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_message_queue_ident
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_message_queue_ident directive.
|
|
||||||
* This directive returns the message queue ID associated with NAME.
|
|
||||||
* If more than one message queue is named name, then the message
|
|
||||||
* queue to which the ID belongs is arbitrary. node indicates the
|
|
||||||
* extent of the search for the ID of the message queue named name.
|
|
||||||
* The search can be limited to a particular node or allowed to
|
|
||||||
* encompass all nodes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_message_queue_ident(
|
|
||||||
Objects_Name name,
|
|
||||||
unsigned32 node,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_message_queue_delete
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_message_queue_delete directive. The
|
|
||||||
* message queue indicated by ID is deleted.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_message_queue_delete(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_message_queue_send
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_message_queue_send directive.
|
|
||||||
* This directive sends the message buffer to the message queue
|
|
||||||
* indicated by ID. If one or more tasks is blocked waiting
|
|
||||||
* to receive a message from this message queue, then one will
|
|
||||||
* receive the message. The task selected to receive the
|
|
||||||
* message is based on the task queue discipline algorithm in
|
|
||||||
* use by this particular message queue. If no tasks are waiting,
|
|
||||||
* then the message buffer will be placed at the rear of the
|
|
||||||
* chain of pending messages for this message queue.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_message_queue_send(
|
|
||||||
Objects_Id id,
|
|
||||||
void *buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_message_queue_urgent
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_message_queue_send directive.
|
|
||||||
* This directive sends the message buffer to the message queue
|
|
||||||
* indicated by ID. If one or more tasks is blocked waiting
|
|
||||||
* to receive a message from this message queue, then one will
|
|
||||||
* receive the message. The task selected to receive the
|
|
||||||
* message is based on the task queue discipline algorithm in
|
|
||||||
* use by this particular message queue. If no tasks are waiting,
|
|
||||||
* then the message buffer will be placed at the rear of the
|
|
||||||
* chain of pending messages for this message queue.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_message_queue_urgent(
|
|
||||||
Objects_Id id,
|
|
||||||
void *buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_message_queue_broadcast
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_message_queue_send directive.
|
|
||||||
* This directive sends the message buffer to the message queue
|
|
||||||
* indicated by ID. If one or more tasks is blocked waiting
|
|
||||||
* to receive a message from this message queue, then one will
|
|
||||||
* receive the message. The task selected to receive the
|
|
||||||
* message is based on the task queue discipline algorithm in
|
|
||||||
* use by this particular message queue. If no tasks are waiting,
|
|
||||||
* then the message buffer will be placed at the rear of the
|
|
||||||
* chain of pending messages for this message queue.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_message_queue_broadcast(
|
|
||||||
Objects_Id id,
|
|
||||||
void *buffer,
|
|
||||||
unsigned32 *count
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_message_queue_receive
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_message_queue_receive directive.
|
|
||||||
* This directive is invoked when the calling task wishes to receive
|
|
||||||
* a message from the message queue indicated by ID. The received
|
|
||||||
* message is to be placed in buffer. If no messages are outstanding
|
|
||||||
* and the option_set indicates that the task is willing to block,
|
|
||||||
* then the task will be blocked until a message arrives or until,
|
|
||||||
* optionally, timeout clock ticks have passed.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_message_queue_receive(
|
|
||||||
Objects_Id id,
|
|
||||||
void *buffer,
|
|
||||||
unsigned32 option_set,
|
|
||||||
rtems_interval timeout
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_message_queue_flush
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_message_queue_flush directive.
|
|
||||||
* This directive takes all outstanding messages for the message
|
|
||||||
* queue indicated by ID and returns them to the inactive message
|
|
||||||
* chain. The number of messages flushed is returned in COUNT.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_message_queue_flush(
|
|
||||||
Objects_Id id,
|
|
||||||
unsigned32 *count
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Copy_buffer
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine copies the contents of the source message buffer
|
|
||||||
* to the destination message buffer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Copy_buffer (
|
|
||||||
Message_queue_Buffer *source,
|
|
||||||
Message_queue_Buffer *destination
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Seize
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine attempts to receive a message from the_message_queue.
|
|
||||||
* If a message is available or if the RTEMS_NO_WAIT option is enabled in
|
|
||||||
* option_set, then the routine returns. Otherwise, the calling task
|
|
||||||
* is blocked until a message is available. If a message is returned
|
|
||||||
* to the task, then buffer will contain its contents.
|
|
||||||
*/
|
|
||||||
|
|
||||||
boolean _Message_queue_Seize(
|
|
||||||
Message_queue_Control *the_message_queue,
|
|
||||||
unsigned32 option_set,
|
|
||||||
Message_queue_Buffer *buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Flush_support
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine flushes all outstanding messages and returns
|
|
||||||
* them to the inactive message chain.
|
|
||||||
*/
|
|
||||||
|
|
||||||
unsigned32 _Message_queue_Flush_support(
|
|
||||||
Message_queue_Control *the_message_queue
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Submit
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine provides the common foundation for the
|
|
||||||
* rtems_message_queue_send and rtems_message_queue_urgent directives.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code _Message_queue_Submit(
|
|
||||||
Objects_Id id,
|
|
||||||
Message_queue_Buffer *buffer,
|
|
||||||
Message_queue_Submit_types submit_type
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Allocate_message_buffer
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function allocates a message buffer from the inactive
|
|
||||||
* message buffer chain.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Message_queue_Buffer_control *
|
|
||||||
_Message_queue_Allocate_message_buffer ( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Free_message_buffer
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a message buffer to the inactive
|
|
||||||
* message buffer chain.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Free_message_buffer (
|
|
||||||
Message_queue_Buffer_control *the_message
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Get_pending_message
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function removes the first message from the_message_queue
|
|
||||||
* and returns a pointer to it.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE
|
|
||||||
Message_queue_Buffer_control *_Message_queue_Get_pending_message (
|
|
||||||
Message_queue_Control *the_message_queue
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Append
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine places the_message at the rear of the outstanding
|
|
||||||
* messages on the_message_queue.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Append (
|
|
||||||
Message_queue_Control *the_message_queue,
|
|
||||||
Message_queue_Buffer_control *the_message
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Prepend
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine places the_message at the rear of the outstanding
|
|
||||||
* messages on the_message_queue.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Prepend (
|
|
||||||
Message_queue_Control *the_message_queue,
|
|
||||||
Message_queue_Buffer_control *the_message
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Is_null
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function places the_message at the rear of the outstanding
|
|
||||||
* messages on the_message_queue.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Message_queue_Is_null (
|
|
||||||
Message_queue_Control *the_message_queue
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Allocate
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function allocates a message queue control block from
|
|
||||||
* the inactive chain of free message queue control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Message_queue_Control *_Message_queue_Allocate ( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine allocates a message queue control block from
|
|
||||||
* the inactive chain of free message queue control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Free (
|
|
||||||
Message_queue_Control *the_message_queue
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _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_message_queue 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_message_queue is undefined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Message_queue_Control *_Message_queue_Get (
|
|
||||||
Objects_Id id,
|
|
||||||
Objects_Locations *location
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/message.inl>
|
|
||||||
#include <rtems/msgmp.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,183 +0,0 @@
|
|||||||
/* modes.h
|
|
||||||
*
|
|
||||||
* This include file contains all constants and structures associated
|
|
||||||
* with the RTEMS thread and RTEMS_ASR modes.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_MODES_h
|
|
||||||
#define __RTEMS_MODES_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/isr.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following type defines the control block used to manage
|
|
||||||
* each a mode set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef unsigned32 rtems_mode;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following constants define the individual modes and masks
|
|
||||||
* which may be used to compose a mode set and to alter modes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define RTEMS_ALL_MODE_MASKS 0x0000ffff
|
|
||||||
|
|
||||||
#define RTEMS_DEFAULT_MODES 0x00000000
|
|
||||||
#define RTEMS_CURRENT_MODE 0
|
|
||||||
|
|
||||||
#define RTEMS_PREEMPT_MASK 0x00000100 /* preemption bit */
|
|
||||||
#define RTEMS_TIMESLICE_MASK 0x00000200 /* timeslice bit */
|
|
||||||
#define RTEMS_ASR_MASK 0x00000400 /* RTEMS_ASR enable bit */
|
|
||||||
#define RTEMS_INTERRUPT_MASK CPU_MODES_INTERRUPT_MASK
|
|
||||||
|
|
||||||
#define RTEMS_PREEMPT 0x00000000 /* enable preemption */
|
|
||||||
#define RTEMS_NO_PREEMPT 0x00000100 /* disable preemption */
|
|
||||||
|
|
||||||
#define RTEMS_NO_TIMESLICE 0x00000000 /* disable timeslicing */
|
|
||||||
#define RTEMS_TIMESLICE 0x00000200 /* enable timeslicing */
|
|
||||||
|
|
||||||
#define RTEMS_ASR 0x00000000 /* enable RTEMS_ASR */
|
|
||||||
#define RTEMS_NO_ASR 0x00000400 /* disable RTEMS_ASR */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The number of bits for interrupt levels is CPU dependent.
|
|
||||||
* RTEMS supports 0 to 256 levels in bits 0-7 of the mode.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* RTEMS_INTERRUPT_LEVEL
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns the processor dependent interrupt
|
|
||||||
* level which corresponds to the requested interrupt level.
|
|
||||||
*
|
|
||||||
* NOTE: RTEMS supports 256 interrupt levels using the least
|
|
||||||
* significant eight bits of MODES.CONTROL. On any
|
|
||||||
* particular CPU, fewer than 256 levels may be supported.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE unsigned32 RTEMS_INTERRUPT_LEVEL (
|
|
||||||
rtems_mode mode_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Modes_Mask_changed
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if any of the mode flags in mask
|
|
||||||
* are set in mode_set, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Modes_Mask_changed (
|
|
||||||
rtems_mode mode_set,
|
|
||||||
rtems_mode masks
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Modes_Is_asr_disabled
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if mode_set indicates that Asynchronous
|
|
||||||
* Signal Processing is disabled, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Modes_Is_asr_disabled (
|
|
||||||
rtems_mode mode_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Modes_Is_preempt
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if mode_set indicates that preemption
|
|
||||||
* is enabled, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Modes_Is_preempt (
|
|
||||||
rtems_mode mode_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Modes_Is_timeslice
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if mode_set indicates that timeslicing
|
|
||||||
* is enabled, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Modes_Is_timeslice (
|
|
||||||
rtems_mode mode_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Modes_Get_interrupt_level
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns the interrupt level portion of the mode_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE ISR_Level _Modes_Get_interrupt_level (
|
|
||||||
rtems_mode mode_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Modes_Set_interrupt_level
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine sets the current interrupt level to that specified
|
|
||||||
* in the mode_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Modes_Set_interrupt_level (
|
|
||||||
rtems_mode mode_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Modes_Change
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine changes the modes in old_mode_set indicated by
|
|
||||||
* mask to the requested values in new_mode_set. The resulting
|
|
||||||
* mode set is returned in out_mode_set and the modes that changed
|
|
||||||
* is returned in changed.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Modes_Change (
|
|
||||||
rtems_mode old_mode_set,
|
|
||||||
rtems_mode new_mode_set,
|
|
||||||
rtems_mode mask,
|
|
||||||
rtems_mode *out_mode_set,
|
|
||||||
rtems_mode *changed
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/modes.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
/* mp.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Multiprocessing Manager.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_MP_h
|
|
||||||
#define __RTEMS_MP_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* _Multiprocessing_Manager_initialization
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the initialization necessary for this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Multiprocessing_Manager_initialization ( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* rtems_multiprocessing_announce
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the MULTIPROCESSING_ANNOUNCE directive.
|
|
||||||
* It is invoked by the MPCI layer to indicate that an MPCI packet
|
|
||||||
* has been received.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void rtems_multiprocessing_announce ( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* _Multiprocessing_Receive_server
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine is a server thread which processes remote requests
|
|
||||||
* from other nodes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Thread _Multiprocessing_Receive_server (
|
|
||||||
Thread_Argument ignored
|
|
||||||
);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,175 +0,0 @@
|
|||||||
/* msgmp.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Multiprocessing Support in the Message Manager.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_MESSAGE_QUEUE_MP_h
|
|
||||||
#define __RTEMS_MESSAGE_QUEUE_MP_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/message.h>
|
|
||||||
#include <rtems/mppkt.h>
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/options.h>
|
|
||||||
#include <rtems/thread.h>
|
|
||||||
#include <rtems/watchdog.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following enumerated type defines the list of
|
|
||||||
* remote message queue operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0,
|
|
||||||
MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1,
|
|
||||||
MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2,
|
|
||||||
MESSAGE_QUEUE_MP_RECEIVE_REQUEST = 3,
|
|
||||||
MESSAGE_QUEUE_MP_RECEIVE_RESPONSE = 4,
|
|
||||||
MESSAGE_QUEUE_MP_SEND_REQUEST = 5,
|
|
||||||
MESSAGE_QUEUE_MP_SEND_RESPONSE = 6,
|
|
||||||
MESSAGE_QUEUE_MP_URGENT_REQUEST = 7,
|
|
||||||
MESSAGE_QUEUE_MP_URGENT_RESPONSE = 8,
|
|
||||||
MESSAGE_QUEUE_MP_BROADCAST_REQUEST = 9,
|
|
||||||
MESSAGE_QUEUE_MP_BROADCAST_RESPONSE = 10,
|
|
||||||
MESSAGE_QUEUE_MP_FLUSH_REQUEST = 11,
|
|
||||||
MESSAGE_QUEUE_MP_FLUSH_RESPONSE = 12
|
|
||||||
} Message_queue_MP_Remote_operations;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following data structure defines the packet used to perform
|
|
||||||
* remote message queue operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
rtems_packet_prefix Prefix;
|
|
||||||
Message_queue_MP_Remote_operations operation;
|
|
||||||
Objects_Name name;
|
|
||||||
rtems_option option_set;
|
|
||||||
Objects_Id proxy_id;
|
|
||||||
unsigned32 count;
|
|
||||||
unsigned32 pad0;
|
|
||||||
unsigned32 pad1;
|
|
||||||
unsigned32 pad2;
|
|
||||||
Message_queue_Buffer Buffer;
|
|
||||||
} Message_queue_MP_Packet;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _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 _Message_queue_MP_Send_process_packet (
|
|
||||||
Message_queue_MP_Remote_operations operation,
|
|
||||||
Objects_Id message_queue_id,
|
|
||||||
Objects_Name name,
|
|
||||||
Objects_Id proxy_id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code _Message_queue_MP_Send_request_packet (
|
|
||||||
Message_queue_MP_Remote_operations operation,
|
|
||||||
Objects_Id message_queue_id,
|
|
||||||
Message_queue_Buffer *buffer,
|
|
||||||
rtems_option option_set,
|
|
||||||
rtems_interval timeout
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _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 _Message_queue_MP_Send_response_packet (
|
|
||||||
Message_queue_MP_Remote_operations operation,
|
|
||||||
Objects_Id message_queue_id,
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* _Message_queue_MP_Process_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the actions specific to this package for
|
|
||||||
* the request from another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Message_queue_MP_Process_packet (
|
|
||||||
rtems_packet_prefix *the_packet_prefix
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _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 _Message_queue_MP_Send_object_was_deleted (
|
|
||||||
Thread_Control *the_proxy
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _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 _Message_queue_MP_Send_extract_proxy (
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Message_queue_MP_Get_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function is used to obtain a message queue mp packet.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Message_queue_MP_Packet *_Message_queue_MP_Get_packet ( void );
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of file */
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
/* options.h
|
|
||||||
*
|
|
||||||
* This include file contains information which defines the
|
|
||||||
* options available on many directives.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_OPTIONS_h
|
|
||||||
#define __RTEMS_OPTIONS_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following type defines the control block used to manage
|
|
||||||
* option sets.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef unsigned32 rtems_option;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following constants define the individual options which may
|
|
||||||
* be used to compose an option set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define RTEMS_DEFAULT_OPTIONS 0x00000000
|
|
||||||
|
|
||||||
#define RTEMS_WAIT 0x00000000 /* wait on resource */
|
|
||||||
#define RTEMS_NO_WAIT 0x00000001 /* do not wait on resource */
|
|
||||||
|
|
||||||
#define RTEMS_EVENT_ALL 0x00000000 /* wait for all events */
|
|
||||||
#define RTEMS_EVENT_ANY 0x00000002 /* wait on any event */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Options_Is_no_wait
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the RTEMS_NO_WAIT option is enabled in
|
|
||||||
* option_set, and FALSE otherwise.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Options_Is_no_wait (
|
|
||||||
rtems_option option_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Options_Is_any
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the RTEMS_EVENT_ANY option is enabled in
|
|
||||||
* OPTION_SET, and FALSE otherwise.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Options_Is_any (
|
|
||||||
rtems_option option_set
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/options.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,290 +0,0 @@
|
|||||||
/* partition.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Partition Manager. This manager provides facilities to
|
|
||||||
* dynamically allocate memory in fixed-sized units which are returned
|
|
||||||
* as buffers.
|
|
||||||
*
|
|
||||||
* Directives provided are:
|
|
||||||
*
|
|
||||||
* + create a partition
|
|
||||||
* + get an ID of a partition
|
|
||||||
* + delete a partition
|
|
||||||
* + get a buffer from a partition
|
|
||||||
* + return a buffer to a partition
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_PARTITION_h
|
|
||||||
#define __RTEMS_PARTITION_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/address.h>
|
|
||||||
#include <rtems/attr.h>
|
|
||||||
#include <rtems/object.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following defines the control block used to manage each partition.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
Objects_Control Object;
|
|
||||||
void *starting_address; /* physical address */
|
|
||||||
unsigned32 length; /* in bytes */
|
|
||||||
unsigned32 buffer_size; /* in bytes */
|
|
||||||
rtems_attribute attribute_set; /* attributes */
|
|
||||||
unsigned32 number_of_used_blocks; /* or allocated buffers */
|
|
||||||
Chain_Control Memory; /* buffer chain */
|
|
||||||
} Partition_Control;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following defines the information control block used to
|
|
||||||
* manage this class of objects.
|
|
||||||
*/
|
|
||||||
|
|
||||||
EXTERN Objects_Information _Partition_Information;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Manager_initialization
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the initialization necessary for this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Partition_Manager_initialization(
|
|
||||||
unsigned32 maximum_partitions
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_partition_create
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_partition_create directive. The
|
|
||||||
* partition will have the name name. The memory area managed by
|
|
||||||
* the partition is of length bytes and starts at starting_address.
|
|
||||||
* The memory area will be divided into as many buffers of
|
|
||||||
* buffer_size bytes as possible. The attribute_set determines if
|
|
||||||
* the partition is global or local. It returns the id of the
|
|
||||||
* created partition in ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_partition_create(
|
|
||||||
Objects_Name name,
|
|
||||||
void *starting_address,
|
|
||||||
unsigned32 length,
|
|
||||||
unsigned32 buffer_size,
|
|
||||||
rtems_attribute attribute_set,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_partition_ident
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_partition_ident directive.
|
|
||||||
* This directive returns the partition ID associated with name.
|
|
||||||
* If more than one partition is named name, then the partition
|
|
||||||
* to which the ID belongs is arbitrary. node indicates the
|
|
||||||
* extent of the search for the ID of the partition named name.
|
|
||||||
* The search can be limited to a particular node or allowed to
|
|
||||||
* encompass all nodes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_partition_ident(
|
|
||||||
Objects_Name name,
|
|
||||||
unsigned32 node,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_partition_delete
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_partition_delete directive. The
|
|
||||||
* partition indicated by ID is deleted.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_partition_delete(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_partition_get_buffer
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_partition_get_buffer directive. It
|
|
||||||
* attempts to allocate a buffer from the partition associated with ID.
|
|
||||||
* If a buffer is allocated, its address is returned in buffer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_partition_get_buffer(
|
|
||||||
Objects_Id id,
|
|
||||||
void **buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_partition_return_buffer
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_partition_return_buffer directive. It
|
|
||||||
* frees the buffer to the partition associated with ID. The buffer must
|
|
||||||
* have been previously allocated from the same partition.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_partition_return_buffer(
|
|
||||||
Objects_Id id,
|
|
||||||
void *buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Allocate_buffer
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function attempts to allocate a buffer from the_partition.
|
|
||||||
* If successful, it returns the address of the allocated buffer.
|
|
||||||
* Otherwise, it returns NULL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void *_Partition_Allocate_buffer (
|
|
||||||
Partition_Control *the_partition
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Free_buffer
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees the_buffer to the_partition.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Partition_Free_buffer (
|
|
||||||
Partition_Control *the_partition,
|
|
||||||
Chain_Node *the_buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Is_buffer_on_boundary
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_buffer is on a valid buffer
|
|
||||||
* boundary for the_partition, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Partition_Is_buffer_on_boundary (
|
|
||||||
void *the_buffer,
|
|
||||||
Partition_Control *the_partition
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Is_buffer_valid
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_buffer is a valid buffer from
|
|
||||||
* the_partition, otherwise FALSE is returned.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Partition_Is_buffer_valid (
|
|
||||||
Chain_Node *the_buffer,
|
|
||||||
Partition_Control *the_partition
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Is_buffer_size_aligned
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the use of the specified buffer_size
|
|
||||||
* will result in the allocation of buffers whose first byte is
|
|
||||||
* properly aligned, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Partition_Is_buffer_size_aligned (
|
|
||||||
unsigned32 buffer_size
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Allocate
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function allocates a partition control block from
|
|
||||||
* the inactive chain of free partition control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Partition_Control *_Partition_Allocate ( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a partition control block to the
|
|
||||||
* inactive chain of free partition control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Partition_Free (
|
|
||||||
Partition_Control *the_partition
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Get
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function maps partition IDs to partition control blocks.
|
|
||||||
* If ID corresponds to a local partition, then it returns
|
|
||||||
* the_partition control pointer which maps to ID and location
|
|
||||||
* is set to OBJECTS_LOCAL. If the partition ID is global and
|
|
||||||
* resides on a remote node, then location is set to OBJECTS_REMOTE,
|
|
||||||
* and the_partition is undefined. Otherwise, location is set
|
|
||||||
* to OBJECTS_ERROR and the_partition is undefined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Partition_Control *_Partition_Get (
|
|
||||||
Objects_Id id,
|
|
||||||
Objects_Locations *location
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_Is_null
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_partition is NULL
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Partition_Is_null (
|
|
||||||
Partition_Control *the_partition
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/part.inl>
|
|
||||||
#include <rtems/partmp.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,160 +0,0 @@
|
|||||||
/* partmp.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Multiprocessing Support in the Partition Manager.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_PARTITION_MP_h
|
|
||||||
#define __RTEMS_PARTITION_MP_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/mppkt.h>
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/options.h>
|
|
||||||
#include <rtems/part.h>
|
|
||||||
#include <rtems/thread.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following enumerated type defines the list of
|
|
||||||
* remote partition operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
PARTITION_MP_ANNOUNCE_CREATE = 0,
|
|
||||||
PARTITION_MP_ANNOUNCE_DELETE = 1,
|
|
||||||
PARTITION_MP_EXTRACT_PROXY = 2,
|
|
||||||
PARTITION_MP_GET_BUFFER_REQUEST = 3,
|
|
||||||
PARTITION_MP_GET_BUFFER_RESPONSE = 4,
|
|
||||||
PARTITION_MP_RETURN_BUFFER_REQUEST = 5,
|
|
||||||
PARTITION_MP_RETURN_BUFFER_RESPONSE = 6,
|
|
||||||
} Partition_MP_Remote_operations;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following data structure defines the packet used to perform
|
|
||||||
* remote partition operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
rtems_packet_prefix Prefix;
|
|
||||||
Partition_MP_Remote_operations operation;
|
|
||||||
Objects_Name name;
|
|
||||||
void *buffer;
|
|
||||||
Objects_Id proxy_id;
|
|
||||||
} Partition_MP_Packet;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_MP_Send_process_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* process operation can be performed on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Partition_MP_Send_process_packet (
|
|
||||||
Partition_MP_Remote_operations operation,
|
|
||||||
Objects_Id partition_id,
|
|
||||||
Objects_Name name,
|
|
||||||
Objects_Id proxy_id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_MP_Send_request_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* directive operation can be initiated on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code _Partition_MP_Send_request_packet (
|
|
||||||
Partition_MP_Remote_operations operation,
|
|
||||||
Objects_Id partition_id,
|
|
||||||
void *buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_MP_Send_response_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* directive can be performed on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Partition_MP_Send_response_packet (
|
|
||||||
Partition_MP_Remote_operations operation,
|
|
||||||
Objects_Id partition_id,
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* _Partition_MP_Process_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the actions specific to this package for
|
|
||||||
* the request from another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Partition_MP_Process_packet (
|
|
||||||
rtems_packet_prefix *the_packet_prefix
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_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.
|
|
||||||
*
|
|
||||||
* This routine is not needed by the Partition since a partition
|
|
||||||
* cannot be deleted when buffers are in use.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_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 _Partition_MP_Send_extract_proxy (
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Partition_MP_Get_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function is used to obtain a partition mp packet.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Partition_MP_Packet *_Partition_MP_Get_packet ( void );
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of file */
|
|
||||||
@@ -1,285 +0,0 @@
|
|||||||
/* ratemon.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants, structures, and
|
|
||||||
* prototypes associated with the Rate Monotonic Manager. This manager
|
|
||||||
* provides facilities to implement tasks which execute in a periodic fashion.
|
|
||||||
*
|
|
||||||
* Directives provided are:
|
|
||||||
*
|
|
||||||
* + create a rate monotonic timer
|
|
||||||
* + cancel a period
|
|
||||||
* + delete a rate monotonic timer
|
|
||||||
* + conclude current and start the next period
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_RATE_MONOTONIC_h
|
|
||||||
#define __RTEMS_RATE_MONOTONIC_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/thread.h>
|
|
||||||
#include <rtems/watchdog.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following enumerated type defines the states in which a
|
|
||||||
* period may be.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
RATE_MONOTONIC_INACTIVE, /* off chain, never initialized */
|
|
||||||
RATE_MONOTONIC_ACTIVE, /* on chain, running continuously */
|
|
||||||
RATE_MONOTONIC_EXPIRED /* off chain, will be reset by next rm_period */
|
|
||||||
} Rate_Monotonic_Period_states;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following constant is the interval passed to the rate_monontonic_period
|
|
||||||
* directive to obtain status information.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define RTEMS_PERIOD_STATUS RTEMS_NO_TIMEOUT
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following structure defines the control block used to manage
|
|
||||||
* each period.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
Objects_Control Object;
|
|
||||||
Watchdog_Control Timer;
|
|
||||||
Rate_Monotonic_Period_states state;
|
|
||||||
Thread_Control *owner;
|
|
||||||
} Rate_monotonic_Control;
|
|
||||||
|
|
||||||
EXTERN Objects_Information _Rate_monotonic_Information;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Manager_initialization
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the initialization necessary for this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Rate_monotonic_Manager_initialization(
|
|
||||||
unsigned32 maximum_periods
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_rate_monotonic_create
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rate_monotonic_create directive. The
|
|
||||||
* period will have the name name. It returns the id of the
|
|
||||||
* created period in ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_rate_monotonic_create(
|
|
||||||
Objects_Name name,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_rate_monotonic_ident
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_rate_monotonic_ident directive.
|
|
||||||
* This directive returns the period ID associated with name.
|
|
||||||
* If more than one period is named name, then the period
|
|
||||||
* to which the ID belongs is arbitrary.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_rate_monotonic_ident(
|
|
||||||
Objects_Name name,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_rate_monotonic_cancel
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_rate_monotonic_cancel directive. This
|
|
||||||
* directive stops the period associated with ID from continuing to
|
|
||||||
* run.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_rate_monotonic_cancel(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_rate_monotonic_delete
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_rate_monotonic_delete directive. The
|
|
||||||
* period indicated by ID is deleted.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_rate_monotonic_delete(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_rate_monotonic_period
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_rate_monotonic_period directive. When
|
|
||||||
* length is non-zero, this directive initiates the period associated with
|
|
||||||
* ID from continuing for a period of length. If length is zero, then
|
|
||||||
* result is set to indicate the current state of the period.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_rate_monotonic_period(
|
|
||||||
Objects_Id id,
|
|
||||||
rtems_interval length
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Allocate
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function allocates a period control block from
|
|
||||||
* the inactive chain of free period control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine allocates a period control block from
|
|
||||||
* the inactive chain of free period control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Rate_monotonic_Free (
|
|
||||||
Rate_monotonic_Control *the_period
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Get
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function maps period IDs to period control blocks.
|
|
||||||
* If ID corresponds to a local period, then it returns
|
|
||||||
* the_period control pointer which maps to ID and location
|
|
||||||
* is set to OBJECTS_LOCAL. Otherwise, location is set
|
|
||||||
* to OBJECTS_ERROR and the_period is undefined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Rate_monotonic_Control *_Rate_monotonic_Get (
|
|
||||||
Objects_Id id,
|
|
||||||
Objects_Locations *location
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Set_state
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function blocks the calling task so that it is waiting for
|
|
||||||
* a period to expire. It returns TRUE if the task was successfully
|
|
||||||
* blocked, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
boolean _Rate_monotonic_Set_state(
|
|
||||||
Rate_monotonic_Control *the_period
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Timeout
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine is invoked when the period represented
|
|
||||||
* by ID expires. If the task which owns this period is blocked
|
|
||||||
* waiting for the period to expire, then it is readied and the
|
|
||||||
* period is restarted. If the owning task is not waiting for the
|
|
||||||
* period to expire, then the period is placed in the EXPIRED
|
|
||||||
* state and not restarted.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Rate_monotonic_Timeout (
|
|
||||||
Objects_Id id,
|
|
||||||
void *ignored
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Is_active
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_period is in the ACTIVE state,
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Rate_monotonic_Is_active (
|
|
||||||
Rate_monotonic_Control *the_period
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Is_inactive
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_period is in the ACTIVE state,
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Rate_monotonic_Is_inactive (
|
|
||||||
Rate_monotonic_Control *the_period
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Is_expired
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_period is in the EXPIRED state,
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Rate_monotonic_Is_expired (
|
|
||||||
Rate_monotonic_Control *the_period
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Rate_monotonic_Is_null
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_period is NULL and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Rate_monotonic_Is_null (
|
|
||||||
Rate_monotonic_Control *the_period
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/ratemon.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,311 +0,0 @@
|
|||||||
/* region.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Region Manager. This manager provides facilities to dynamically
|
|
||||||
* allocate memory in variable sized units which are returned as segments.
|
|
||||||
*
|
|
||||||
* Directives provided are:
|
|
||||||
*
|
|
||||||
* + create a region
|
|
||||||
* + get an ID of a region
|
|
||||||
* + delete a region
|
|
||||||
* + get a segment from a region
|
|
||||||
* + return a segment to a region
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_REGION_h
|
|
||||||
#define __RTEMS_REGION_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/threadq.h>
|
|
||||||
#include <rtems/heap.h>
|
|
||||||
#include <rtems/debug.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following records define the control block used to manage
|
|
||||||
* each region.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
Objects_Control Object;
|
|
||||||
Thread_queue_Control Wait_queue; /* waiting threads */
|
|
||||||
void *starting_address; /* physical start addr */
|
|
||||||
unsigned32 length; /* physical length(bytes) */
|
|
||||||
unsigned32 page_size; /* in bytes */
|
|
||||||
unsigned32 maximum_segment_size; /* in bytes */
|
|
||||||
rtems_attribute attribute_set;
|
|
||||||
unsigned32 number_of_used_blocks; /* blocks allocated */
|
|
||||||
Heap_Control Memory;
|
|
||||||
} Region_Control;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following defines the information control block used to
|
|
||||||
* manage this class of objects.
|
|
||||||
*/
|
|
||||||
|
|
||||||
EXTERN Objects_Information _Region_Information;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_Manager_initialization
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the initialization necessary for this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Region_Manager_initialization(
|
|
||||||
unsigned32 maximum_regions
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_region_create
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_region_create directive. The
|
|
||||||
* region will have the name name. The memory area managed by
|
|
||||||
* the region is of length bytes and starts at starting_address.
|
|
||||||
* The memory area will be divided into as many allocatable units of
|
|
||||||
* page_size bytes as possible. The attribute_set determines which
|
|
||||||
* thread queue discipline is used by the region. It returns the
|
|
||||||
* id of the created region in ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_region_create(
|
|
||||||
Objects_Name name,
|
|
||||||
void *starting_address,
|
|
||||||
unsigned32 length,
|
|
||||||
unsigned32 page_size,
|
|
||||||
rtems_attribute attribute_set,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_region_extend
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_region_extend directive. The
|
|
||||||
* region will have the name name. The memory area managed by
|
|
||||||
* the region will be attempted to be grown by length bytes using
|
|
||||||
* the memory starting at starting_address.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_region_extend(
|
|
||||||
Objects_Id id,
|
|
||||||
void *starting_address,
|
|
||||||
unsigned32 length
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_region_ident
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_region_ident directive.
|
|
||||||
* This directive returns the region ID associated with name.
|
|
||||||
* If more than one region is named name, then the region
|
|
||||||
* to which the ID belongs is arbitrary.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_region_ident(
|
|
||||||
Objects_Name name,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_region_delete
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_region_delete directive. The
|
|
||||||
* region indicated by ID is deleted.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_region_delete(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_region_get_segment
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_region_get_segment directive. It
|
|
||||||
* attempts to allocate a segment from the region associated with ID.
|
|
||||||
* If a segment of the requested size can be allocated, its address
|
|
||||||
* is returned in segment. If no segment is available, then the task
|
|
||||||
* may return immediately or block waiting for a segment with an optional
|
|
||||||
* timeout of timeout clock ticks. Whether the task blocks or returns
|
|
||||||
* immediately is based on the no_wait option in the option_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_region_get_segment(
|
|
||||||
Objects_Id id,
|
|
||||||
unsigned32 size,
|
|
||||||
rtems_option option_set,
|
|
||||||
rtems_interval timeout,
|
|
||||||
void **segment
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_region_get_segment_size
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_region_get_segment_size directive. It
|
|
||||||
* returns the size in bytes of the specified user memory area.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_region_get_segment_size(
|
|
||||||
Objects_Id id,
|
|
||||||
void *segment,
|
|
||||||
unsigned32 *size
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_region_return_segment
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_region_return_segment directive. It
|
|
||||||
* frees the segment to the region associated with ID. The segment must
|
|
||||||
* have been previously allocated from the same region. If freeing the
|
|
||||||
* segment results in enough memory being available to satisfy the
|
|
||||||
* rtems_region_get_segment of the first blocked task, then that task and as
|
|
||||||
* many subsequent tasks as possible will be unblocked with their requests
|
|
||||||
* satisfied.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_region_return_segment(
|
|
||||||
Objects_Id id,
|
|
||||||
void *segment
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_Allocate
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function allocates a region control block from
|
|
||||||
* the inactive chain of free region control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Region_Control *_Region_Allocate( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a region control block to the
|
|
||||||
* inactive chain of free region control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Region_Free (
|
|
||||||
Region_Control *the_region
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_Get
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function maps region IDs to region control blocks.
|
|
||||||
* If ID corresponds to a local region, then it returns
|
|
||||||
* the_region control pointer which maps to ID and location
|
|
||||||
* is set to OBJECTS_LOCAL. Otherwise, location is set
|
|
||||||
* to OBJECTS_ERROR and the_region is undefined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Region_Control *_Region_Get (
|
|
||||||
Objects_Id id,
|
|
||||||
Objects_Locations *location
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_Allocate_segment
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function attempts to allocate a segment from the_region.
|
|
||||||
* If successful, it returns the address of the allocated segment.
|
|
||||||
* Otherwise, it returns NULL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void *_Region_Allocate_segment (
|
|
||||||
Region_Control *the_region,
|
|
||||||
unsigned32 size
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_Free_segment
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function frees the_segment to the_region.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Region_Free_segment (
|
|
||||||
Region_Control *the_region,
|
|
||||||
void *the_segment
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_Is_null
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_region is NULL and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Region_Is_null (
|
|
||||||
Region_Control *the_region
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/region.inl>
|
|
||||||
#include <rtems/regionmp.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_Debug_Walk
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine is invoked to verify the integrity of a heap associated
|
|
||||||
* with the_region.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef RTEMS_DEBUG
|
|
||||||
|
|
||||||
#define _Region_Debug_Walk( _the_region, _source ) \
|
|
||||||
do { \
|
|
||||||
if ( _Debug_Is_enabled( RTEMS_DEBUG_REGION ) ) \
|
|
||||||
_Heap_Walk( &(_the_region)->Memory, _source, FALSE ); \
|
|
||||||
} while ( 0 )
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define _Region_Debug_Walk( _the_region, _source )
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,165 +0,0 @@
|
|||||||
/* regionmp.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Multiprocessing Support in the Region Manager.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_REGION_MP_h
|
|
||||||
#define __RTEMS_REGION_MP_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/mppkt.h>
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/options.h>
|
|
||||||
#include <rtems/region.h>
|
|
||||||
#include <rtems/thread.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following enumerated type defines the list of
|
|
||||||
* remote region operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
REGION_MP_ANNOUNCE_CREATE = 0,
|
|
||||||
REGION_MP_ANNOUNCE_DELETE = 1,
|
|
||||||
REGION_MP_EXTRACT_PROXY = 2,
|
|
||||||
REGION_MP_GET_SEGMENT_REQUEST = 3,
|
|
||||||
REGION_MP_GET_SEGMENT_RESPONSE = 4,
|
|
||||||
REGION_MP_RETURN_SEGMENT_REQUEST = 5,
|
|
||||||
REGION_MP_RETURN_SEGMENT_RESPONSE = 6,
|
|
||||||
} Region_MP_Remote_operations;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following data structure defines the packet used to perform
|
|
||||||
* remote region operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
rtems_packet_prefix Prefix;
|
|
||||||
Region_MP_Remote_operations operation;
|
|
||||||
Objects_Name name;
|
|
||||||
rtems_option option_set;
|
|
||||||
unsigned32 size;
|
|
||||||
Objects_Id proxy_id;
|
|
||||||
void *segment;
|
|
||||||
} Region_MP_Packet;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_MP_Send_process_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* process operation can be performed on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Region_MP_Send_process_packet (
|
|
||||||
Region_MP_Remote_operations operation,
|
|
||||||
Objects_Id region_id,
|
|
||||||
Objects_Name name,
|
|
||||||
Objects_Id proxy_id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_MP_Send_request_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* directive operation can be initiated on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code _Region_MP_Send_request_packet (
|
|
||||||
Region_MP_Remote_operations operation,
|
|
||||||
Objects_Id region_id,
|
|
||||||
void *segment,
|
|
||||||
unsigned32 size,
|
|
||||||
rtems_option option_set,
|
|
||||||
rtems_interval timeout
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_MP_Send_response_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* directive can be performed on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Region_MP_Send_response_packet (
|
|
||||||
Region_MP_Remote_operations operation,
|
|
||||||
Objects_Id region_id,
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* _Region_MP_Process_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the actions specific to this package for
|
|
||||||
* the request from another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Region_MP_Process_packet (
|
|
||||||
rtems_packet_prefix *the_packet_prefix
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_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.
|
|
||||||
*
|
|
||||||
* This routine is not needed by the Region since a region
|
|
||||||
* cannot be deleted when segments are in use.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_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 _Region_MP_Send_extract_proxy (
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Region_MP_Get_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function is used to obtain a region mp packet.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Region_MP_Packet *_Region_MP_Get_packet ( void );
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of file */
|
|
||||||
@@ -1,238 +0,0 @@
|
|||||||
/* semaphore.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Semaphore Manager. This manager utilizes standard Dijkstra
|
|
||||||
* counting semaphores to provide synchronization and mutual exclusion
|
|
||||||
* capabilities.
|
|
||||||
*
|
|
||||||
* Directives provided are:
|
|
||||||
*
|
|
||||||
* + create a semaphore
|
|
||||||
* + get an ID of a semaphore
|
|
||||||
* + delete a semaphore
|
|
||||||
* + acquire a semaphore
|
|
||||||
* + release a semaphore
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_SEMAPHORE_h
|
|
||||||
#define __RTEMS_SEMAPHORE_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/attr.h>
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/threadq.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following defines the control block used to manage each semaphore.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
Objects_Control Object;
|
|
||||||
Thread_queue_Control Wait_queue;
|
|
||||||
rtems_attribute attribute_set;
|
|
||||||
unsigned32 count;
|
|
||||||
unsigned32 nest_count;
|
|
||||||
Thread_Control *holder;
|
|
||||||
Objects_Id holder_id;
|
|
||||||
} Semaphore_Control;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following defines the information control block used to manage
|
|
||||||
* this class of objects.
|
|
||||||
*/
|
|
||||||
|
|
||||||
EXTERN Objects_Information _Semaphore_Information;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Semaphore_Manager_initialization
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the initialization necessary for this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Semaphore_Manager_initialization(
|
|
||||||
unsigned32 maximum_semaphores
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_semaphore_create
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_semaphore_create directive. The
|
|
||||||
* semaphore will have the name name. The starting count for
|
|
||||||
* the semaphore is count. The attribute_set determines if
|
|
||||||
* the semaphore is global or local and the thread queue
|
|
||||||
* discipline. It returns the id of the created semaphore in ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_semaphore_create(
|
|
||||||
Objects_Name name,
|
|
||||||
unsigned32 count,
|
|
||||||
rtems_attribute attribute_set,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_semaphore_ident
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_semaphore_ident directive.
|
|
||||||
* This directive returns the semaphore ID associated with name.
|
|
||||||
* If more than one semaphore is named name, then the semaphore
|
|
||||||
* to which the ID belongs is arbitrary. node indicates the
|
|
||||||
* extent of the search for the ID of the semaphore named name.
|
|
||||||
* The search can be limited to a particular node or allowed to
|
|
||||||
* encompass all nodes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_semaphore_ident(
|
|
||||||
Objects_Name name,
|
|
||||||
unsigned32 node,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_semaphore_delete
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_semaphore_delete directive. The
|
|
||||||
* semaphore indicated by ID is deleted.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_semaphore_delete(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_semaphore_obtain
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_semaphore_obtain directive. It
|
|
||||||
* attempts to obtain a unit from the semaphore associated with ID.
|
|
||||||
* If a unit can be allocated, the calling task will return immediately.
|
|
||||||
* If no unit is available, then the task may return immediately or
|
|
||||||
* block waiting for a unit with an optional timeout of timeout
|
|
||||||
* clock ticks. Whether the task blocks or returns immediately
|
|
||||||
* is based on the RTEMS_NO_WAIT option in the option_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_semaphore_obtain(
|
|
||||||
Objects_Id id,
|
|
||||||
unsigned32 option_set,
|
|
||||||
rtems_interval timeout
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_semaphore_release
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_semaphore_release directive. It
|
|
||||||
* frees a unit to the semaphore associated with ID. If a task was
|
|
||||||
* blocked waiting for a unit from this semaphore, then that task will
|
|
||||||
* be readied and the unit given to that task. Otherwise, the unit
|
|
||||||
* will be returned to the semaphore.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_semaphore_release(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Semaphore_Seize
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine attempts to receive a unit from the_semaphore.
|
|
||||||
* If a unit is available or if the RTEMS_NO_WAIT option is enabled in
|
|
||||||
* option_set, then the routine returns. Otherwise, the calling task
|
|
||||||
* is blocked until a unit becomes available.
|
|
||||||
*/
|
|
||||||
|
|
||||||
boolean _Semaphore_Seize(
|
|
||||||
Semaphore_Control *the_semaphore,
|
|
||||||
unsigned32 option_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Semaphore_Allocate
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function allocates a semaphore control block from
|
|
||||||
* the inactive chain of free semaphore control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Semaphore_Control *_Semaphore_Allocate( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Semaphore_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a semaphore control block to the
|
|
||||||
* inactive chain of free semaphore control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Semaphore_Free (
|
|
||||||
Semaphore_Control *the_semaphore
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Semaphore_Control *_Semaphore_Get (
|
|
||||||
Objects_Id id,
|
|
||||||
Objects_Locations *location
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Semaphore_Is_null
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Semaphore_Is_null (
|
|
||||||
Semaphore_Control *the_semaphore
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/sem.inl>
|
|
||||||
#include <rtems/semmp.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,163 +0,0 @@
|
|||||||
/* semmp.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Multiprocessing Support in the Semaphore Manager.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_SEMAPHORE_MP_h
|
|
||||||
#define __RTEMS_SEMAPHORE_MP_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/mppkt.h>
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/options.h>
|
|
||||||
#include <rtems/sem.h>
|
|
||||||
#include <rtems/thread.h>
|
|
||||||
#include <rtems/watchdog.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following enumerated type defines the list of
|
|
||||||
* remote semaphore operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
SEMAPHORE_MP_ANNOUNCE_CREATE = 0,
|
|
||||||
SEMAPHORE_MP_ANNOUNCE_DELETE = 1,
|
|
||||||
SEMAPHORE_MP_EXTRACT_PROXY = 2,
|
|
||||||
SEMAPHORE_MP_OBTAIN_REQUEST = 3,
|
|
||||||
SEMAPHORE_MP_OBTAIN_RESPONSE = 4,
|
|
||||||
SEMAPHORE_MP_RELEASE_REQUEST = 5,
|
|
||||||
SEMAPHORE_MP_RELEASE_RESPONSE = 6,
|
|
||||||
} Semaphore_MP_Remote_operations;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following data structure defines the packet used to perform
|
|
||||||
* remote semaphore operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
rtems_packet_prefix Prefix;
|
|
||||||
Semaphore_MP_Remote_operations operation;
|
|
||||||
Objects_Name name;
|
|
||||||
rtems_option option_set;
|
|
||||||
Objects_Id proxy_id;
|
|
||||||
} Semaphore_MP_Packet;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _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 _Semaphore_MP_Send_process_packet (
|
|
||||||
Semaphore_MP_Remote_operations operation,
|
|
||||||
Objects_Id semaphore_id,
|
|
||||||
Objects_Name name,
|
|
||||||
Objects_Id proxy_id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Semaphore_MP_Send_request_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* directive operation can be initiated on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code _Semaphore_MP_Send_request_packet (
|
|
||||||
Semaphore_MP_Remote_operations operation,
|
|
||||||
Objects_Id semaphore_id,
|
|
||||||
rtems_option option_set,
|
|
||||||
rtems_interval timeout
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Semaphore_MP_Send_response_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* directive can be performed on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Semaphore_MP_Send_response_packet (
|
|
||||||
Semaphore_MP_Remote_operations operation,
|
|
||||||
Objects_Id semaphore_id,
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* _Semaphore_MP_Process_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the actions specific to this package for
|
|
||||||
* the request from another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Semaphore_MP_Process_packet (
|
|
||||||
rtems_packet_prefix *the_packet_prefix
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _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 _Semaphore_MP_Send_object_was_deleted (
|
|
||||||
Thread_Control *the_proxy
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _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 _Semaphore_MP_Send_extract_proxy (
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Semaphore_MP_Get_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function is used to obtain a semaphore mp packet.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Semaphore_MP_Packet *_Semaphore_MP_Get_packet ( void );
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of file */
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
/* signal.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Signal Manager. This manager provides capabilities required
|
|
||||||
* for asynchronous communication between tasks via signal sets.
|
|
||||||
*
|
|
||||||
* Directives provided are:
|
|
||||||
*
|
|
||||||
* + establish an asynchronous signal routine
|
|
||||||
* + send a signal set to a task
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_SIGNAL_h
|
|
||||||
#define __RTEMS_SIGNAL_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/asr.h>
|
|
||||||
#include <rtems/modes.h>
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/status.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_signal_catch
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_signal_catch directive. This directive
|
|
||||||
* is used to establish asr_handler as the Asynchronous Signal Routine
|
|
||||||
* (RTEMS_ASR) for the calling task. The asr_handler will execute with a
|
|
||||||
* mode of mode_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_signal_catch(
|
|
||||||
rtems_asr_entry asr_handler,
|
|
||||||
rtems_mode mode_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_signal_send
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_signal_send directive. This directive
|
|
||||||
* sends the signal_set to the task specified by ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_signal_send(
|
|
||||||
Objects_Id id,
|
|
||||||
rtems_signal_set signal_set
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/signalmp.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,147 +0,0 @@
|
|||||||
/* signalmp.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the Multiprocessing Support in the Signal Manager.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_SIGNAL_MP_h
|
|
||||||
#define __RTEMS_SIGNAL_MP_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/asr.h>
|
|
||||||
#include <rtems/mppkt.h>
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/thread.h>
|
|
||||||
#include <rtems/watchdog.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following enumerated type defines the list of
|
|
||||||
* remote signal operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
SIGNAL_MP_SEND_REQUEST = 0,
|
|
||||||
SIGNAL_MP_SEND_RESPONSE = 1,
|
|
||||||
} Signal_MP_Remote_operations;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following data structure defines the packet used to perform
|
|
||||||
* remote signal operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
rtems_packet_prefix Prefix;
|
|
||||||
Signal_MP_Remote_operations operation;
|
|
||||||
rtems_signal_set signal_in;
|
|
||||||
} Signal_MP_Packet;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Signal_MP_Send_process_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* process operation can be performed on another node.
|
|
||||||
*
|
|
||||||
* This routine is not needed since there are no process
|
|
||||||
* packets to be sent by this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Signal_MP_Send_request_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* directive operation can be initiated on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code _Signal_MP_Send_request_packet (
|
|
||||||
Signal_MP_Remote_operations operation,
|
|
||||||
Objects_Id task_id,
|
|
||||||
rtems_signal_set signal_in
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Signal_MP_Send_response_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* directive can be performed on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Signal_MP_Send_response_packet (
|
|
||||||
Signal_MP_Remote_operations operation,
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* _Signal_MP_Process_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the actions specific to this package for
|
|
||||||
* the request from another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Signal_MP_Process_packet (
|
|
||||||
rtems_packet_prefix *the_packet_prefix
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Signal_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.
|
|
||||||
*
|
|
||||||
* This routine is not needed since there are no objects
|
|
||||||
* deleted by this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Signal_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.
|
|
||||||
*
|
|
||||||
* This routine is not needed since there are no objects
|
|
||||||
* deleted by this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Signal_MP_Get_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function is used to obtain a signal mp packet.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Signal_MP_Packet *_Signal_MP_Get_packet ( void );
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of file */
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
/* status.h
|
|
||||||
*
|
|
||||||
* This include file contains the status codes returned from the
|
|
||||||
* executive directives.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_STATUS_h
|
|
||||||
#define __RTEMS_STATUS_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* types */
|
|
||||||
|
|
||||||
/* enumerated constants */
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
RTEMS_SUCCESSFUL = 0, /* successful completion */
|
|
||||||
RTEMS_TASK_EXITTED = 1, /* returned from a thread */
|
|
||||||
RTEMS_MP_NOT_CONFIGURED = 2, /* multiprocessing not configured */
|
|
||||||
RTEMS_INVALID_NAME = 3, /* invalid object name */
|
|
||||||
RTEMS_INVALID_ID = 4, /* invalid object id */
|
|
||||||
RTEMS_TOO_MANY = 5, /* too many */
|
|
||||||
RTEMS_TIMEOUT = 6, /* timed out waiting */
|
|
||||||
RTEMS_OBJECT_WAS_DELETED = 7, /* object deleted while waiting */
|
|
||||||
RTEMS_INVALID_SIZE = 8, /* specified size was invalid */
|
|
||||||
RTEMS_INVALID_ADDRESS = 9, /* address specified is invalid */
|
|
||||||
RTEMS_INVALID_NUMBER = 10, /* number was invalid */
|
|
||||||
RTEMS_NOT_DEFINED = 11, /* item has not been initialized */
|
|
||||||
RTEMS_RESOURCE_IN_USE = 12, /* resources still outstanding */
|
|
||||||
RTEMS_UNSATISFIED = 13, /* request not satisfied */
|
|
||||||
RTEMS_INCORRECT_STATE = 14, /* thread is in wrong state */
|
|
||||||
RTEMS_ALREADY_SUSPENDED = 15, /* thread already in state */
|
|
||||||
RTEMS_ILLEGAL_ON_SELF = 16, /* illegal on calling thread */
|
|
||||||
RTEMS_ILLEGAL_ON_REMOTE_OBJECT = 17, /* illegal for remote object */
|
|
||||||
RTEMS_CALLED_FROM_ISR = 18, /* called from wrong environment */
|
|
||||||
RTEMS_INVALID_PRIORITY = 19, /* invalid thread priority */
|
|
||||||
RTEMS_INVALID_CLOCK = 20, /* invalid date/time */
|
|
||||||
RTEMS_INVALID_NODE = 21, /* invalid node id */
|
|
||||||
RTEMS_NOT_CONFIGURED = 22, /* directive not configured */
|
|
||||||
RTEMS_NOT_OWNER_OF_RESOURCE = 23, /* not owner of resource */
|
|
||||||
RTEMS_NOT_IMPLEMENTED = 24, /* directive not implemented */
|
|
||||||
RTEMS_INTERNAL_ERROR = 25, /* RTEMS inconsistency detected */
|
|
||||||
RTEMS_PROXY_BLOCKING = 26, /* internal multiprocessing only */
|
|
||||||
RTEMS_NO_MEMORY = 27 /* could not get enough memory */
|
|
||||||
} rtems_status_code;
|
|
||||||
|
|
||||||
#define RTEMS_STATUS_CODES_FIRST RTEMS_SUCCESSFUL
|
|
||||||
#define RTEMS_STATUS_CODES_LAST RTEMS_NO_MEMORY
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_is_status_successful
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the status code is equal to RTEMS_SUCCESSFUL,
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean rtems_is_status_successful (
|
|
||||||
rtems_status_code code
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_are_statuses_equal
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the status code1 is equal to code2,
|
|
||||||
* and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean rtems_are_statuses_equal (
|
|
||||||
rtems_status_code code1,
|
|
||||||
rtems_status_code code2
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Status_Is_proxy_blocking
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the status code is equal to the
|
|
||||||
* status which indicates that a proxy is blocking, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Status_Is_proxy_blocking (
|
|
||||||
rtems_status_code code
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/status.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,167 +0,0 @@
|
|||||||
/* taskmp.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants and structures associated
|
|
||||||
* with the multiprocessing support in the task manager.
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_RTEMS_TASKS_MP_h
|
|
||||||
#define __RTEMS_RTEMS_TASKS_MP_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/mppkt.h>
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/options.h>
|
|
||||||
#include <rtems/priority.h>
|
|
||||||
#include <rtems/tasks.h>
|
|
||||||
#include <rtems/thread.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following enumerated type defines the list of
|
|
||||||
* remote task operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
RTEMS_TASKS_MP_ANNOUNCE_CREATE = 0,
|
|
||||||
RTEMS_TASKS_MP_ANNOUNCE_DELETE = 1,
|
|
||||||
RTEMS_TASKS_MP_SUSPEND_REQUEST = 2,
|
|
||||||
RTEMS_TASKS_MP_SUSPEND_RESPONSE = 3,
|
|
||||||
RTEMS_TASKS_MP_RESUME_REQUEST = 4,
|
|
||||||
RTEMS_TASKS_MP_RESUME_RESPONSE = 5,
|
|
||||||
RTEMS_TASKS_MP_SET_PRIORITY_REQUEST = 6,
|
|
||||||
RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE = 7,
|
|
||||||
RTEMS_TASKS_MP_GET_NOTE_REQUEST = 8,
|
|
||||||
RTEMS_TASKS_MP_GET_NOTE_RESPONSE = 9,
|
|
||||||
RTEMS_TASKS_MP_SET_NOTE_REQUEST = 10,
|
|
||||||
RTEMS_TASKS_MP_SET_NOTE_RESPONSE = 11,
|
|
||||||
} RTEMS_tasks_MP_Remote_operations;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following data structure defines the packet used to perform
|
|
||||||
* remote task operations.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
rtems_packet_prefix Prefix;
|
|
||||||
RTEMS_tasks_MP_Remote_operations operation;
|
|
||||||
Objects_Name name;
|
|
||||||
rtems_task_priority the_priority;
|
|
||||||
unsigned32 notepad;
|
|
||||||
unsigned32 note;
|
|
||||||
} RTEMS_tasks_MP_Packet;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _RTEMS_tasks_MP_Send_process_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* process operation can be performed on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _RTEMS_tasks_MP_Send_process_packet (
|
|
||||||
RTEMS_tasks_MP_Remote_operations operation,
|
|
||||||
Objects_Id task_id,
|
|
||||||
Objects_Name name
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _RTEMS_tasks_MP_Send_request_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* directive operation can be initiated on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code _RTEMS_tasks_MP_Send_request_packet (
|
|
||||||
RTEMS_tasks_MP_Remote_operations operation,
|
|
||||||
Objects_Id task_id,
|
|
||||||
rtems_task_priority the_priority,
|
|
||||||
unsigned32 notepad,
|
|
||||||
unsigned32 note
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _RTEMS_tasks_MP_Send_response_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs a remote procedure call so that a
|
|
||||||
* directive can be performed on another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _RTEMS_tasks_MP_Send_response_packet (
|
|
||||||
RTEMS_tasks_MP_Remote_operations operation,
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* _RTEMS_tasks_MP_Process_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the actions specific to this package for
|
|
||||||
* the request from another node.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _RTEMS_tasks_MP_Process_packet (
|
|
||||||
rtems_packet_prefix *the_packet_prefix
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _RTEMS_tasks_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.
|
|
||||||
*
|
|
||||||
* This routine is not needed by RTEMS_tasks since a task
|
|
||||||
* cannot be deleted when segments are in use.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _RTEMS_tasks_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.
|
|
||||||
*
|
|
||||||
* This routine is not needed since there are no objects
|
|
||||||
* deleted by this manager.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _RTEMS_tasks_MP_Get_packet
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function is used to obtain a task mp packet.
|
|
||||||
*/
|
|
||||||
|
|
||||||
RTEMS_tasks_MP_Packet *_RTEMS_tasks_MP_Get_packet ( void );
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of file */
|
|
||||||
@@ -1,315 +0,0 @@
|
|||||||
/* tasks.h
|
|
||||||
*
|
|
||||||
* This include file contains all constants and structures associated
|
|
||||||
* with RTEMS tasks. This manager provides a comprehensive set of directives
|
|
||||||
* to create, delete, and administer tasks.
|
|
||||||
*
|
|
||||||
* Directives provided are:
|
|
||||||
*
|
|
||||||
* + create a task
|
|
||||||
* + get an ID of a task
|
|
||||||
* + start a task
|
|
||||||
* + restart a task
|
|
||||||
* + delete a task
|
|
||||||
* + suspend a task
|
|
||||||
* + resume a task
|
|
||||||
* + set a task's priority
|
|
||||||
* + change the current task's mode
|
|
||||||
* + get a task notepad entry
|
|
||||||
* + set a task notepad entry
|
|
||||||
* + wake up after interval
|
|
||||||
* + wake up when specified
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_RTEMS_TASKS_h
|
|
||||||
#define __RTEMS_RTEMS_TASKS_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/message.h>
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/part.h>
|
|
||||||
#include <rtems/region.h>
|
|
||||||
#include <rtems/sem.h>
|
|
||||||
#include <rtems/states.h>
|
|
||||||
#include <rtems/thread.h>
|
|
||||||
#include <rtems/threadq.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Constant to be used as the ID of current task
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define RTEMS_SELF OBJECTS_ID_OF_SELF
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This constant is passed to the rtems_task_wake_after directive as the
|
|
||||||
* interval when a task wishes to yield the CPU.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define RTEMS_YIELD_PROCESSOR RTEMS_NO_TIMEOUT
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_task_create
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_task_create directive. The task
|
|
||||||
* will have the name name. The attribute_set can be used to indicate
|
|
||||||
* that the task will be globally accessible or utilize floating point.
|
|
||||||
* The task's stack will be stack_size bytes. The task will begin
|
|
||||||
* execution with initial_priority and initial_modes. It returns the
|
|
||||||
* id of the created task in ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_task_create(
|
|
||||||
Objects_Name name,
|
|
||||||
rtems_task_priority initial_priority,
|
|
||||||
unsigned32 stack_size,
|
|
||||||
rtems_mode initial_modes,
|
|
||||||
rtems_attribute attribute_set,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_task_ident
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_task_ident directive.
|
|
||||||
* This directive returns the task ID associated with name.
|
|
||||||
* If more than one task is named name, then the task to
|
|
||||||
* which the ID belongs is arbitrary. node indicates the
|
|
||||||
* extent of the search for the ID of the task named name.
|
|
||||||
* The search can be limited to a particular node or allowed to
|
|
||||||
* encompass all nodes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_task_ident(
|
|
||||||
Objects_Name name,
|
|
||||||
unsigned32 node,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_task_delete
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_task_delete directive. The
|
|
||||||
* task indicated by ID is deleted.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_task_delete(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_task_get_note
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_task_get_note directive. The
|
|
||||||
* value of the indicated notepad for the task associated with ID
|
|
||||||
* is returned in note.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_task_get_note(
|
|
||||||
Objects_Id id,
|
|
||||||
unsigned32 notepad,
|
|
||||||
unsigned32 *note
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_task_set_note
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_task_set_note directive. The
|
|
||||||
* value of the indicated notepad for the task associated with ID
|
|
||||||
* is returned in note.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_task_set_note(
|
|
||||||
Objects_Id id,
|
|
||||||
unsigned32 notepad,
|
|
||||||
unsigned32 note
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_task_mode
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_task_mode directive. The current
|
|
||||||
* values of the modes indicated by mask of the calling task are changed
|
|
||||||
* to that indicated in mode_set. The former mode of the task is
|
|
||||||
* returned in mode_set.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_task_mode(
|
|
||||||
rtems_mode mode_set,
|
|
||||||
rtems_mode mask,
|
|
||||||
rtems_mode *previous_mode_set
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_task_restart
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_task_restart directive. The
|
|
||||||
* task associated with ID is restarted at its initial entry
|
|
||||||
* point with the new argument.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_task_restart(
|
|
||||||
Objects_Id id,
|
|
||||||
unsigned32 arg
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_task_suspend
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_task_suspend directive. The
|
|
||||||
* SUSPENDED state is set for task associated with ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_task_suspend(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_task_resume
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_task_resume Directive. The
|
|
||||||
* SUSPENDED state is cleared for task associated with ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_task_resume(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_task_set_priority
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_task_set_priority directive. The
|
|
||||||
* current priority of the task associated with ID is set to
|
|
||||||
* new_priority. The former priority of that task is returned
|
|
||||||
* in old_priority.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_task_set_priority(
|
|
||||||
Objects_Id id,
|
|
||||||
rtems_task_priority new_priority,
|
|
||||||
rtems_task_priority *old_priority
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_task_start
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_task_start directive. The
|
|
||||||
* starting execution point of the task associated with ID is
|
|
||||||
* set to entry_point with the initial argument.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_task_start(
|
|
||||||
Objects_Id id,
|
|
||||||
rtems_task_entry entry_point,
|
|
||||||
unsigned32 argument
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_task_wake_when
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_task_wake_when directive. The
|
|
||||||
* calling task is blocked until the current time of day is
|
|
||||||
* equal to that indicated by time_buffer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_task_wake_when(
|
|
||||||
rtems_time_of_day *time_buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_task_wake_after
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_task_wake_after directive. The
|
|
||||||
* calling task is blocked until the indicated number of clock
|
|
||||||
* ticks have occurred.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_task_wake_after(
|
|
||||||
rtems_interval ticks
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _RTEMS_tasks_Allocate
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function allocates a task control block from
|
|
||||||
* the inactive chain of free task control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Thread_Control *_RTEMS_tasks_Allocate( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _RTEMS_tasks_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a task control block to the
|
|
||||||
* inactive chain of free task control blocks.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _RTEMS_tasks_Free (
|
|
||||||
Thread_Control *the_task
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _RTEMS_tasks_Cancel_wait
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine unblocks the_thread and cancels any timers
|
|
||||||
* which the_thread has active.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _RTEMS_tasks_Cancel_wait(
|
|
||||||
Thread_Control *the_thread
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/tasks.inl>
|
|
||||||
#include <rtems/taskmp.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -1,292 +0,0 @@
|
|||||||
/* timer.h
|
|
||||||
*
|
|
||||||
* This include file contains all the constants, structures, and
|
|
||||||
* prototypes associated with the Timer Manager. This manager provides
|
|
||||||
* facilities to configure, initiate, cancel, and delete timers which will
|
|
||||||
* fire at specified intervals of time.
|
|
||||||
*
|
|
||||||
* Directives provided are:
|
|
||||||
*
|
|
||||||
* + create a timer
|
|
||||||
* + get an ID of a timer
|
|
||||||
* + delete a timer
|
|
||||||
* + set a timer to fire after a number of ticks have passed
|
|
||||||
* + set a timer to fire when a specified date and time has been reached
|
|
||||||
* + reset a timer
|
|
||||||
* + cancel a time
|
|
||||||
*
|
|
||||||
* 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 file and its derivatives.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RTEMS_TIMER_h
|
|
||||||
#define __RTEMS_TIMER_h
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <rtems/object.h>
|
|
||||||
#include <rtems/tod.h>
|
|
||||||
#include <rtems/watchdog.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following enumerated type details the classes to which a timer
|
|
||||||
* may belong.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
TIMER_INTERVAL,
|
|
||||||
TIMER_TIME_OF_DAY,
|
|
||||||
TIMER_DORMANT
|
|
||||||
} Timer_Classes;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following defines the type of a Timer Service Routine.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef rtems_timer_service_routine_entry Timer_Service;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following defines the information control block used to manage
|
|
||||||
* this class of objects.
|
|
||||||
*/
|
|
||||||
|
|
||||||
EXTERN Objects_Information _Timer_Information;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following records define the control block used to manage
|
|
||||||
* each timer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
Objects_Control Object;
|
|
||||||
Watchdog_Control Ticker;
|
|
||||||
Timer_Classes the_class;
|
|
||||||
} Timer_Control;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Manager_initialization
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine performs the initialization necessary for this manager.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _Timer_Manager_initialization(
|
|
||||||
unsigned32 maximum_timers
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_timer_create
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_timer_create directive. The
|
|
||||||
* timer will have the name name. It returns the id of the
|
|
||||||
* created timer in ID.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_timer_create(
|
|
||||||
Objects_Name name,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_timer_ident
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_timer_ident directive.
|
|
||||||
* This directive returns the timer ID associated with name.
|
|
||||||
* If more than one timer is named name, then the timer
|
|
||||||
* to which the ID belongs is arbitrary.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_timer_ident(
|
|
||||||
Objects_Name name,
|
|
||||||
Objects_Id *id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_timer_cancel
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_timer_cancel directive. It is used
|
|
||||||
* to stop the timer associated with ID from firing.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_timer_cancel(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_timer_delete
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_timer_delete directive. The
|
|
||||||
* timer indicated by ID is deleted.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_timer_delete(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_timer_fire_after
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_timer_fire_after directive. It
|
|
||||||
* initiates the timer associated with ID to fire in ticks clock
|
|
||||||
* ticks. When the timer fires, the routine will be invoked.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_timer_fire_after(
|
|
||||||
Objects_Id id,
|
|
||||||
rtems_interval ticks,
|
|
||||||
Timer_Service routine,
|
|
||||||
void *user_data
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_timer_fire_when
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_timer_fire_when directive. It
|
|
||||||
* initiates the timer associated with ID to fire at wall_time
|
|
||||||
* When the timer fires, the routine will be invoked.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_timer_fire_when(
|
|
||||||
Objects_Id id,
|
|
||||||
rtems_time_of_day *wall_time,
|
|
||||||
Timer_Service routine,
|
|
||||||
void *user_data
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* rtems_timer_reset
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine implements the rtems_timer_reset directive. It is used
|
|
||||||
* to reinitialize the interval timer associated with ID just as if
|
|
||||||
* rtems_timer_fire_after were re-invoked with the same arguments that
|
|
||||||
* were used to initiate this timer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_status_code rtems_timer_reset(
|
|
||||||
Objects_Id id
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Allocate
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function allocates a timer control block from
|
|
||||||
* the inactive chain of free timer control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Timer_Control *_Timer_Allocate( void );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Free
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine frees a timer control block to the
|
|
||||||
* inactive chain of free timer control blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Timer_Free (
|
|
||||||
Timer_Control *the_timer
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Get
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function maps timer IDs to timer control blocks.
|
|
||||||
* If ID corresponds to a local timer, then it returns
|
|
||||||
* the timer control pointer which maps to ID and location
|
|
||||||
* is set to OBJECTS_LOCAL. Otherwise, location is set
|
|
||||||
* to OBJECTS_ERROR and the returned value is undefined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Timer_Control *_Timer_Get (
|
|
||||||
Objects_Id id,
|
|
||||||
Objects_Locations *location
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Is_interval_class
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the class is that of an INTERVAL
|
|
||||||
* timer, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Timer_Is_interval_class (
|
|
||||||
Timer_Classes the_class
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Is_time_of_day_class
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the class is that of an INTERVAL
|
|
||||||
* timer, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Timer_Is_timer_of_day_class (
|
|
||||||
Timer_Classes the_class
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Is_dormant_class
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the class is that of a DORMANT
|
|
||||||
* timer, and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Timer_Is_dormant_class (
|
|
||||||
Timer_Classes the_class
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _Timer_Is_null
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This function returns TRUE if the_timer is NULL and FALSE otherwise.
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Timer_Is_null (
|
|
||||||
Timer_Control *the_timer
|
|
||||||
);
|
|
||||||
|
|
||||||
#include <rtems/timer.inl>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* end of include file */
|
|
||||||
@@ -17,18 +17,22 @@
|
|||||||
#ifndef __INLINE_ASR_inl
|
#ifndef __INLINE_ASR_inl
|
||||||
#define __INLINE_ASR_inl
|
#define __INLINE_ASR_inl
|
||||||
|
|
||||||
#include <rtems/isr.h>
|
#include <rtems/score/isr.h>
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _ASR_Initialize
|
* _ASR_Initialize
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine initializes the given RTEMS_ASR information record.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE void _ASR_Initialize (
|
STATIC INLINE void _ASR_Initialize (
|
||||||
ASR_Information *information
|
ASR_Information *information
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
information->is_enabled = TRUE;
|
||||||
information->handler = NULL;
|
information->handler = NULL;
|
||||||
information->mode_set = RTEMS_DEFAULT_MODES;
|
information->mode_set = RTEMS_DEFAULT_MODES;
|
||||||
information->signals_posted = 0;
|
information->signals_posted = 0;
|
||||||
@@ -40,6 +44,11 @@ STATIC INLINE void _ASR_Initialize (
|
|||||||
*
|
*
|
||||||
* _ASR_Swap_signals
|
* _ASR_Swap_signals
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine atomically swaps the pending and posted signal
|
||||||
|
* sets. This is done when the thread alters its mode in such a
|
||||||
|
* way that the RTEMS_ASR disable/enable flag changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE void _ASR_Swap_signals (
|
STATIC INLINE void _ASR_Swap_signals (
|
||||||
@@ -47,7 +56,7 @@ STATIC INLINE void _ASR_Swap_signals (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
rtems_signal_set _signals;
|
rtems_signal_set _signals;
|
||||||
ISR_Level _level;
|
ISR_Level _level;
|
||||||
|
|
||||||
_ISR_Disable( _level );
|
_ISR_Disable( _level );
|
||||||
_signals = information->signals_pending;
|
_signals = information->signals_pending;
|
||||||
@@ -60,6 +69,10 @@ STATIC INLINE void _ASR_Swap_signals (
|
|||||||
*
|
*
|
||||||
* _ASR_Is_null_handler
|
* _ASR_Is_null_handler
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if the given asr_handler is NULL and
|
||||||
|
* FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _ASR_Is_null_handler (
|
STATIC INLINE boolean _ASR_Is_null_handler (
|
||||||
@@ -73,6 +86,10 @@ STATIC INLINE boolean _ASR_Is_null_handler (
|
|||||||
*
|
*
|
||||||
* _ASR_Are_signals_pending
|
* _ASR_Are_signals_pending
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if there are signals pending in the
|
||||||
|
* given RTEMS_ASR information record and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _ASR_Are_signals_pending (
|
STATIC INLINE boolean _ASR_Are_signals_pending (
|
||||||
@@ -86,6 +103,12 @@ STATIC INLINE boolean _ASR_Are_signals_pending (
|
|||||||
*
|
*
|
||||||
* _ASR_Post_signals
|
* _ASR_Post_signals
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine posts the given signals into the signal_set
|
||||||
|
* passed in. The result is returned to the user in signal_set.
|
||||||
|
*
|
||||||
|
* NOTE: This must be implemented as a macro.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE void _ASR_Post_signals(
|
STATIC INLINE void _ASR_Post_signals(
|
||||||
|
|||||||
@@ -20,6 +20,11 @@
|
|||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Attributes_Set
|
* _Attributes_Set
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function sets the requested new_attributes in the attribute_set
|
||||||
|
* passed in. The result is returned to the user.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE rtems_attribute _Attributes_Set (
|
STATIC INLINE rtems_attribute _Attributes_Set (
|
||||||
@@ -33,6 +38,11 @@ STATIC INLINE rtems_attribute _Attributes_Set (
|
|||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Attributes_Clear
|
* _Attributes_Clear
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function clears the requested new_attributes in the attribute_set
|
||||||
|
* passed in. The result is returned to the user.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE rtems_attribute _Attributes_Clear (
|
STATIC INLINE rtems_attribute _Attributes_Clear (
|
||||||
@@ -47,6 +57,10 @@ STATIC INLINE rtems_attribute _Attributes_Clear (
|
|||||||
*
|
*
|
||||||
* _Attributes_Is_floating_point
|
* _Attributes_Is_floating_point
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if the floating point attribute is
|
||||||
|
* enabled in the attribute_set and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_floating_point(
|
STATIC INLINE boolean _Attributes_Is_floating_point(
|
||||||
@@ -60,6 +74,10 @@ STATIC INLINE boolean _Attributes_Is_floating_point(
|
|||||||
*
|
*
|
||||||
* _Attributes_Is_global
|
* _Attributes_Is_global
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if the global object attribute is
|
||||||
|
* enabled in the attribute_set and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_global(
|
STATIC INLINE boolean _Attributes_Is_global(
|
||||||
@@ -73,6 +91,10 @@ STATIC INLINE boolean _Attributes_Is_global(
|
|||||||
*
|
*
|
||||||
* _Attributes_Is_priority
|
* _Attributes_Is_priority
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if the priority attribute is
|
||||||
|
* enabled in the attribute_set and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_priority(
|
STATIC INLINE boolean _Attributes_Is_priority(
|
||||||
@@ -82,23 +104,14 @@ STATIC INLINE boolean _Attributes_Is_priority(
|
|||||||
return ( attribute_set & RTEMS_PRIORITY );
|
return ( attribute_set & RTEMS_PRIORITY );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
|
||||||
*
|
|
||||||
* _Attributes_Is_limit
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_limit(
|
|
||||||
rtems_attribute attribute_set
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return ( attribute_set & RTEMS_LIMIT );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Attributes_Is_binary_semaphore
|
* _Attributes_Is_binary_semaphore
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if the binary semaphore attribute is
|
||||||
|
* enabled in the attribute_set and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_binary_semaphore(
|
STATIC INLINE boolean _Attributes_Is_binary_semaphore(
|
||||||
@@ -112,6 +125,10 @@ STATIC INLINE boolean _Attributes_Is_binary_semaphore(
|
|||||||
*
|
*
|
||||||
* _Attributes_Is_inherit_priority
|
* _Attributes_Is_inherit_priority
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if the priority inheritance attribute
|
||||||
|
* is enabled in the attribute_set and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Attributes_Is_inherit_priority(
|
STATIC INLINE boolean _Attributes_Is_inherit_priority(
|
||||||
@@ -121,5 +138,22 @@ STATIC INLINE boolean _Attributes_Is_inherit_priority(
|
|||||||
return ( attribute_set & RTEMS_INHERIT_PRIORITY );
|
return ( attribute_set & RTEMS_INHERIT_PRIORITY );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*PAGE
|
||||||
|
*
|
||||||
|
* _Attributes_Is_priority_ceiling
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if the priority ceiling attribute
|
||||||
|
* is enabled in the attribute_set and FALSE otherwise.
|
||||||
|
*/
|
||||||
|
|
||||||
|
STATIC INLINE boolean _Attributes_Is_priority_ceiling(
|
||||||
|
rtems_attribute attribute_set
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return ( attribute_set & RTEMS_PRIORITY_CEILING );
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/* end of include file */
|
/* end of include file */
|
||||||
|
|||||||
@@ -22,6 +22,10 @@
|
|||||||
*
|
*
|
||||||
* _Dual_ported_memory_Allocate
|
* _Dual_ported_memory_Allocate
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine allocates a port control block from the inactive chain
|
||||||
|
* of free port control blocks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE Dual_ported_memory_Control
|
STATIC INLINE Dual_ported_memory_Control
|
||||||
@@ -35,6 +39,10 @@ STATIC INLINE Dual_ported_memory_Control
|
|||||||
*
|
*
|
||||||
* _Dual_ported_memory_Free
|
* _Dual_ported_memory_Free
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine frees a port control block to the inactive chain
|
||||||
|
* of free port control blocks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE void _Dual_ported_memory_Free (
|
STATIC INLINE void _Dual_ported_memory_Free (
|
||||||
@@ -48,6 +56,14 @@ STATIC INLINE void _Dual_ported_memory_Free (
|
|||||||
*
|
*
|
||||||
* _Dual_ported_memory_Get
|
* _Dual_ported_memory_Get
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function maps port IDs to port control blocks. If ID
|
||||||
|
* corresponds to a local port, then it returns the_port control
|
||||||
|
* pointer which maps to ID and location is set to OBJECTS_LOCAL.
|
||||||
|
* Global ports are not supported, thus if ID does not map to a
|
||||||
|
* local port, location is set to OBJECTS_ERROR and the_port is
|
||||||
|
* undefined.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
|
STATIC INLINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
|
||||||
@@ -62,6 +78,10 @@ STATIC INLINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
|
|||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Dual_ported_memory_Is_null
|
* _Dual_ported_memory_Is_null
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if the_port is NULL and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Dual_ported_memory_Is_null(
|
STATIC INLINE boolean _Dual_ported_memory_Is_null(
|
||||||
|
|||||||
@@ -19,11 +19,21 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Event_Manager_initialization
|
* Event_Manager_initialization
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine performs the initialization necessary for this manager.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE void _Event_Manager_initialization( void )
|
STATIC INLINE void _Event_Manager_initialization( void )
|
||||||
{
|
{
|
||||||
_Event_Sync = FALSE;
|
_Event_Sync_state = EVENT_SYNC_SYNCHRONIZED;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Register the MP Process Packet routine.
|
||||||
|
*/
|
||||||
|
|
||||||
|
_MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -19,6 +19,11 @@
|
|||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Event_sets_Is_empty
|
* _Event_sets_Is_empty
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if on events are posted in the event_set,
|
||||||
|
* and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Event_sets_Is_empty(
|
STATIC INLINE boolean _Event_sets_Is_empty(
|
||||||
@@ -31,6 +36,11 @@ STATIC INLINE boolean _Event_sets_Is_empty(
|
|||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Event_sets_Post
|
* _Event_sets_Post
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine posts the given new_events into the event_set
|
||||||
|
* passed in. The result is returned to the user in event_set.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE void _Event_sets_Post(
|
STATIC INLINE void _Event_sets_Post(
|
||||||
@@ -44,6 +54,11 @@ STATIC INLINE void _Event_sets_Post(
|
|||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Event_sets_Get
|
* _Event_sets_Get
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns the events in event_condition which are
|
||||||
|
* set in event_set.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE rtems_event_set _Event_sets_Get(
|
STATIC INLINE rtems_event_set _Event_sets_Get(
|
||||||
@@ -57,6 +72,11 @@ STATIC INLINE rtems_event_set _Event_sets_Get(
|
|||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Event_sets_Clear
|
* _Event_sets_Clear
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function removes the events in mask from the event_set
|
||||||
|
* passed in. The result is returned to the user in event_set.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE rtems_event_set _Event_sets_Clear(
|
STATIC INLINE rtems_event_set _Event_sets_Clear(
|
||||||
|
|||||||
@@ -17,96 +17,16 @@
|
|||||||
#ifndef __MESSAGE_QUEUE_inl
|
#ifndef __MESSAGE_QUEUE_inl
|
||||||
#define __MESSAGE_QUEUE_inl
|
#define __MESSAGE_QUEUE_inl
|
||||||
|
|
||||||
/*PAGE
|
#include <rtems/score/wkspace.h>
|
||||||
*
|
|
||||||
* _Message_queue_Copy_buffer
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Copy_buffer (
|
|
||||||
Message_queue_Buffer *source,
|
|
||||||
Message_queue_Buffer *destination
|
|
||||||
)
|
|
||||||
{
|
|
||||||
*destination = *source;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*PAGE
|
|
||||||
*
|
|
||||||
* _Message_queue_Allocate_message_buffer
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Message_queue_Buffer_control *
|
|
||||||
_Message_queue_Allocate_message_buffer ( void )
|
|
||||||
{
|
|
||||||
return (Message_queue_Buffer_control *)
|
|
||||||
_Chain_Get( &_Message_queue_Inactive_messages );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*PAGE
|
|
||||||
*
|
|
||||||
* _Message_queue_Free_message_buffer
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Free_message_buffer (
|
|
||||||
Message_queue_Buffer_control *the_message
|
|
||||||
)
|
|
||||||
{
|
|
||||||
_Chain_Append( &_Message_queue_Inactive_messages, &the_message->Node );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*PAGE
|
|
||||||
*
|
|
||||||
* _Message_queue_Get_pending_message
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE
|
|
||||||
Message_queue_Buffer_control *_Message_queue_Get_pending_message (
|
|
||||||
Message_queue_Control *the_message_queue
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return (Message_queue_Buffer_control *)
|
|
||||||
_Chain_Get_unprotected( &the_message_queue->Pending_messages );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*PAGE
|
|
||||||
*
|
|
||||||
* _Message_queue_Append
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Append (
|
|
||||||
Message_queue_Control *the_message_queue,
|
|
||||||
Message_queue_Buffer_control *the_message
|
|
||||||
)
|
|
||||||
{
|
|
||||||
_Chain_Append( &the_message_queue->Pending_messages, &the_message->Node );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*PAGE
|
|
||||||
*
|
|
||||||
* _Message_queue_Prepend
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Prepend (
|
|
||||||
Message_queue_Control *the_message_queue,
|
|
||||||
Message_queue_Buffer_control *the_message
|
|
||||||
)
|
|
||||||
{
|
|
||||||
_Chain_Prepend(
|
|
||||||
&the_message_queue->Pending_messages,
|
|
||||||
&the_message->Node
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Message_queue_Is_null
|
* _Message_queue_Is_null
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function places the_message at the rear of the outstanding
|
||||||
|
* messages on the_message_queue.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Message_queue_Is_null (
|
STATIC INLINE boolean _Message_queue_Is_null (
|
||||||
@@ -116,22 +36,15 @@ STATIC INLINE boolean _Message_queue_Is_null (
|
|||||||
return ( the_message_queue == NULL );
|
return ( the_message_queue == NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
|
||||||
*
|
|
||||||
* _Message_queue_Allocate
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE Message_queue_Control *_Message_queue_Allocate ( void )
|
|
||||||
{
|
|
||||||
return (Message_queue_Control *)
|
|
||||||
_Objects_Allocate( &_Message_queue_Information );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Message_queue_Free
|
* _Message_queue_Free
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine deallocates a message queue control block into
|
||||||
|
* the inactive chain of free message queue control blocks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE void _Message_queue_Free (
|
STATIC INLINE void _Message_queue_Free (
|
||||||
@@ -145,6 +58,16 @@ STATIC INLINE void _Message_queue_Free (
|
|||||||
*
|
*
|
||||||
* _Message_queue_Get
|
* _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_message_queue 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_message_queue is undefined.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE Message_queue_Control *_Message_queue_Get (
|
STATIC INLINE Message_queue_Control *_Message_queue_Get (
|
||||||
|
|||||||
@@ -17,27 +17,19 @@
|
|||||||
#ifndef __MODES_inl
|
#ifndef __MODES_inl
|
||||||
#define __MODES_inl
|
#define __MODES_inl
|
||||||
|
|
||||||
/*PAGE
|
|
||||||
*
|
|
||||||
* RTEMS_INTERRUPT_LEVEL
|
|
||||||
*/
|
|
||||||
|
|
||||||
STATIC INLINE unsigned32 RTEMS_INTERRUPT_LEVEL (
|
|
||||||
rtems_mode mode_set
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return mode_set & RTEMS_INTERRUPT_MASK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Modes_Mask_changed
|
* _Modes_Mask_changed
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if any of the mode flags in mask
|
||||||
|
* are set in mode_set, and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Modes_Mask_changed (
|
STATIC INLINE boolean _Modes_Mask_changed (
|
||||||
rtems_mode mode_set,
|
Modes_Control mode_set,
|
||||||
rtems_mode masks
|
Modes_Control masks
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return ( mode_set & masks );
|
return ( mode_set & masks );
|
||||||
@@ -47,50 +39,64 @@ STATIC INLINE boolean _Modes_Mask_changed (
|
|||||||
*
|
*
|
||||||
* _Modes_Is_asr_disabled
|
* _Modes_Is_asr_disabled
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if mode_set indicates that Asynchronous
|
||||||
|
* Signal Processing is disabled, and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Modes_Is_asr_disabled (
|
STATIC INLINE boolean _Modes_Is_asr_disabled (
|
||||||
rtems_mode mode_set
|
Modes_Control mode_set
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return ( mode_set & RTEMS_ASR_MASK );
|
return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Modes_Is_preempt
|
* _Modes_Is_preempt
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if mode_set indicates that preemption
|
||||||
|
* is enabled, and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Modes_Is_preempt (
|
STATIC INLINE boolean _Modes_Is_preempt (
|
||||||
rtems_mode mode_set
|
Modes_Control mode_set
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return ( ( mode_set & RTEMS_PREEMPT_MASK ) == RTEMS_PREEMPT );
|
return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Modes_Is_timeslice
|
* _Modes_Is_timeslice
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if mode_set indicates that timeslicing
|
||||||
|
* is enabled, and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Modes_Is_timeslice (
|
STATIC INLINE boolean _Modes_Is_timeslice (
|
||||||
rtems_mode mode_set
|
Modes_Control mode_set
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return ((mode_set & (RTEMS_TIMESLICE_MASK|RTEMS_PREEMPT_MASK)) ==
|
return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
|
||||||
(RTEMS_TIMESLICE|RTEMS_PREEMPT) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _Modes_Get_interrupt_level
|
* _Modes_Get_interrupt_level
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns the interrupt level portion of the mode_set.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE ISR_Level _Modes_Get_interrupt_level (
|
STATIC INLINE ISR_Level _Modes_Get_interrupt_level (
|
||||||
rtems_mode mode_set
|
Modes_Control mode_set
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return ( mode_set & RTEMS_INTERRUPT_MASK );
|
return ( mode_set & RTEMS_INTERRUPT_MASK );
|
||||||
@@ -100,10 +106,14 @@ STATIC INLINE ISR_Level _Modes_Get_interrupt_level (
|
|||||||
*
|
*
|
||||||
* _Modes_Set_interrupt_level
|
* _Modes_Set_interrupt_level
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine sets the current interrupt level to that specified
|
||||||
|
* in the mode_set.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE void _Modes_Set_interrupt_level (
|
STATIC INLINE void _Modes_Set_interrupt_level (
|
||||||
rtems_mode mode_set
|
Modes_Control mode_set
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
|
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
|
||||||
@@ -113,17 +123,23 @@ STATIC INLINE void _Modes_Set_interrupt_level (
|
|||||||
*
|
*
|
||||||
* _Modes_Change
|
* _Modes_Change
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine changes the modes in old_mode_set indicated by
|
||||||
|
* mask to the requested values in new_mode_set. The resulting
|
||||||
|
* mode set is returned in out_mode_set and the modes that changed
|
||||||
|
* is returned in changed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE void _Modes_Change (
|
STATIC INLINE void _Modes_Change (
|
||||||
rtems_mode old_mode_set,
|
Modes_Control old_mode_set,
|
||||||
rtems_mode new_mode_set,
|
Modes_Control new_mode_set,
|
||||||
rtems_mode mask,
|
Modes_Control mask,
|
||||||
rtems_mode *out_mode_set,
|
Modes_Control *out_mode_set,
|
||||||
rtems_mode *changed
|
Modes_Control *changed
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
rtems_mode _out_mode;
|
Modes_Control _out_mode;
|
||||||
|
|
||||||
_out_mode = old_mode_set;
|
_out_mode = old_mode_set;
|
||||||
_out_mode &= ~mask;
|
_out_mode &= ~mask;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
*
|
*
|
||||||
* _Options_Is_no_wait
|
* _Options_Is_no_wait
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if the RTEMS_NO_WAIT option is enabled in
|
||||||
|
* option_set, and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Options_Is_no_wait (
|
STATIC INLINE boolean _Options_Is_no_wait (
|
||||||
@@ -34,6 +38,10 @@ STATIC INLINE boolean _Options_Is_no_wait (
|
|||||||
*
|
*
|
||||||
* _Options_Is_any
|
* _Options_Is_any
|
||||||
*
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This function returns TRUE if the RTEMS_EVENT_ANY option is enabled in
|
||||||
|
* OPTION_SET, and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC INLINE boolean _Options_Is_any (
|
STATIC INLINE boolean _Options_Is_any (
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user