romutil.py (5903:3d7f94358641) romutil.py (5911:8d6e40f38063)
1# Copyright (c) 2008 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 110 unchanged lines hidden (view full) ---

119 ##
120 ## Point of no return.
121 ## We're now going to irrevocably modify visible state.
122 ## Anything bad that's going to happen should have happened by now or will
123 ## happen right now.
124 ##
125 wrip t0, t9, dataSize=8
126
1# Copyright (c) 2008 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 110 unchanged lines hidden (view full) ---

119 ##
120 ## Point of no return.
121 ## We're now going to irrevocably modify visible state.
122 ## Anything bad that's going to happen should have happened by now or will
123 ## happen right now.
124 ##
125 wrip t0, t9, dataSize=8
126
127 #
128 # Set up the target code segment. Do this now so we have the right
129 # permissions when setting up the stack frame.
130 #
131 srli t5, t4, 16, dataSize=8
132 andi t5, t5, 0xFF, dataSize=8
133 wrdl cs, t3, t5, dataSize=8
134 # Tuck away the old CS for use below
135 limm t10, 0, dataSize=8
136 rdsel t10, cs, dataSize=2
137 wrsel cs, t5, dataSize=2
127
138
139
128 #
129 # Build up the interrupt stack frame
130 #
131
132
133 # Write out the contents of memory
134 %(errorCodeCode)s
135 st t7, hs, [1, t0, t6], %(errorCodeSize)d, dataSize=8, addressSize=8
140 #
141 # Build up the interrupt stack frame
142 #
143
144
145 # Write out the contents of memory
146 %(errorCodeCode)s
147 st t7, hs, [1, t0, t6], %(errorCodeSize)d, dataSize=8, addressSize=8
136 limm t5, 0, dataSize=8
137 rdsel t5, cs, dataSize=2
138 st t5, hs, [1, t0, t6], 8 + %(errorCodeSize)d, dataSize=8, addressSize=8
148 st t10, hs, [1, t0, t6], 8 + %(errorCodeSize)d, dataSize=8, addressSize=8
139 rflags t10, dataSize=8
140 st t10, hs, [1, t0, t6], 16 + %(errorCodeSize)d, dataSize=8, addressSize=8
141 st rsp, hs, [1, t0, t6], 24 + %(errorCodeSize)d, dataSize=8, addressSize=8
142 rdsel t5, ss, dataSize=2
143 st t5, hs, [1, t0, t6], 32 + %(errorCodeSize)d, dataSize=8, addressSize=8
144
145 # Set the stack segment
146 mov rsp, rsp, t6, dataSize=8
147 wrsel ss, t11, dataSize=2
148
149 #
149 rflags t10, dataSize=8
150 st t10, hs, [1, t0, t6], 16 + %(errorCodeSize)d, dataSize=8, addressSize=8
151 st rsp, hs, [1, t0, t6], 24 + %(errorCodeSize)d, dataSize=8, addressSize=8
152 rdsel t5, ss, dataSize=2
153 st t5, hs, [1, t0, t6], 32 + %(errorCodeSize)d, dataSize=8, addressSize=8
154
155 # Set the stack segment
156 mov rsp, rsp, t6, dataSize=8
157 wrsel ss, t11, dataSize=2
158
159 #
150 # Set up the target code segment
151 #
152 srli t5, t4, 16, dataSize=8
153 andi t5, t5, 0xFF, dataSize=8
154 wrdl cs, t3, t5, dataSize=8
155 wrsel cs, t5, dataSize=2
156
157 #
158 # Adjust rflags which is still in t10 from above
159 #
160
161 # Set IF to the lowest bit of the original gate type.
162 # The type field of the original gate starts at bit 40.
163
164 # Set the TF, NT, and RF bits. We'll flip them at the end.
165 limm t6, (1 << 8) | (1 << 14) | (1 << 16)

--- 45 unchanged lines hidden ---
160 # Adjust rflags which is still in t10 from above
161 #
162
163 # Set IF to the lowest bit of the original gate type.
164 # The type field of the original gate starts at bit 40.
165
166 # Set the TF, NT, and RF bits. We'll flip them at the end.
167 limm t6, (1 << 8) | (1 << 14) | (1 << 16)

--- 45 unchanged lines hidden ---