1/* 2** Copyright 2003, Axel D�fler, axeld@pinc-software.de. All rights reserved. 3** Distributed under the terms of the MIT License. 4*/ 5 6#define FUNCTION(x) .global x; .type x,@function; x 7 8.text 9 10/* int64 __ppc_get_time_base(void) 11 * r3/r4 12 */ 13FUNCTION(__ppc_get_time_base): 14 /* get TB (time base) register */ 15carry: mftbu %r3 16 mftb %r4 17 mftbu %r5 // read the upper half again 18 cmpw %r3, %r5 // and check if the values have changed 19 bne carry // try again, if they had 20 blr 21 22