aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/ssw3i6.asm75
1 files changed, 68 insertions, 7 deletions
diff --git a/mps/code/ssw3i6.asm b/mps/code/ssw3i6.asm
index a81828c285b..4589147758f 100644
--- a/mps/code/ssw3i6.asm
+++ b/mps/code/ssw3i6.asm
@@ -1,11 +1,27 @@
1; @@@@ FIXME: W3I6MV add copyright and license 1; ssw3i6.asm : WIN32/x64 STACK SCANNER
2;
2; $Id$ 3; $Id$
4; Copyright (c) 2012 Ravenbrook Limited. See end of file for license.
5; Portions copyright (C) 2002 Global Graphics Software.
6
7; For register usage see
8; MSDN -> x64 Software Conventions -> Register Usage
9; <http://msdn.microsoft.com/en-us/library/9z1stfyw>
3 10
4.CODE 11.CODE
5EXTERN TraceScanArea : PROC 12EXTERN TraceScanArea : PROC
6 13
7StackScan PROC FRAME 14StackScan PROC FRAME
8 15 ; Prolog follows. See
16 ; MSDN -> x64 Software Conventions -> Prolog and Epilog
17 ; <http://msdn.microsoft.com/en-us/library/tawsa7cb>
18 ; Also see
19 ; MSDN -> Microsoft Macro Assembler Reference -> Directives Reference
20 ; <http://msdn.microsoft.com/en-us/library/8t163bt0>
21 ; for the use of .pushreg and other directives.
22 ; Push the callee-save registers.
23 ; Stack must be 16-byte aligned; the return address is on top of the stack;
24 ; after pushing another register it will be 16-byte aligned again.
9 push rdi 25 push rdi
10.pushreg rdi 26.pushreg rdi
11 27
@@ -26,15 +42,20 @@ StackScan PROC FRAME
26 42
27 push r15 43 push r15
28.pushreg r15 44.pushreg r15
29 45 ; An odd number of qwords have been pushed on the stack (including the
46 ; return address) so we need to subtract an extra 8 bytes on top of the
47 ; 4 qwords we need for to reserve for the register parameter stack area.
48 ; See
49 ; MSDN -> x64 Software Conventions -> Stack Usage -> Stack Allocation
50 ; <http://msdn.microsoft.com/en-us/library/ew5tede7>
30 sub rsp, 40 51 sub rsp, 40
31.allocstack 40 52.allocstack 40
32.endprolog 53.endprolog
33 54 ; for convenience set up arguments in reverse order.
34 mov r8, rdx ; stackBot 55 mov r8, rdx ; stackBot
35 mov rdx, rsp ; top of stack 56 mov rdx, rsp ; top of stack
36 add rdx, 40 ; where last callee saved register stored 57 add rdx, 40 ; where last callee-save register stored
37 ; mov rcx, rcx ; ss 58 ; mov rcx, rcx ; ss already in the right register.
38 call TraceScanArea 59 call TraceScanArea
39 add rsp, 40 60 add rsp, 40
40 pop r15 ; pop the callee-save registers 61 pop r15 ; pop the callee-save registers
@@ -49,4 +70,44 @@ StackScan PROC FRAME
49 70
50StackScan ENDP 71StackScan ENDP
51 72
52END \ No newline at end of file 73END
74; C. COPYRIGHT AND LICENSE
75;
76; Copyright (C) 2001-2012 Ravenbrook Limited <http://www.ravenbrook.com/>.
77; All rights reserved. This is an open source license. Contact
78; Ravenbrook for commercial licensing options.
79;
80; Redistribution and use in source and binary forms, with or without
81; modification, are permitted provided that the following conditions are
82; met:
83;
84; 1. Redistributions of source code must retain the above copyright
85; notice, this list of conditions and the following disclaimer.
86;
87; 2. Redistributions in binary form must reproduce the above copyright
88; notice, this list of conditions and the following disclaimer in the
89; documentation and/or other materials provided with the distribution.
90;
91; 3. Redistributions in any form must be accompanied by information on how
92; to obtain complete source code for this software and any accompanying
93; software that uses this software. The source code must either be
94; included in the distribution or be available for no more than the cost
95; of distribution plus a nominal fee, and must be freely redistributable
96; under reasonable conditions. For an executable file, complete source
97; code means the source code for all modules it contains. It does not
98; include source code for modules or files that typically accompany the
99; major components of the operating system on which the executable file
100; runs.
101;
102; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
103; IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
104; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
105; PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE
106; COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
107; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
108; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
109; USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
110; ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
111; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
112; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
113