Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * Copyright © <2010>, Intel Corporation.
  3.  *
  4.  * This program is licensed under the terms and conditions of the
  5.  * Eclipse Public License (EPL), version 1.0.  The full text of the EPL is at
  6.  * http://www.opensource.org/licenses/eclipse-1.0.php.
  7.  *
  8.  */
  9. //========== Forward message to root thread through gateway ==========
  10. // Each child thread write a byte into the root GRF r50 defiend in open Gataway.
  11.  
  12. #if defined(_DEBUG)
  13. mov             (1)             EntrySignatureC:w                       0x7777:w
  14. #endif
  15.  
  16. // Init payload to r0
  17. mov (8)         GatewayPayload<1>:ud    0:w                                                             //{ NoDDClr }
  18.  
  19. // Forward a message:
  20. // Offset = x relative to r50 (defiend in open gataway), x = ORIX >> 4 [bit 28:16]
  21. // Need to shift left 16
  22.  
  23. // shift 2 more bits for byte to word offset
  24.  
  25. //shl   (1)             Offset_Length:ud                GateWayOffsetC:w                16:w            { NoDDClr, NoDDChk }
  26. shl     (1)             Offset_Length:ud                GateWayOffsetC:w                18:w           
  27.  
  28. // 2 bytes offset
  29. add     (1)             Offset_Length:ud                        Offset_Length:ud                0x00020000:d    { NoDDClr }
  30.        
  31. // Length = 1 byte,     [bit 10:8 = 000]
  32. //000 xxxxxxxxxxxxx 00000 000 00000000 ==> 000x xxxx xxxx xxxx 0000 0000 0000 0000
  33.  
  34. //mov (1)       DispatchID:ub                   r0.20:ub                // Dispatch ID
  35.  
  36. //Move in EUid and Thread ID that we received from the PARENT thread
  37. mov (1)         EUID_TID:uw                     r0.6:uw                                                         { NoDDClr, NoDDChk }
  38.  
  39. mov (1)         GatewayPayloadKey:uw    0x1212:uw                                                       { NoDDClr, NoDDChk }    // Key
  40.  
  41. //mov   (4)             GatewayPayload<1>:ud    0:ud                                                            { NoDDClr, NoDDChk }    // Init payload low 4 dword
  42.  
  43. // Write back one byte (value = 0xFF) to root thread GRF to indicate this child thread is finished
  44. // All lower 4 bytes must be assigned to the same byte value.
  45. mov     (4)             GatewayPayload<1>:ub    0xFFFF:uw                                                       { NoDDChk }
  46.  
  47. // msg descriptor bit 15 set to '1' for notification
  48. #ifdef GW_DCN
  49. // For ILK, EOT bit should also be set to terminate the thread. This is to fix a timing related HW issue.
  50. //
  51. send (8)        null:ud                 m0                      GatewayPayload<8;8,1>:ud    MSG_GW_EOT  FWDMSGDSC+NOTIFYMSG
  52. #else
  53. send (8)        null:ud                 m0                      GatewayPayload<8;8,1>:ud    MSG_GW      FWDMSGDSC+NOTIFYMSG
  54. #endif  // GW_DCN
  55.  
  56. //========== Forward Msg Done ========================================
  57.  
  58.