Newer
Older
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
long tv_nsec; /* Nanoseconds */
};
</PRE>
<H3>3.4.4 struct mq_attr</H3>
<P>
This structure is used to communicate message queue attributes
between Nuttx and a MoBY application:
<PRE>
struct mq_attr {
size_t mq_maxmsg; /* Max number of messages in queue */
size_t mq_msgsize; /* Max message size */
unsigned mq_flags; /* Queue flags */
size_t mq_curmsgs; /* Number of messages currently in queue */
};
</PRE>
<H3>3.4.5 struct sigaction</H3>
<P>
The following structure defines the action to take for given signal:
<PRE>
struct sigaction
{
union
{
void (*_sa_handler)(int);
void (*_sa_sigaction)(int, siginfo_t *, void *);
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
} sa_u;
sigset_t sa_mask;
int sa_flags;
};
#define sa_handler sa_u._sa_handler
#define sa_sigaction sa_u._sa_sigaction
</PRE>
<H3>3.4.6 struct siginfo/siginfo_t</H3>
<P>
The following types is used to pass parameters to/from signal
handlers:
<PRE>
typedef struct siginfo
{
int si_signo;
int si_code;
union sigval si_value;
} siginfo_t;
</PRE>
<H3>3.4.7 union sigval</H3>
<P>
This defines the type of the struct siginfo si_value field and
is used to pass parameters with signals.
<PRE>
union sigval
{
int sival_int;
void *sival_ptr;
};
</PRE>
<H3>3.4.8 struct sigevent</H3>
<P>
The following is used to attach a signal to a message queue to
notify a task when a message is available on a queue.
<PRE>
struct sigevent
{
int sigev_signo;
union sigval sigev_value;
int sigev_notify;
};
</PRE>
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
<H3>3.4.9 Watchdog Data Types</H3>
<p>
When a watchdog expires, the callback function with this
type is called:
</p>
<pre>
typedef void (*wdentry_t)(int argc, ...);
</pre>
<p>
Where argc is the number of uint32 type arguments that follow.
</p>
The arguments are passed as uint32 values.
For systems where the sizeof(pointer) < sizeof(uint32), the
following union defines the alignment of the pointer within the
uint32. For example, the SDCC MCS51 general pointer is
24-bits, but uint32 is 32-bits (of course).
</p>
<pre>
union wdparm_u
{
void *pvarg;
uint32 *dwarg;
};
typedef union wdparm_u wdparm_t;
</pre>
<p>
For most 32-bit systems, pointers and uint32 are the same size
For systems where sizeof(pointer) > sizeof(uint32), we will
have to do some redesign.
</p>
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
<HR>
<H1>4.0 <A NAME="Problems">Known Problems</A></H1>
<P>
This section documents know problems with Nuttx at the time
of this writing.
<P>
<HR>
<B>Problem</B>:
There is a problem with the unblock logic in os_signal.c when message queue
becomes not-empty -- sig_mqnotempty() calls sig_received().
sig_received() relies on task_state == TSTATE_WAIT_SIG and will ignore
tasks that are waiting on a message queue to become non-empty.
<P>
<B>Priority</B>: <B>LOW</B>. If a task is blocked a waiting for a message
queue to become non-empty, it will be re-started anyway.
<HR>
<B>Problem</B>: task_restart won't restart a running task
<P>
<B>Priority</B>: <B>LOW</B>.
</BODY>
</HTML>