]>
Commit | Line | Data |
---|---|---|
55e303ae A |
1 | /* |
2 | * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
e5568f75 A |
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. | |
55e303ae | 11 | * |
e5568f75 A |
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 | |
55e303ae A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
e5568f75 A |
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. | |
55e303ae A |
19 | * |
20 | * @APPLE_LICENSE_HEADER_END@ | |
21 | */ | |
22 | ||
23 | #define ASSEMBLER | |
24 | #include <sys/appleapiopts.h> | |
25 | #include <ppc/asm.h> // EXT, LEXT | |
26 | #include <machine/cpu_capabilities.h> | |
27 | #include <machine/commpage.h> | |
28 | ||
29 | .text | |
30 | .align 2 | |
55e303ae A |
31 | |
32 | ||
33 | // ********************************************* | |
34 | // * M A C H _ A B S O L U T E _ T I M E _ 3 2 * | |
35 | // ********************************************* | |
36 | ||
37 | mach_absolute_time_32: | |
38 | 1: | |
39 | mftbu r3 | |
40 | mftb r4 | |
41 | mftbu r5 | |
42 | cmplw r3,r5 | |
43 | beqlr+ | |
44 | b 1b | |
45 | ||
91447636 | 46 | COMMPAGE_DESCRIPTOR(mach_absolute_time_32,_COMM_PAGE_ABSOLUTE_TIME,0,k64Bit,kCommPage32) |
55e303ae A |
47 | |
48 | ||
49 | // ********************************************* | |
50 | // * M A C H _ A B S O L U T E _ T I M E _ 6 4 * | |
51 | // ********************************************* | |
52 | // | |
91447636 | 53 | // This is the version that is called in 32-bit mode, so we return the TBR in r3 and r4. |
55e303ae A |
54 | |
55 | mach_absolute_time_64: | |
56 | mftb r4 | |
57 | srdi r3,r4,32 | |
58 | blr | |
59 | ||
91447636 A |
60 | COMMPAGE_DESCRIPTOR(mach_absolute_time_64,_COMM_PAGE_ABSOLUTE_TIME,k64Bit,0,kCommPage32) |
61 | ||
62 | ||
63 | // ************************************************* | |
64 | // * M A C H _ A B S O L U T E _ T I M E _ L P 6 4 * | |
65 | // ************************************************* | |
66 | // | |
67 | // This is the version that is called in 64-bit mode, so we return the TBR in r3. | |
68 | ||
69 | mach_absolute_time_lp64: | |
70 | mftb r3 | |
71 | blr | |
72 | ||
73 | COMMPAGE_DESCRIPTOR(mach_absolute_time_lp64,_COMM_PAGE_ABSOLUTE_TIME,k64Bit,0,kCommPage64) | |
55e303ae A |
74 | |
75 |