]> git.saurik.com Git - apple/xnu.git/blame - osfmk/ppc/commpage/mach_absolute_time.s
xnu-517.7.7.tar.gz
[apple/xnu.git] / osfmk / ppc / commpage / mach_absolute_time.s
CommitLineData
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
31 .globl EXT(mach_absolute_time_32)
32 .globl EXT(mach_absolute_time_64)
33
34
35// *********************************************
36// * M A C H _ A B S O L U T E _ T I M E _ 3 2 *
37// *********************************************
38
39mach_absolute_time_32:
401:
41 mftbu r3
42 mftb r4
43 mftbu r5
44 cmplw r3,r5
45 beqlr+
46 b 1b
47
48 COMMPAGE_DESCRIPTOR(mach_absolute_time_32,_COMM_PAGE_ABSOLUTE_TIME,0,k64Bit,0)
49
50
51// *********************************************
52// * M A C H _ A B S O L U T E _ T I M E _ 6 4 *
53// *********************************************
54//
55// Why bother to special case for 64-bit? Because the "mftb" variants
56// are 10 cycles each, and they are serialized.
57
58mach_absolute_time_64:
59 mftb r4
60 srdi r3,r4,32
61 blr
62
63 COMMPAGE_DESCRIPTOR(mach_absolute_time_64,_COMM_PAGE_ABSOLUTE_TIME,k64Bit,0,0)
64
65