The real, definitive, Visual C++ support branch. Accept no substitutes
[reactos.git] / lib / pseh / powerpc / framebased.S
1 // Copyright (c) 2004/2005 KJK::Hyperion
2
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to dos so, subject to the following conditions:
9
10 // The above copyright notice and this permission notice shall be included in all
11 // copies or substantial portions of the Software.
12
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 // SOFTWARE.
20
21 .text
22
23 .globl _SEHCleanHandlerEnvironment
24 _SEHCleanHandlerEnvironment:
25 blr
26
27 .globl _SEHCurrentRegistration
28 _SEHCurrentRegistration:
29 lwz 3,0(13)
30 blr
31
32 // R3: Frame to store in
33 .globl _SEHRegisterFrame
34 _SEHRegisterFrame:
35 lwz 4,0(13)
36 stw 3,0(13)
37 stw 4,0(3)
38 blr
39
40 .globl _SEHUnregisterFrame
41 _SEHUnregisterFrame:
42 lwz 3,0(13)
43 lwz 3,0(3)
44 stw 3,0(13)
45 blr
46
47 .globl _SEHGlobalUnwind
48 _SEHGlobalUnwind:
49
50 .extern _SEHRtlUnwind
51
52 // RtlUnwind clobbers all the "don't clobber" registers, so we save them
53 lwz 3,4(1)
54 stwu 1,-132(1)
55 stmw 2,-128(1)
56
57 xor 6,6,6
58 xor 5,5,5
59 lis 4,.RestoreRegisters@ha
60 addi 4,4,.RestoreRegisters@l # Where to jump back to
61 # We already have r3
62 bl _SEHRtlUnwind
63
64 .RestoreRegisters:
65 lmw 2,-128(1)
66 addi 1,1,132
67 blr
68
69 // EOF