posix/lio_listio: corrected addition of system event

Previously the system event used by lio_listio was manually added to
event.h and not using rtems-central. This patch corrects that and renames
the event to make it clearer.

Some related dead code has also been removed.


(cherry picked from commit cabc8c3a78)

Co-authored-by: alessandronardin <ale.daluch@gmail.com>
This commit is contained in:
Kinsey Moore
2024-11-26 19:42:12 +00:00
parent c529694656
commit 106d00537e
4 changed files with 86 additions and 21 deletions

View File

@@ -315,12 +315,6 @@ rtems_aio_request *init_read_req( struct aiocb* aiocbp );
*/
void rtems_aio_completed_list_op( listcb *listcbp );
/**
* @brief generates event at list completion to end wait in lio_listio().
*
*/
void lio_notify_end_wait( union sigval attr );
#ifdef RTEMS_DEBUG
#include <assert.h>

View File

@@ -435,11 +435,38 @@ extern "C" {
*/
typedef uint32_t rtems_event_set;
/* Generated from spec:/rtems/event/if/system-lio-list-completed */
/**
* @brief This event set constant represents the reserved system event
* internally used to notify list completion when lio_listio is called using
* LIO_WAIT.
*
* @par Constraints
* @parblock
* The following constraints apply to this constant:
*
* * The constant is not included in the pre-qualified feature set of RTEMS.
* Applications which are restricted to only use interfaces of the
* pre-qualified feature set of RTEMS shall not use the constant.
* @endparblock
*/
#define RTEMS_EVENT_SYSTEM_LIO_LIST_COMPLETED RTEMS_EVENT_28
/* Generated from spec:/rtems/event/if/system-network-close */
/**
* @brief This event set constant represents the reserved system event for a
* network socket close.
*
* @par Constraints
* @parblock
* The following constraints apply to this constant:
*
* * The constant is not included in the pre-qualified feature set of RTEMS.
* Applications which are restricted to only use interfaces of the
* pre-qualified feature set of RTEMS shall not use the constant.
* @endparblock
*/
#define RTEMS_EVENT_SYSTEM_NETWORK_CLOSE RTEMS_EVENT_26
@@ -448,6 +475,15 @@ typedef uint32_t rtems_event_set;
/**
* @brief This event set constant represents the reserved system event for a
* network socket buffer wait usage.
*
* @par Constraints
* @parblock
* The following constraints apply to this constant:
*
* * The constant is not included in the pre-qualified feature set of RTEMS.
* Applications which are restricted to only use interfaces of the
* pre-qualified feature set of RTEMS shall not use the constant.
* @endparblock
*/
#define RTEMS_EVENT_SYSTEM_NETWORK_SBWAIT RTEMS_EVENT_24
@@ -456,6 +492,15 @@ typedef uint32_t rtems_event_set;
/**
* @brief This event set constant represents the reserved system event for a
* network socket sleep.
*
* @par Constraints
* @parblock
* The following constraints apply to this constant:
*
* * The constant is not included in the pre-qualified feature set of RTEMS.
* Applications which are restricted to only use interfaces of the
* pre-qualified feature set of RTEMS shall not use the constant.
* @endparblock
*/
#define RTEMS_EVENT_SYSTEM_NETWORK_SOSLEEP RTEMS_EVENT_25
@@ -533,20 +578,32 @@ rtems_status_code rtems_event_system_send(
/**
* @brief This event set constant represents the reserved system event for
* server thread usage, for example the timer or interrupt server.
*
* @par Constraints
* @parblock
* The following constraints apply to this constant:
*
* * The constant is not included in the pre-qualified feature set of RTEMS.
* Applications which are restricted to only use interfaces of the
* pre-qualified feature set of RTEMS shall not use the constant.
* @endparblock
*/
#define RTEMS_EVENT_SYSTEM_SERVER RTEMS_EVENT_30
/**
* @brief This event set constant represents the reserved system event for
* aio list completion, used when lio_listio is called using LIO_WAIT.
*/
#define RTEMS_EVENT_SYSTEM_AIO_LIST RTEMS_EVENT_28
/* Generated from spec:/rtems/event/if/system-server-resume */
/**
* @brief This event set constant represents the reserved system event to
* resume a server thread, for example the timer or interrupt server.
*
* @par Constraints
* @parblock
* The following constraints apply to this constant:
*
* * The constant is not included in the pre-qualified feature set of RTEMS.
* Applications which are restricted to only use interfaces of the
* pre-qualified feature set of RTEMS shall not use the constant.
* @endparblock
*/
#define RTEMS_EVENT_SYSTEM_SERVER_RESUME RTEMS_EVENT_29
@@ -555,6 +612,15 @@ rtems_status_code rtems_event_system_send(
/**
* @brief This event set constant represents the reserved system event for
* transient usage.
*
* @par Constraints
* @parblock
* The following constraints apply to this constant:
*
* * The constant is not included in the pre-qualified feature set of RTEMS.
* Applications which are restricted to only use interfaces of the
* pre-qualified feature set of RTEMS shall not use the constant.
* @endparblock
*/
#define RTEMS_EVENT_SYSTEM_TRANSIENT RTEMS_EVENT_31
@@ -567,6 +633,10 @@ rtems_status_code rtems_event_system_send(
* @parblock
* The following constraints apply to this directive:
*
* * The directive is not included in the pre-qualified feature set of RTEMS.
* Applications which are restricted to only use interfaces of the
* pre-qualified feature set of RTEMS shall not use the directive.
*
* * The directive may be called from within device driver initialization
* context.
*
@@ -600,6 +670,10 @@ static inline void rtems_event_transient_clear( void )
* @parblock
* The following constraints apply to this directive:
*
* * The directive is not included in the pre-qualified feature set of RTEMS.
* Applications which are restricted to only use interfaces of the
* pre-qualified feature set of RTEMS shall not use the directive.
*
* * The directive may be called from within device driver initialization
* context.
*
@@ -634,6 +708,10 @@ static inline rtems_status_code rtems_event_transient_receive(
* @parblock
* The following constraints apply to this directive:
*
* * The directive is not included in the pre-qualified feature set of RTEMS.
* Applications which are restricted to only use interfaces of the
* pre-qualified feature set of RTEMS shall not use the directive.
*
* * The directive may be called from within interrupt context.
*
* * The directive may be called from within device driver initialization

View File

@@ -271,7 +271,7 @@ void rtems_aio_completed_list_op( listcb *listcbp )
case AIO_LIO_EVENT:
rtems_event_system_send(
listcbp->lio_notification.task_id,
RTEMS_EVENT_SYSTEM_AIO_LIST
RTEMS_EVENT_SYSTEM_LIO_LIST_COMPLETED
);
break;
}
@@ -821,10 +821,3 @@ static void rtems_aio_handle_helper( rtems_aio_request *req )
}
}
void lio_notify_end_wait( union sigval attr ){
rtems_id id = attr.sival_int;
rtems_event_set event_in = RTEMS_EVENT_SYSTEM_AIO_LIST;
rtems_event_system_send( id, event_in );
}

View File

@@ -178,7 +178,7 @@ int lio_listio(
} else if ( mode == LIO_WAIT ) {
rtems_event_set event_out;
rtems_event_system_receive(
RTEMS_EVENT_SYSTEM_AIO_LIST,
RTEMS_EVENT_SYSTEM_LIO_LIST_COMPLETED,
RTEMS_DEFAULT_OPTIONS,
RTEMS_NO_TIMEOUT,
&event_out