A reliable way for userspace to check if a msg is from kernel
- IPC_FLG_MSG_FROM_KERNEL status flag is returned to userspace if the receive was satisfied by s message which was sent by the kernel on behalf of a process. This perfectly reliale information. - MF_SENDING_FROM_KERNEL flag added to processes to be able to set IPC_FLG_MSG_FROM_KERNEL when finishing receive if the receiver wasn't ready to receive immediately. - PM is changed to use this information to confirm that the scheduling messages are indeed from the kernel and not faked by a process. PM uses sef_receive_status() - get_work() is removed from PM to make the changes simpler
This commit is contained in:
@@ -17,4 +17,12 @@
|
||||
#define IPC_STATUS_CALL_TO(call) \
|
||||
(((call) & IPC_STATUS_CALL_MASK) << IPC_STATUS_CALL_SHIFT)
|
||||
|
||||
#define IPC_FLG_MSG_FROM_KERNEL 1 /* this message originated in the kernel on
|
||||
behalf of a process, this is a trusted
|
||||
message, never reply to the sender
|
||||
*/
|
||||
#define IPC_STATUS_FLAGS_SHIFT 16
|
||||
#define IPC_STATUS_FLAGS(flgs) ((flgs) << IPC_STATUS_FLAGS_SHIFT)
|
||||
#define IPC_STATUS_FLAGS_TEST(status, flgs) \
|
||||
(((status) >> IPC_STATUS_FLAGS_SHIFT) & (flgs))
|
||||
#endif /* IPC_CONST_H */
|
||||
|
||||
Reference in New Issue
Block a user