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. //=============== Spawn a chroma root thread ===============
  10.  
  11.         //----- Create chroma root thread R0 header -----
  12. #if defined(_DEBUG)
  13.         mov             (1)             EntrySignature:w                        0xAABA:w
  14. #endif
  15.  
  16.  
  17.  
  18.         // Restore CT_R0Hdr.4:ud to r0.4:ud
  19. //      mov (1) CT_R0Hdr.4:ud           r0.4:ud
  20.  
  21.         // R0.2: Interface Discriptor Ptr.  Add child offset for child kernel
  22.         add (1) CT_R0Hdr.2:ud           r0.2:ud                 CHROMA_ROOT_OFFSET:w
  23.  
  24.         // Assign a new Thread Count for this child
  25.         mov (1) CT_R0Hdr.6:ud           1:w             // ThreadID=1 for chroma root
  26.  
  27.         //----- Copy luma root r1 for launching chroma root thread -----
  28.         mov (16) m2.0:w         RootParam<16;16,1>:w
  29.  
  30.         #include "writeURB.asm"
  31.  
  32.         //--------------------------------------------------
  33.         // Set URB handle for child thread launching:
  34.         // URB handle Length            (bit 15:10) - 0000 0000 0000 0000  yyyy yy00 0000 0000
  35.         // URB handle offset            (bit 9:0)       - 0000 0000 0000 0000  0000 00xx xxxx xxxx
  36.  
  37.         or  (1) CT_R0Hdr.4:ud           URB_EntriesPerMB_2:w    URBOffset:uw
  38.        
  39.         // 2 URB entries:
  40.         // Entry 0 - CT_R0Hdr
  41.         // Entry 1 - input parameter to child kernel
  42.  
  43.         //----- Spawn a child now -----
  44.         send (8) null:ud        CT_R0Hdr        null:ud    TS   TSMSGDSC
  45.  
  46.         // Restore CT_R0Hdr.4:ud to r0.4:ud for next use
  47.         mov (1) CT_R0Hdr.4:ud           r0.4:ud
  48.