Subversion Repositories Kolibri OS

Rev

Rev 8385 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include <string.h>
  2.  
  3. typedef unsigned int uint32_t;
  4.  
  5. static inline
  6. int start_app(char *app_name, char *args){
  7.     #pragma pack(push, 1)
  8.     struct file_op_t
  9.     {
  10.         uint32_t fn;
  11.         uint32_t    flags;
  12.         char*       args;
  13.         uint32_t    res1, res2;
  14.         char        zero;
  15.         char*       app_name  __attribute__((packed));
  16.     } file_op;
  17.     #pragma pack(pop)
  18.     memset(&file_op, 0, sizeof(file_op));
  19.     file_op.fn = 7;
  20.     file_op.args = args;
  21.     file_op.app_name = app_name;
  22.  
  23.     register int val;
  24.     asm volatile ("int $0x40":"=a"(val):"a"(70), "b"(&file_op): "memory");
  25.  
  26.     return val;
  27. }
  28.  
  29. void notify(char *text) {
  30.    start_app("/sys/@notify", text);
  31. }
  32.