1/// @file 2/// IPF specific External Interrupt Control Registers accessing functions 3/// 4/// Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> 5/// This program and the accompanying materials 6/// are licensed and made available under the terms and conditions of the BSD License 7/// which accompanies this distribution. The full text of the license may be found at 8/// http://opensource.org/licenses/bsd-license.php. 9/// 10/// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11/// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12/// 13/// Module Name: AccessEicr.s 14/// 15/// 16 17//--------------------------------------------------------------------------------- 18//++ 19// AsmReadLid 20// 21// This routine is used to read the value of Local Interrupt ID Register (LID). 22// 23// Arguments : 24// 25// On Entry : 26// 27// Return Value: The current value of LID. 28// 29//-- 30//---------------------------------------------------------------------------------- 31.text 32.type AsmReadLid, @function 33.proc AsmReadLid 34 35AsmReadLid:: 36 mov r8 = cr.lid;; 37 srlz.d;; 38 br.ret.dpnt b0;; 39.endp AsmReadLid 40 41//--------------------------------------------------------------------------------- 42//++ 43// AsmWriteLid 44// 45// This routine is used to write the value to Local Interrupt ID Register (LID). 46// 47// Arguments : 48// 49// On Entry : The value need to be written to LID. 50// 51// Return Value: The value written to LID. 52// 53//-- 54//---------------------------------------------------------------------------------- 55.text 56.type AsmWriteLid, @function 57.proc AsmWriteLid 58.regstk 1, 0, 0, 0 59 60AsmWriteLid:: 61 mov cr.lid = in0 62 mov r8 = in0;; 63 srlz.d;; 64 br.ret.dpnt b0;; 65.endp AsmWriteLid 66 67 68//--------------------------------------------------------------------------------- 69//++ 70// AsmReadIvr 71// 72// This routine is used to read the value of External Interrupt Vector Register (IVR). 73// 74// Arguments : 75// 76// On Entry : 77// 78// Return Value: The current value of IVR. 79// 80//-- 81//---------------------------------------------------------------------------------- 82.text 83.type AsmReadIvr, @function 84.proc AsmReadIvr 85 86AsmReadIvr:: 87 mov r8 = cr.ivr;; 88 srlz.d;; 89 br.ret.dpnt b0;; 90.endp AsmReadIvr 91 92 93//--------------------------------------------------------------------------------- 94//++ 95// AsmReadTpr 96// 97// This routine is used to read the value of Task Priority Register (TPR). 98// 99// Arguments : 100// 101// On Entry : 102// 103// Return Value: The current value of TPR. 104// 105//-- 106//---------------------------------------------------------------------------------- 107.text 108.type AsmReadTpr, @function 109.proc AsmReadTpr 110 111AsmReadTpr:: 112 mov r8 = cr.tpr;; 113 br.ret.dpnt b0;; 114.endp AsmReadTpr 115 116//--------------------------------------------------------------------------------- 117//++ 118// AsmWriteTpr 119// 120// This routine is used to write the value to Task Priority Register (TPR). 121// 122// Arguments : 123// 124// On Entry : The value need to be written to TPR. 125// 126// Return Value: The value written to TPR. 127// 128//-- 129//---------------------------------------------------------------------------------- 130.text 131.type AsmWriteTpr, @function 132.proc AsmWriteTpr 133.regstk 1, 0, 0, 0 134 135AsmWriteTpr:: 136 mov cr.tpr = in0 137 mov r8 = in0;; 138 srlz.d;; 139 br.ret.dpnt b0;; 140.endp AsmWriteTpr 141 142 143//--------------------------------------------------------------------------------- 144//++ 145// AsmWriteEoi 146// 147// This routine is used to write the value to End of External Interrupt Register (EOI). 148// 149// Arguments : 150// 151// On Entry : The value need to be written to EOI. 152// 153// Return Value: The value written to EOI. 154// 155//-- 156//---------------------------------------------------------------------------------- 157.text 158.type AsmWriteEoi, @function 159.proc AsmWriteEoi 160 161AsmWriteEoi:: 162 mov cr.eoi = r0;; 163 srlz.d;; 164 br.ret.dpnt b0;; 165.endp AsmWriteEoi 166 167 168//--------------------------------------------------------------------------------- 169//++ 170// AsmReadIrr0 171// 172// This routine is used to Read the value of External Interrupt Request Register 0 (IRR0). 173// 174// Arguments : 175// 176// On Entry : 177// 178// Return Value: The current value of IRR0. 179// 180//-- 181//---------------------------------------------------------------------------------- 182.text 183.type AsmReadIrr0, @function 184.proc AsmReadIrr0 185 186AsmReadIrr0:: 187 mov r8 = cr.irr0;; 188 br.ret.dpnt b0;; 189.endp AsmReadIrr0 190 191 192//--------------------------------------------------------------------------------- 193//++ 194// AsmReadIrr1 195// 196// This routine is used to Read the value of External Interrupt Request Register 1 (IRR1). 197// 198// Arguments : 199// 200// On Entry : 201// 202// Return Value: The current value of IRR1. 203// 204//-- 205//---------------------------------------------------------------------------------- 206.text 207.type AsmReadIrr1, @function 208.proc AsmReadIrr1 209 210AsmReadIrr1:: 211 mov r8 = cr.irr1;; 212 br.ret.dpnt b0;; 213.endp AsmReadIrr1 214 215 216//--------------------------------------------------------------------------------- 217//++ 218// AsmReadIrr2 219// 220// This routine is used to Read the value of External Interrupt Request Register 2 (IRR2). 221// 222// Arguments : 223// 224// On Entry : 225// 226// Return Value: The current value of IRR2. 227// 228//-- 229//---------------------------------------------------------------------------------- 230.text 231.type AsmReadIrr2, @function 232.proc AsmReadIrr2 233 234AsmReadIrr2:: 235 mov r8 = cr.irr2;; 236 br.ret.dpnt b0;; 237.endp AsmReadIrr2 238 239 240//--------------------------------------------------------------------------------- 241//++ 242// AsmReadIrr3 243// 244// This routine is used to Read the value of External Interrupt Request Register 3 (IRR3). 245// 246// Arguments : 247// 248// On Entry : 249// 250// Return Value: The current value of IRR3. 251// 252//-- 253//---------------------------------------------------------------------------------- 254.text 255.type AsmReadIrr3, @function 256.proc AsmReadIrr3 257 258AsmReadIrr3:: 259 mov r8 = cr.irr3;; 260 br.ret.dpnt b0;; 261.endp AsmReadIrr3 262 263 264//--------------------------------------------------------------------------------- 265//++ 266// AsmReadItv 267// 268// This routine is used to Read the value of Interval Timer Vector Register (ITV). 269// 270// Arguments : 271// 272// On Entry : 273// 274// Return Value: The current value of ITV. 275// 276//-- 277//---------------------------------------------------------------------------------- 278.text 279.type AsmReadItv, @function 280.proc AsmReadItv 281 282AsmReadItv:: 283 mov r8 = cr.itv;; 284 br.ret.dpnt b0;; 285.endp AsmReadItv 286 287//--------------------------------------------------------------------------------- 288//++ 289// AsmWriteItv 290// 291// This routine is used to write the value to Interval Timer Vector Register (ITV). 292// 293// Arguments : 294// 295// On Entry : The value need to be written to ITV 296// 297// Return Value: The value written to ITV. 298// 299//-- 300//---------------------------------------------------------------------------------- 301.text 302.type AsmWriteItv, @function 303.proc AsmWriteItv 304.regstk 1, 0, 0, 0 305 306AsmWriteItv:: 307 mov cr.itv = in0 308 mov r8 = in0;; 309 srlz.d;; 310 br.ret.dpnt b0;; 311.endp AsmWriteItv 312 313 314//--------------------------------------------------------------------------------- 315//++ 316// AsmReadPmv 317// 318// This routine is used to Read the value of Performance Monitoring Vector Register (PMV). 319// 320// Arguments : 321// 322// On Entry : 323// 324// Return Value: The current value of PMV. 325// 326//-- 327//---------------------------------------------------------------------------------- 328.text 329.type AsmReadPmv, @function 330.proc AsmReadPmv 331 332AsmReadPmv:: 333 mov r8 = cr.pmv;; 334 br.ret.dpnt b0;; 335.endp AsmReadPmv 336 337//--------------------------------------------------------------------------------- 338//++ 339// AsmWritePmv 340// 341// This routine is used to write the value to Performance Monitoring Vector Register (PMV). 342// 343// Arguments : 344// 345// On Entry : The value need to be written to PMV 346// 347// Return Value: The value written to PMV. 348// 349//-- 350//---------------------------------------------------------------------------------- 351.text 352.type AsmWritePmv, @function 353.proc AsmWritePmv 354.regstk 1, 0, 0, 0 355 356AsmWritePmv:: 357 mov cr.pmv = in0 358 mov r8 = in0;; 359 srlz.d;; 360 br.ret.dpnt b0;; 361.endp AsmWritePmv 362 363 364//--------------------------------------------------------------------------------- 365//++ 366// AsmReadCmcv 367// 368// This routine is used to Read the value of Corrected Machine Check Vector Register (CMCV). 369// 370// Arguments : 371// 372// On Entry : 373// 374// Return Value: The current value of CMCV. 375// 376//-- 377//---------------------------------------------------------------------------------- 378.text 379.type AsmReadCmcv, @function 380.proc AsmReadCmcv 381 382AsmReadCmcv:: 383 mov r8 = cr.cmcv;; 384 br.ret.dpnt b0;; 385.endp AsmReadCmcv 386 387//--------------------------------------------------------------------------------- 388//++ 389// AsmWriteCmcv 390// 391// This routine is used to write the value to Corrected Machine Check Vector Register (CMCV). 392// 393// Arguments : 394// 395// On Entry : The value need to be written to CMCV 396// 397// Return Value: The value written to CMCV. 398// 399//-- 400//---------------------------------------------------------------------------------- 401.text 402.type AsmWriteCmcv, @function 403.proc AsmWriteCmcv 404.regstk 1, 0, 0, 0 405 406AsmWriteCmcv:: 407 mov cr.cmcv = in0 408 mov r8 = in0;; 409 srlz.d;; 410 br.ret.dpnt b0;; 411.endp AsmWriteCmcv 412 413 414//--------------------------------------------------------------------------------- 415//++ 416// AsmReadLrr0 417// 418// This routine is used to read the value of Local Redirection Register 0 (LRR0). 419// 420// Arguments : 421// 422// On Entry : 423// 424// Return Value: The current value of LRR0. 425// 426//-- 427//---------------------------------------------------------------------------------- 428.text 429.type AsmReadLrr0, @function 430.proc AsmReadLrr0 431 432AsmReadLrr0:: 433 mov r8 = cr.lrr0;; 434 br.ret.dpnt b0;; 435.endp AsmReadLrr0 436 437//--------------------------------------------------------------------------------- 438//++ 439// AsmWriteLrr0 440// 441// This routine is used to write the value to Local Redirection Register 0 (LRR0). 442// 443// Arguments : 444// 445// On Entry : The value need to be written to LRR0. 446// 447// Return Value: The value written to LRR0. 448// 449//-- 450//---------------------------------------------------------------------------------- 451.text 452.type AsmWriteLrr0, @function 453.proc AsmWriteLrr0 454.regstk 1, 0, 0, 0 455 456AsmWriteLrr0:: 457 mov cr.lrr0 = in0 458 mov r8 = in0;; 459 srlz.d;; 460 br.ret.dpnt b0;; 461.endp AsmWriteLrr0 462 463 464//--------------------------------------------------------------------------------- 465//++ 466// AsmReadLrr1 467// 468// This routine is used to read the value of Local Redirection Register 1 (LRR1). 469// 470// Arguments : 471// 472// On Entry : 473// 474// Return Value: The current value of LRR1. 475// 476//-- 477//---------------------------------------------------------------------------------- 478.text 479.type AsmReadLrr1, @function 480.proc AsmReadLrr1 481 482AsmReadLrr1:: 483 mov r8 = cr.lrr1;; 484 br.ret.dpnt b0;; 485.endp AsmReadLrr1 486 487//--------------------------------------------------------------------------------- 488//++ 489// AsmWriteLrr1 490// 491// This routine is used to write the value to Local Redirection Register 1 (LRR1). 492// 493// Arguments : 494// 495// On Entry : The value need to be written to LRR1. 496// 497// Return Value: The value written to LRR1. 498// 499//-- 500//---------------------------------------------------------------------------------- 501.text 502.type AsmWriteLrr1, @function 503.proc AsmWriteLrr1 504.regstk 1, 0, 0, 0 505 506AsmWriteLrr1:: 507 mov cr.lrr1 = in0 508 mov r8 = in0;; 509 srlz.d;; 510 br.ret.dpnt b0;; 511.endp AsmWriteLrr1 512 513