]> git.saurik.com Git - apple/xnu.git/blob - libkern/c++/OSObjectAsm.s
52bab860efd28a3269a47092e031c30fcc716371
[apple/xnu.git] / libkern / c++ / OSObjectAsm.s
1 /*
2 * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25
26 #if __GNUC__ >= 3
27
28 ;
29 ; This function was generated by disassembling the 'OSObject::free(void)'
30 ; function of the Panther7B7 kernel in gdb.
31 ;
32 ; Then add the 'li r4,3' flag taken fropm the Puma kernel OSObject::free'
33 ;
34 .text
35
36 .align 5
37 .globl __ZN8OSObject4freeEv
38
39 __ZN8OSObject4freeEv:
40 ; function prologue
41 stw r31,-4(r1)
42 mflr r0
43 stw r0,8(r1)
44 mr r31,r3
45 stwu r1,-80(r1)
46
47 ; const OSMetaClass *meta = getMetaClass();
48 lwz r9,0(r3)
49 lwz r12,32(r9)
50 mtctr r12
51 bctrl
52
53 ; if (meta)
54 ; meta->instanceDestructed();
55 cmpwi r3,0
56 beq delete_this
57 bl __ZNK11OSMetaClass18instanceDestructedEv
58
59 delete_this:
60 ; delete this;
61 lwz r9,0(r31)
62 mr r3,r31
63 li r4,0 ; Load up some sort of flags, for 2.95 destructors?
64 lwz r0,88(r1)
65 addi r1,r1,80
66 lwz r12,8(r9)
67 mtlr r0
68 lwz r31,-4(r1)
69 mtctr r12
70 bctr
71
72 #endif /* __GNUC__ >= 3 */