Ignore:
Timestamp:
Oct 10, 2004, 12:48:19 PM (21 years ago)
Author:
bird
Message:

First attempt on shared signal interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/InnoTekLIBC/sharedpm.h

    • Property cvs2svn:cvs-rev changed from 1.7 to 1.8
    r1570 r1571  
    2929#include <sys/cdefs.h>
    3030#include <sys/types.h>
     31#include <sys/signal.h>
    3132
    3233__BEGIN_DECLS
     
    5657 * The SPM version.
    5758 */
    58 #define SPM_VERSION             0x00010000
     59#define SPM_VERSION             0x00010001
    5960
    6061/**
     
    105106    __LIBC_EXIT_REASON_MAKE_INT32 = 0x7fffffff
    106107} __LIBC_EXIT_REASON;
     108
     109
     110/**
     111 * Signal (queued).
     112 */
     113typedef struct __libc_SPMSignal
     114{
     115    /** Structure size. */
     116    unsigned                    cb;
     117    /** Pointer to the next signal. */
     118    struct __libc_SPMSignal    *pNext;
     119    /** Signal info. */
     120    siginfo_t                   Info;
     121} __LIBC_SPMSIGNAL;
     122/** Pointer to (queued) signal. */
     123typedef __LIBC_SPMSIGNAL *__LIBC_PSPMSIGNAL;
     124
    107125
    108126/** Inheritance FH Bundle Type.
     
    253271    /** Creation timestamp. */
    254272    unsigned                    uTimestamp;
     273    /** Incoming signal queue.
     274     * This is a LIFO for speed and size. The receiving process will
     275     * process them in the correct order of course.
     276     * For signals which aren't queable only one signal can be queued.
     277     */
     278    __LIBC_PSPMSIGNAL           pSigHead;
     279    /** Number of queued signals.
     280     * After it passes 48 signals, only SIGCHLD will be queued.
     281     * This means siqueue() won't work 100% according to spec. */
     282    unsigned                    cSigsQueued;
    255283
    256284    /** Reserved pool pointer field with default value 0. */
    257     unsigned                    aReserved[40 - 14];
     285    unsigned                    aReserved[40 - 16];
    258286
    259287    /** Number of possible pointers to shared memory starting at pvInherit.
     
    379407    __LIBC_SPMLOADAVG           LoadAvg;
    380408
     409    /** List of free signal structures. This will reduce
     410     * the time spent allocating a signal structure in most cases.
     411     * During SPM init 8 signal structures will be allocated and queued. */
     412    __LIBC_PSPMSIGNAL           pSigFreeHead;
     413    /** Number of free signal structures in the list.
     414     * This is used to prevent the list from growing infinitly under stress.
     415     * When cSigFree reaches 32 unused signal structures will be freed instead
     416     * of put in the list. */
     417    unsigned                    cSigFree;
     418    /** Number of active signals.
     419     * This is used to keep a reasonable limit of the number of active signal
     420     * structures so a process cannot exhaust the shared memory pool.
     421     * The maximum is defined by cSigMaxActive.
     422     */
     423    unsigned                    cSigActive;
     424    /** The maximum number of active signals.
     425     * This is initialized by the SPM creator but can be adjusted later.
     426     */
     427    unsigned                    cSigMaxActive;
     428
    381429    /* The rest of the block, up to cbProcess, is undefined in this version.
    382430     * Future versions of LIBC may use this area assuming it's initalized with zeros.
     
    593641
    594642/**
     643 * Queues a signal on another process.
     644 *
     645 * @returns 0 on success.
     646 * @returns Negative error code (errno.h) on failure.
     647 * @param   pSignal     Signal to queue.
     648 * @param   pid         Pid to queue it on.
     649 * @param   fQueued     Set if the signal type is queued.
     650 */
     651int     __libc_spmSigQueue(siginfo_t *pSignal, pid_t pid, int fQueued);
     652
     653/**
     654 * De-queues one or more pending signals.
     655 * @returns Number of de-queued signals on success.
     656 * @returns Negative error code (errno.h) on failure.
     657 * @param   paSignals   Where to store the signals.
     658 * @param   cSignals    Size of the signal array.
     659 * @param   cbSignal    Size of one signal entry.
     660 */
     661int     __libc_spmSigDequeue(siginfo_t *paSignals, unsigned cSignals, size_t cbSignal);
     662
     663
     664/**
    595665 * Checks the SPM memory for trouble.
    596666 *
Note: See TracChangeset for help on using the changeset viewer.