2 // Copyright (c) 1996-99 Intel Corp.
11 // Contains an implementation for making PAL PROC calls on
12 // IA-64 architecture.
25 //-----------------------------------------------------------------------------
29 // This routine is called whenever an architected static calling convention
30 // based PAL call is to be made. This call does use RSE actually, but our policy
31 // in making static PAL calls before memory is available is to make sure that
32 // we do not nest too deep and allocate beyond 96 banked registers. In other
33 // words we carefully code calls and control flow before memory is available.
35 // Arguments : All parameters set up to do static PAL call.
41 // As per static calling conventions.
44 //---------------------------------------------------------------------------
45 PROCEDURE_ENTRY(MakeStaticPALCall)
47 NESTED_SETUP (5,8,0,0)
52 movl loc6 = PAL_MC_CLEAR_LOG
56 cmp.eq p6,p7 = r28,loc6;;
57 (p7)movl loc6 = PAL_MC_DYNAMIC_STATE;;
58 (p7)cmp.eq p6,p7 = r28,loc6;;
60 (p7)movl loc6 = PAL_MC_ERROR_INFO;;
61 (p7)cmp.eq p6,p7 = r28,loc6;;
63 (p7)movl loc6 = PAL_MC_RESUME;;
64 (p7)cmp.eq p6,p7 = r28,loc6
67 (p7)dep r2 = loc6,r2,13,1;; // psr.ic = 1
69 // p6 will be true, if it is one of the MCHK calls. There has been lots of debate
70 // on psr.ic for these values. For now, do not do any thing to psr.ic
72 // (p6)dep r2 = r0,r2,13,1;; // psr.ic = 0
73 dep r2 = r0,r2,14,1;; // psr.i = 0
76 srlz.d;; // Needs data serailization.
77 srlz.i;; // Needs instruction serailization.
81 add loc2 = StaticComeBackFromPALCall - StaticGetPALLocalIP,loc2;;
82 mov b0 = loc2 // return address after Pal call
83 mov r28 = in1 // get the input parameters to PAL call
87 mov b5 = in0;; // get the PalProcEntrypt from input
88 br.sptk b5 // Take the plunge.
90 StaticComeBackFromPALCall:
93 srlz.d;; // Needs data serailization.
94 srlz.i;; // Needs instruction serailization.
102 PROCEDURE_EXIT(MakeStaticPALCall)
105 //-----------------------------------------------------------------------------
107 // MakeStackedPALCall
109 // This routine is called whenever an architected stacked calling convention
110 // based PAL call is to be made. This call is made after memory is available.
111 // Although stacked calls could be made directly from 'C', there is a PAL
112 // requirement which forces the index to be in GR28 and hence this stub is
115 // Arguments : All parameters set up to do stacted PAL call.
118 // in0: PAL_PROC entrypoint
119 // in1-in4 : PAL_PROC arguments
123 // As per stacked calling conventions.
126 //---------------------------------------------------------------------------
127 PROCEDURE_ENTRY(MakeStackedPALCall)
129 NESTED_SETUP (5,8,4,0)
135 dep r2 = r0,r2,14,1;; // psr.i = 0
137 srlz.d;; // Needs data serailization.
138 srlz.i;; // Needs instruction serailization.
140 StackedGetPALLocalIP:
141 mov r28 = in1 // get the input parameters to PAL call
146 mov b5 = in0;; // get the PalProcEntrypt from input
147 br.call.dpnt b0=b5;; // Take the plunge.
149 StackedComeBackFromPALCall:
152 srlz.d;; // Needs data serailization.
153 srlz.i;; // Needs instruction serailization.
160 PROCEDURE_EXIT(MakeStackedPALCall)