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