]> git.saurik.com Git - apple/xnu.git/blame - iokit/Kernel/ppc/IOAsmSupport.s
xnu-344.tar.gz
[apple/xnu.git] / iokit / Kernel / ppc / IOAsmSupport.s
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 1998-2000 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 * Copyright (c) 1997-1998 Apple Computer, Inc.
24 *
25 *
26 * HISTORY
27 *
28 * sdouglas 22 Oct 97 - first checked in from DriverServices
29 * sdouglas 28 Jul 98 - start IOKit
30 */
31
32#include <architecture/ppc/asm_help.h>
33
34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
35;
36; ENTRY functionName
37;
38; Assembly directives to begin an exported function.
39;
40; Takes: functionName - name of the exported function
41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
42
43.macro ENTRY
44 .text
45 .align 2
46 .globl $0
47$0:
48.endmacro
49
50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
51
52/*
53
54OSStatus SynchronizeIO( void )
55
56*/
57
58 ENTRY __eSynchronizeIO
59
60 li r0, 0
61 eieio
62 li r3, 0
63 blr
64
65/*
66
67OSStatus CallTVector_NoRecover(
68 void * p1, void * p2, void * p3, void * p4, void * p5, void * p6, // r3-8
69 LogicalAddress entry ) // r9
70
71*/
72
73#define PARAM_SIZE 24
74#define FM_SIZE 64
75#define FM_LR_SAVE 8
76#define FM_TOC_SAVE 20
77
78 ENTRY _CallTVector
79
80#if 1
81 stw r2, FM_TOC_SAVE(r1)
9bccf70c 82 lwz r0, 0(r9)
1c79356b
A
83 lwz r2, 4(r9)
84 mtspr ctr, r0
85 bctr
86
87#else
88 mflr r0
89 stw r0, FM_LR_SAVE(r1)
90 stw r2, FM_TOC_SAVE(r1)
91
92 stwu r1, -(PARAM_SIZE+FM_SIZE)(r1)
93
94 lwz r2, 4(r9)
95 lwz r0, 0(r9)
96 mtspr lr, r0
97 mfspr r12, lr
98 blrl
99
100 addi r1, r1,(PARAM_SIZE+FM_SIZE)
101 lwz r2, FM_TOC_SAVE(r1)
102 lwz r0, FM_LR_SAVE(r1)
103 mtlr r0
104 blr
105#endif
106
107/*
108 * Seemingly unused references from cpp statically initialized objects.
109 */
110
111.globl .constructors_used
112.constructors_used = 0
113.globl .destructors_used
114.destructors_used = 0