pacaData.c
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:5k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * c 2001 PPC 64 Team, IBM Corp
  3.  *
  4.  *      This program is free software; you can redistribute it and/or
  5.  *      modify it under the terms of the GNU General Public License
  6.  *      as published by the Free Software Foundation; either version
  7.  *      2 of the License, or (at your option) any later version.
  8.  */
  9. #include <asm/types.h>
  10. #include <asm/page.h>
  11. #include <stddef.h>
  12. #include <linux/config.h>
  13. #include <linux/threads.h>
  14. #include <asm/processor.h>
  15. #include <asm/ptrace.h>
  16. #include <asm/iSeries/ItLpPaca.h>
  17. #include <asm/naca.h>
  18. #include <asm/paca.h>
  19. struct naca_struct *naca;
  20. /* The Paca is an array with one entry per processor.  Each contains an 
  21.  * ItLpPaca, which contains the information shared between the 
  22.  * hypervisor and Linux.  Each also contains an ItLpRegSave area which
  23.  * is used by the hypervisor to save registers.
  24.  * On systems with hardware multi-threading, there are two threads
  25.  * per processor.  The Paca array must contain an entry for each thread.
  26.  * The VPD Areas will give a max logical processors = 2 * max physical
  27.  * processors.  The processor VPD array needs one entry per physical
  28.  * processor (not thread).
  29.  */
  30. #define PACAINITDATA(number,start,lpq,asrr,asrv) 
  31. {                                                                          
  32.         xLpPacaPtr: &paca[number].xLpPaca,                                 
  33.         xLpRegSavePtr: &paca[number].xRegSav,                              
  34.         xPacaIndex: (number),           /* Paca Index        */             
  35.         default_decr: 0x00ff0000,       /* Initial Decr      */             
  36.         xStab_data: {                                                       
  37.                 real: (asrr),           /* Real pointer to segment table */ 
  38.                 virt: (asrv),           /* Virt pointer to segment table */ 
  39.                 next_round_robin: 1     /* Round robin index */             
  40.         },                                                                  
  41.         lpQueuePtr: (lpq),              /* &xItLpQueue,                  */ 
  42.         /* xRtas: {                                                            
  43.                 lock: SPIN_LOCK_UNLOCKED                                    
  44.         }, */                                                                  
  45.         xProcStart: (start),            /* Processor start */               
  46.         xLpPaca: {                                                          
  47.                 xDesc: 0xd397d781,      /* "LpPa"          */               
  48.                 xSize: sizeof(struct ItLpPaca),                             
  49.                 xFPRegsInUse: 1,                                            
  50.                 xDynProcStatus: 2,                                          
  51. xDecrVal: 0x00ff0000,     
  52.                 xEndOfQuantum: 0xffffffffffffffff                           
  53.         },                                                                  
  54.         xRegSav: {                                                          
  55.                 xDesc: 0xd397d9e2,      /* "LpRS"          */               
  56.                 xSize: sizeof(struct ItLpRegSave)                           
  57.         },                                                                  
  58.         exception_sp:                                                       
  59.                 (&paca[number].exception_stack[0]) - EXC_FRAME_SIZE,       
  60. }
  61. struct paca_struct paca[MAX_PACAS] __page_aligned = {
  62. #ifdef CONFIG_PPC_ISERIES
  63. PACAINITDATA( 0, 1, &xItLpQueue, 0, 0xc000000000005000),
  64. #else
  65. PACAINITDATA( 0, 1, 0, 0x5000, 0xc000000000005000),
  66. #endif
  67. PACAINITDATA( 1, 0, 0, 0, 0),
  68. PACAINITDATA( 2, 0, 0, 0, 0),
  69. PACAINITDATA( 3, 0, 0, 0, 0),
  70. PACAINITDATA( 4, 0, 0, 0, 0),
  71. PACAINITDATA( 5, 0, 0, 0, 0),
  72. PACAINITDATA( 6, 0, 0, 0, 0),
  73. PACAINITDATA( 7, 0, 0, 0, 0),
  74. PACAINITDATA( 8, 0, 0, 0, 0),
  75. PACAINITDATA( 9, 0, 0, 0, 0),
  76. PACAINITDATA(10, 0, 0, 0, 0),
  77. PACAINITDATA(11, 0, 0, 0, 0),
  78. PACAINITDATA(12, 0, 0, 0, 0),
  79. PACAINITDATA(13, 0, 0, 0, 0),
  80. PACAINITDATA(14, 0, 0, 0, 0),
  81. PACAINITDATA(15, 0, 0, 0, 0),
  82. PACAINITDATA(16, 0, 0, 0, 0),
  83. PACAINITDATA(17, 0, 0, 0, 0),
  84. PACAINITDATA(18, 0, 0, 0, 0),
  85. PACAINITDATA(19, 0, 0, 0, 0),
  86. PACAINITDATA(20, 0, 0, 0, 0),
  87. PACAINITDATA(21, 0, 0, 0, 0),
  88. PACAINITDATA(22, 0, 0, 0, 0),
  89. PACAINITDATA(23, 0, 0, 0, 0),
  90. PACAINITDATA(24, 0, 0, 0, 0),
  91. PACAINITDATA(25, 0, 0, 0, 0),
  92. PACAINITDATA(26, 0, 0, 0, 0),
  93. PACAINITDATA(27, 0, 0, 0, 0),
  94. PACAINITDATA(28, 0, 0, 0, 0),
  95. PACAINITDATA(29, 0, 0, 0, 0),
  96. PACAINITDATA(30, 0, 0, 0, 0),
  97. PACAINITDATA(31, 0, 0, 0, 0),
  98. PACAINITDATA(32, 0, 0, 0, 0),
  99. PACAINITDATA(33, 0, 0, 0, 0),
  100. PACAINITDATA(34, 0, 0, 0, 0),
  101. PACAINITDATA(35, 0, 0, 0, 0),
  102. PACAINITDATA(36, 0, 0, 0, 0),
  103. PACAINITDATA(37, 0, 0, 0, 0),
  104. PACAINITDATA(38, 0, 0, 0, 0),
  105. PACAINITDATA(39, 0, 0, 0, 0),
  106. PACAINITDATA(40, 0, 0, 0, 0),
  107. PACAINITDATA(41, 0, 0, 0, 0),
  108. PACAINITDATA(42, 0, 0, 0, 0),
  109. PACAINITDATA(43, 0, 0, 0, 0),
  110. PACAINITDATA(44, 0, 0, 0, 0),
  111. PACAINITDATA(45, 0, 0, 0, 0),
  112. PACAINITDATA(46, 0, 0, 0, 0),
  113. PACAINITDATA(47, 0, 0, 0, 0)
  114. };