History log of /development/ndk/sources/android/libportable/arch-mips/syscall.c
Revision Date Author Comments
78175cbcc57537b1642ff4b6f8fe1a87233ea71a 20-Mar-2013 Andrew Hsieh <andrewhsieh@google.com> Don't use errno directly

errno in MIPS is macro for "*__errno)()". Use of errno inside
WRAP(__errno)() cause infinite loop. This may happen in other
wrapper functions which access errno.

Change all error to *REAL(__error)()

Change-Id: I1c09d84a58855bd7896fcd4e70f740b8a0f0b386
6433ec22b1e20af20b31671b2fd4d5d235a7de52 19-Mar-2013 Andrew Hsieh <andrewhsieh@google.com> Use linker -Wl,--wrap=symbol

Linker --wrap option resolves to __wrap_symbol for undefined symbol.
During the compilation of host libportable.a, __HOST__ is defined
to rename all portable functions to __wrap_symbol, and the
real function to __real_symbol. This way libportable.a can be
validated at host w/o changes of user's source code.

See http://sourceware.org/binutils/docs/ld/Options.html

Change-Id: Idcbe53dd642536f3dc2be85a875f95535b9dc0b1
c684613e19bce87e5ee3cdee5fb1e7ed5be14229 21-Feb-2013 Pete Delaney <piet.delaney@imgtec.com> [MIPS] Added support for file descriptor related system calls.

Specifically these functions are now supported:
signalfd4(), eventfd(), timerfd_create(),
pipe(), and inotify_init1()

Modified syscall_portable() to call signalfd4_portable(),
eventfd_portable(), eventfd2_portable(), and timerfd_create().
These system calls enable the read system calls to access
kernel data structures.

The signalfd4() enables read to return a signalfd_siginfo structure
which have the signal number and errno mapped until an execve().
This is similar to the maintaining a table of signal handlers to
map the signal numbers done earlier. This mapping is extended to
the process after an execve() by passing the final set of mapped
file descriptors via a pair of environment variables.

Disabling signal and file descriptor read mapping in parent
if the child would break the mapping algorithms.

This code passes at least all of the non-POSIX LTP tests,
including an updated LTP signalfd4 test that posts SIGNALS
and uses this read() mechanism to get signal info.

inotify_init1 is similar to signalfd(), timerfd() and other
filefd functions which map read() calls. Unlike signalfd(), and
similar to timerfd(), the reads don't appear to need to be mapped.

The members of the inotify_event structure appear to be generic.
The mask bits like IN_MOVE_FROM and IN_MOVE_TO are defined in
generic files. The LTP test in testcases/kernel/syscalls/inotify
test for the inotify_event structure being inotify_event structure
being read and does seem to check it contents being correct.

Change-Id: I3f2dcd4e33437ac953cd9f67f56dccc6ec6e5e6f
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
a89a54998716253ec60bf5330304dd158f6fe8bd 21-Feb-2013 Pete Delaney <piet.delaney@imgtec.com> [MIPS] Added missing _NR_* system call support and cleaned up.

Change-Id: I18499a73ad3732a16edb941c4db9fc2811dfe5d5
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
6732a917fdb65b36bf0cbfc68529cf9b0450344b 21-Feb-2013 Pete Delaney <piet.delaney@imgtec.com> [MIPS] Add Real Time Signal Functions and minor bug fixes.

1. Added:
rt_sigaction(),
rt_sigprocmask(), and
rt_sigtimedwait portable syscalls.

2. Fixed a bug in signal.c.

3. Added a new pair of functions to map siginfo_t
between portable and native formats.

4. Fixed LTP rt_siqqueueinfo01 and siqqueue() test failures.

5. Using these new siginfo_t mapping functions in functions
that were previously doing this functionality internally:
a. mips_sigaction_handler()
b. __rt_sigtimedwait_portable()

6. Modified rt_sigqueueinfo_portable():
a. Added a call to this new siginfo_pton() function.
b. Fixed native_sig calculation; it was converting
with the wrong function (ntop instead of pton).

7. Added the Thread Group Flavor of Real Time version of
sigqueueinfo().

8. Added and tested the sigqueue() implementation thought it's
not supported by Android yet. Using a LTP library function
to implement it via syscall for now. Android has a
sysconf() regression that will be addressed in a separate
commit.

9. Modified some of the variable names in:

__rt_sigtimedwait_portable()

to make it easier/faster to read.

10. Fixed a SIGTERM --> SIGTERM_PORTABLE mapping bug.

Most LTP Posix sigqueue() tests and the rt_sigqueueinfo01() test
now pass with this commit.

Change-Id: I5a2c28c4f5863cc013fe0c7fce819fa5b7a6dcc7
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Douglas Leung <douglas.leung@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
8930ac553438f5265d36ba048493d1bc4a89dde3 21-Feb-2013 Pete Delaney <piet.delaney@imgtec.com> [MIPS] Expand TABS and remove redundant return parenthesis.

Also fixed syscall.c to use curly brackets in case
statements to be more like bionic.

Change-Id: I20ffab9a474a2132b47fb4e765966c956aab2aff
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Paul Lind <paul.lind@imgtec.com>
9b350a5d225f14658a3ee59b937fbc3538c7e3c2 05-Oct-2012 Pete Delaney <piet@mips.com> [MIPS] Add Support for syscall.

Change-Id: Ib9c13ea152fdfe58b36362442eeef88e4a463c31
Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Pete Delaney <piet@mips.com>