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:
Tomas Hruby
2010-03-29 11:25:01 +00:00
parent 2521cc6bdf
commit 5b52c5aa02
4 changed files with 60 additions and 29 deletions

View File

@@ -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 */