📄 xp.h
字号:
xpcSystemPoweroff, /* 48: system is being powered off */ xpcDisconnecting, /* 49: channel disconnecting (closing) */ xpcOpenCloseError, /* 50: channel open/close protocol error */ xpcUnknownReason /* 51: unknown reason -- must be last in list */};/* * Define the callout function types used by XPC to update the user on * connection activity and state changes (via the user function registered by * xpc_connect()) and to notify them of messages received and delivered (via * the user function registered by xpc_send_notify()). * * The two function types are xpc_channel_func and xpc_notify_func and * both share the following arguments, with the exception of "data", which * only xpc_channel_func has. * * Arguments: * * reason - reason code. (See following table.) * partid - partition ID associated with condition. * ch_number - channel # associated with condition. * data - pointer to optional data. (See following table.) * key - pointer to optional user-defined value provided as the "key" * argument to xpc_connect() or xpc_send_notify(). * * In the following table the "Optional Data" column applies to callouts made * to functions registered by xpc_connect(). A "NA" in that column indicates * that this reason code can be passed to functions registered by * xpc_send_notify() (i.e. they don't have data arguments). * * Also, the first three reason codes in the following table indicate * success, whereas the others indicate failure. When a failure reason code * is received, one can assume that the channel is not connected. * * * Reason Code | Cause | Optional Data * =====================+================================+===================== * xpcConnected | connection has been established| max #of entries * | to the specified partition on | allowed in message * | the specified channel | queue * ---------------------+--------------------------------+--------------------- * xpcMsgReceived | an XPC message arrived from | address of payload * | the specified partition on the | * | specified channel | [the user must call * | | xpc_received() when * | | finished with the * | | payload] * ---------------------+--------------------------------+--------------------- * xpcMsgDelivered | notification that the message | NA * | was delivered to the intended | * | recipient and that they have | * | acknowledged its receipt by | * | calling xpc_received() | * =====================+================================+===================== * xpcUnequalMsgSizes | can't connect to the specified | NULL * | partition on the specified | * | channel because of mismatched | * | message sizes | * ---------------------+--------------------------------+--------------------- * xpcNoMemory | insufficient memory avaiable | NULL * | to allocate message queue | * ---------------------+--------------------------------+--------------------- * xpcLackOfResources | lack of resources to create | NULL * | the necessary kthreads to | * | support the channel | * ---------------------+--------------------------------+--------------------- * xpcUnregistering | this side's user has | NULL or NA * | unregistered by calling | * | xpc_disconnect() | * ---------------------+--------------------------------+--------------------- * xpcOtherUnregistering| the other side's user has | NULL or NA * | unregistered by calling | * | xpc_disconnect() | * ---------------------+--------------------------------+--------------------- * xpcNoHeartbeat | the other side's XPC is no | NULL or NA * | longer heartbeating | * | | * ---------------------+--------------------------------+--------------------- * xpcUnloading | this side's XPC module is | NULL or NA * | being unloaded | * | | * ---------------------+--------------------------------+--------------------- * xpcOtherUnloading | the other side's XPC module is | NULL or NA * | is being unloaded | * | | * ---------------------+--------------------------------+--------------------- * xpcPioReadError | xp_nofault_PIOR() returned an | NULL or NA * | error while sending an IPI | * | | * ---------------------+--------------------------------+--------------------- * xpcInvalidAddress | the address either received or | NULL or NA * | sent by the specified partition| * | is invalid | * ---------------------+--------------------------------+--------------------- * xpcBteNotAvailable | attempt to pull data from the | NULL or NA * xpcBtePoisonError | specified partition over the | * xpcBteWriteError | specified channel via a | * xpcBteAccessError | bte_copy() failed | * xpcBteTimeOutError | | * xpcBteXtalkError | | * xpcBteDirectoryError | | * xpcBteGenericError | | * xpcBteUnmappedError | | * ---------------------+--------------------------------+--------------------- * xpcUnknownReason | the specified channel to the | NULL or NA * | specified partition was | * | unavailable for unknown reasons| * =====================+================================+===================== */typedef void (*xpc_channel_func)(enum xpc_retval reason, partid_t partid, int ch_number, void *data, void *key);typedef void (*xpc_notify_func)(enum xpc_retval reason, partid_t partid, int ch_number, void *key);/* * The following is a registration entry. There is a global array of these, * one per channel. It is used to record the connection registration made * by the users of XPC. As long as a registration entry exists, for any * partition that comes up, XPC will attempt to establish a connection on * that channel. Notification that a connection has been made will occur via * the xpc_channel_func function. * * The 'func' field points to the function to call when aynchronous * notification is required for such events as: a connection established/lost, * or an incoming message received, or an error condition encountered. A * non-NULL 'func' field indicates that there is an active registration for * the channel. */struct xpc_registration { struct semaphore sema; xpc_channel_func func; /* function to call */ void *key; /* pointer to user's key */ u16 nentries; /* #of msg entries in local msg queue */ u16 msg_size; /* message queue's message size */ u32 assigned_limit; /* limit on #of assigned kthreads */ u32 idle_limit; /* limit on #of idle kthreads */} ____cacheline_aligned;#define XPC_CHANNEL_REGISTERED(_c) (xpc_registrations[_c].func != NULL)/* the following are valid xpc_allocate() flags */#define XPC_WAIT 0 /* wait flag */#define XPC_NOWAIT 1 /* no wait flag */struct xpc_interface { void (*connect)(int); void (*disconnect)(int); enum xpc_retval (*allocate)(partid_t, int, u32, void **); enum xpc_retval (*send)(partid_t, int, void *); enum xpc_retval (*send_notify)(partid_t, int, void *, xpc_notify_func, void *); void (*received)(partid_t, int, void *); enum xpc_retval (*partid_to_nasids)(partid_t, void *);};extern struct xpc_interface xpc_interface;extern void xpc_set_interface(void (*)(int), void (*)(int), enum xpc_retval (*)(partid_t, int, u32, void **), enum xpc_retval (*)(partid_t, int, void *), enum xpc_retval (*)(partid_t, int, void *, xpc_notify_func, void *), void (*)(partid_t, int, void *), enum xpc_retval (*)(partid_t, void *));extern void xpc_clear_interface(void);extern enum xpc_retval xpc_connect(int, xpc_channel_func, void *, u16, u16, u32, u32);extern void xpc_disconnect(int);static inline enum xpc_retvalxpc_allocate(partid_t partid, int ch_number, u32 flags, void **payload){ return xpc_interface.allocate(partid, ch_number, flags, payload);}static inline enum xpc_retvalxpc_send(partid_t partid, int ch_number, void *payload){ return xpc_interface.send(partid, ch_number, payload);}static inline enum xpc_retvalxpc_send_notify(partid_t partid, int ch_number, void *payload, xpc_notify_func func, void *key){ return xpc_interface.send_notify(partid, ch_number, payload, func, key);}static inline voidxpc_received(partid_t partid, int ch_number, void *payload){ return xpc_interface.received(partid, ch_number, payload);}static inline enum xpc_retvalxpc_partid_to_nasids(partid_t partid, void *nasids){ return xpc_interface.partid_to_nasids(partid, nasids);}extern u64 xp_nofault_PIOR_target;extern int xp_nofault_PIOR(void *);extern int xp_error_PIOR(void);#endif /* _ASM_IA64_SN_XP_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -