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