Commit Graph

8207 Commits

Author SHA1 Message Date
Joel Sherrill
3a638ceb4c rtems/*.c: Remove use of register keyword 2014-02-03 17:45:32 -06:00
Sebastian Huber
5b34e7ada4 IMFS: Improved support for generic nodes
The rtems_filesystem_location_info_t::node_access_2 was unused by the
IMFS.  Use it to hold the context of generic nodes.  This makes it
possible to use node handlers for objects with and without a
corresponding file system node.

For example network sockets created with socket() have only a file
descriptor, but no corresponding file system node.  The UNIX(4) domain
sockets can be bound to file system nodes.  In both cases the
rtems_filesystem_location_info_t must provide a pointer to the socket
structure used by the socket node handlers.  With the context pointer
(for sockets, this is the socket structure) in
rtems_filesystem_location_info_t::node_access_2 the same node handlers
can be used in both cases.
2014-01-21 13:22:52 +01:00
Sebastian Huber
45e82bb862 IMFS: Allow sockets as generic nodes 2014-01-21 13:22:52 +01:00
Nick Withers
a32f996b60 Don't use unsafe buffer operations
Don't use unsafe buffer operations, averting (stack) buffer overflow
when the syslog message length (including Facility and Level encoding)
would exceed 199 characters
2014-01-20 08:52:21 +01:00
Sebastian Huber
805ef2f2ba arm: Add ARMv7-M SHCSR register bits 2014-01-10 21:44:24 +01:00
Joel Sherrill
8d7c3cae95 tasksetpriority.c: Remove obsolete comment 2014-01-09 15:59:21 -06:00
Till Strauman
a19a7077ee posix: fix race condition between pthread_create and capture engine
Reproducable crashes occur when using pthreads and the capture engine
at the same time. 'pthread_create()' is the culprit. It creates a SCORE thread
and then calls Thread_Start( ) without disabling thread-dispatching.
2014-01-09 10:24:12 -05:00
Allan Hessenflow
66bf2cc909 mw_uid: corrects uid_read_message short timeouts 2014-01-09 10:07:48 -05:00
Jim Panetta
2b03a62441 NTP: Sync time correctly when receiving broadcast updates
1) The value of rtems_bsdnet_ntpserver_count is equal to 0 when no
   server is set, so the check for (rtems_bsdnet_ntpserver_count < 0)
   in rtems_bsdnet_get_ntp() is wrong.  The check should be "<= 0".

2) Binding the listening socket port to 0 does not work.  Packets
   appear on the interface, but the recvfrom in tryServer() never
   returns.  Changing this to the well known NTP socket 123 allows
   the packets to be seen.

3) In tryServer(), an explicit check for NTP version 3 packets is made.
   If the NTP server is version 4, this check fails even though the
   packets seem to be the right shape.
2014-01-09 09:56:03 -05:00
Daniel Ramirez
35b8f48a4b libcsupport: Refactor rtems_deviceio_errno
Renames rtems_deviceio_errno to rtems_status_code_to_errno and
integrates it into the Classic API Status Handler. This function
can now be called by including status.h
2014-01-08 15:24:09 -06:00
Daniel Ramirez
564ce0f42d libcsupport: implemented termios functions cfsetspeed and cfmakeraw 2014-01-07 10:34:31 -06:00
Chris Johns
6a26e9bbf5 cpukit/capture: Print the uptime and diff in ctrace.
Print the uptime and difference in nanoseconds to the previous
record in the ctrace output. For example:

    0:00:59.474927121     14760 0a01000c TNTD 235 235 CREATED_BY
    0:00:59.474927418       297 0a010012 /dev 235 235 CREATED
    0:00:59.474930799      3381 0a01000c TNTD 235 235 STARTED_BY
    0:00:59.474931105       306 0a010012 /dev 235 235 STARTED
    0:00:59.475072297    141192 0a01000c TNTD 235 235 SWITCHED_OUT
2013-12-24 18:08:29 +11:00
Chris Johns
9f9c0bbf47 cpukit/capture: Use the new RTEMS API to get the uptime in nanoseconds.
Use the new API to get the uptime in nanoseconds and update the capture
engine.
2013-12-24 16:46:19 +11:00
Chris Johns
2d1bdc8f79 cpukit/rtems: Add rtems_clock_get_uptime_nanoseconds to the RTEMS API.
Add Timestamp support in the score to return a timestamp in nanoseconds.
Add a test.
Update the RTEMS API documentation.
2013-12-24 16:46:19 +11:00
Daniel Ramirez
2bafb96037 rtems: classic api to/from core priority conversions 2013-12-21 20:09:02 -05:00
Sebastian Huber
c1d8ee4cdc libcsupport: Accept NULL for zero-length entries 2013-12-20 10:31:53 +01:00
Sebastian Huber
56bea4339f Filesystem: Use default kqfilter and poll handler 2013-12-20 10:31:53 +01:00
Sebastian Huber
2f68778f08 Filesystem: Add readv/writev handlers
The readv() and writev() support was implemented in terms of multiple
calls to the read and write handlers.  This imposes a problem on device
files which use an IO vector as single request entity.  For example a
low-level network device (e.g. BPF(4)) may use an IO vector to create
one frame from multiple protocol layers each with its own IO vector
entry.
2013-12-20 10:31:53 +01:00
Sebastian Huber
95a57280eb libcsupport: Add and use rtems_libio_iovec_eval() 2013-12-20 10:31:53 +01:00
Chris Johns
db8a89e212 cpukit/capture: Update the capture engine.
The capture did not work due to changes in the workspace allocator.
The engine now scans all existing tasks when enabled and does any
allocations then.

Fixed a bug in the ctset commandi in the CLI.

Updated the capture engine to use 64bit nanosec timestamps.

Fixed the CLI showing the stack usage.
2013-12-19 19:01:23 +11:00
Alan Cudmore
a9619f3cb6 For PR 2164 - RFS File System - fix bitmap_create_search loop bug
This is for the RFS file system. There is a bug in the
rtems_rfs_bitmap_create_search loop. It is supposed to iterate
over the range of bits in a search element ( usually 32 bits ),
so it should loop through bits 0 through 31. Instead it loops
through 0 - 32, causing some blocks not to be allocated. As in
PR 2163, this depends on the block size and number of blocks in
a file system. Block sizes and group sizes that are powers of 2
seem to work fine ( 512 byte blocks, 4096 block groups, etc ).
When the block sizes are not powers of 2, then this loop error
causes some of the blocks at the end of a group to be skipped,
preventing 100% of the blocks from being used. A simple test
for this and PR2163 is to create a RAM disk with block size
3900 and at least 1 full group ( 31200 blocks ). A file system
with these sizes will not be able to allocate 100% of the blocks.
2013-12-19 11:07:47 +11:00
Alan Cudmore
9b48dc67ed For PR 2162 - RFS File System - statvfs reports 1 block free
This is for the RFS file system. The statvfs call reports 1 block free
when the file system is full because it does not account for the superblock
in its calculation of free blocks.
This is a simple fix that adjusts the number of blocks reported to account
for the superblock. We may want to wait for a more complete solution such
as locating the superblock in each group.
2013-12-19 11:07:41 +11:00
Alan Cudmore
e60b7b1b4f For PR 2163 - RFS File System - fix group search algorithm bug
This is for the RFS file system. There is a bug in the group search
algorithm where it will skip groups, causing blocks to remain
unallocated. This is dependant on the size of the blocks and number
of blocks in a group, so it does not always show up. The fix corrects
the skipping of groups during the search, allowing all of the blocks
to be found.
2013-12-19 11:03:27 +11:00
Sebastian Huber
f859d20ccf arm: Fix set by but not used warning 2013-12-16 15:15:42 +01:00
Sebastian Huber
fb664a21c2 nfsclient: Move defines to cover all header files 2013-12-16 14:30:25 +01:00
Sebastian Huber
99c2323d4f JFFS2: Do not re-define struct iovec 2013-12-16 14:30:25 +01:00
Chris Johns
259328a78d cpukit/shell: Control help break with SHELL_LINES env variable.
Control the help command break with the SHELL_LINES evironment variable
where the numeric value is the number of lines to break on. If the
value is 0 the output is not broken. The default is 16 lines.

Add shell documentation for the help command.
2013-12-16 11:59:51 +11:00
Joel Sherrill
4402308bfc no_cpu/cpusmplock.h: Clean up to be compilable 2013-12-14 11:56:33 -06:00
Joel Sherrill
801a1fc6b2 cpukit/configure.ac: Probe for SMP affinity methods 2013-12-13 08:35:52 -06:00
Sebastian Huber
98e5c954bd PR2160: imfs: Use ENOSYS for unsupported nodes
Return an error status with errno set to ENOSYS during node creation for
nodes not available in the current configuration.
2013-12-11 09:39:09 +01:00
Joel Sherrill
0f01de2b96 alarm.c: Use _Assert() not assert() 2013-12-10 09:08:16 -06:00
Chris Johns
c59f668c42 PR2138: rtems_rfs_rtems_initialize() can erroneously set errno.
Patch from Nick for this. Thanks.
2013-12-10 15:00:27 +11:00
Joel Sherrill
798b8da7ef Merge branch 'master' into am 2013-12-09 19:53:13 -06:00
Joel Sherrill
967c14385b alarm.c: Per comment add debug code for kill() failing
This is highly unlikely and would indicate a serious bug
in the system or corruption. But it is better to be cautious.
2013-12-09 19:50:55 -06:00
Joel Sherrill
8ae999c38b pthread.c: Use UINT32_MAX rather than constant value 2013-12-09 19:50:55 -06:00
Joel Sherrill
327fbd6df7 condwaitsupp.c: Return EPERM if waiting and mutex is not locked
This error check was commented out because it is not in the POSIX
specification. However, the GNU/Linux manual page does document
that EPERM is to be returned in this situation.
2013-12-09 19:50:55 -06:00
Joel Sherrill
96281908a2 psignalimpl.h: Remove dead comment 2013-12-09 19:50:55 -06:00
Joel Sherrill
fa820b9e4c pthread.c: Remove XXX and use SIGNAL_ constants 2013-12-09 19:50:55 -06:00
Joel Sherrill
01d43180dd posix/config.h: Comment clean up 2013-12-09 19:50:55 -06:00
Joel Sherrill
2b3a648fe1 signalcatch.c: Remove junk comment 2013-12-09 19:50:55 -06:00
Joel Sherrill
16b1c350f0 timerimpl.h: Comment clean up 2013-12-09 19:50:55 -06:00
Joel Sherrill
610825b1e2 semaphoreimpl.h: Comment clean up 2013-12-09 19:50:55 -06:00
Joel Sherrill
849b98e83f mqueueimpl.h: Comment clean up 2013-12-09 19:50:55 -06:00
Joel Sherrill
07a3aa9d70 condimpl.h: Comment clean up 2013-12-09 19:50:55 -06:00
Joel Sherrill
71f2a83d5d ptimer.h: Comment clean up 2013-12-09 19:50:55 -06:00
Joel Sherrill
4600bd7cfe muteximpl.h: Comment clean up 2013-12-09 19:50:55 -06:00
Joel Sherrill
1de916b45b pspin.c: Comment clean up 2013-12-09 19:50:55 -06:00
Joel Sherrill
7bb333919a pbarrier.c: Comment clean up 2013-12-09 19:50:55 -06:00
Chris Johns
663ffd0e7c PR2161: Set the source port to SYSLOG in the syslog socket. 2013-12-10 12:37:05 +11:00
Chris Johns
6122cb6af6 PR2158: Add support for dup2.
Split the dub call into dup and dup2 in fcntl.c. This requires
a private command which is placed in the internal libio header.
2013-12-10 12:35:29 +11:00