time.c (177108) | time.c (182723) |
---|---|
1/*- 2 * Copyright (c) 2000 Benno Rice 3 * Copyright (c) 2007 Semihalf, Rafal Jaworowski <raj@semihalf.com> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2000 Benno Rice 3 * Copyright (c) 2007 Semihalf, Rafal Jaworowski <raj@semihalf.com> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/boot/uboot/lib/time.c 177108 2008-03-12 16:01:34Z raj $"); | 29__FBSDID("$FreeBSD: head/sys/boot/uboot/lib/time.c 182723 2008-09-03 15:39:50Z raj $"); |
30 31#include <stand.h> 32 | 30 31#include <stand.h> 32 |
33#include "glue.h" 34 |
|
33/* 34 * Return the time in seconds since the beginning of the day. 35 */ 36time_t 37time(time_t *tloc) 38{ 39 int secs; 40 41 secs = ub_get_timer(0) / 1000; 42 if (tloc) 43 *tloc = secs; 44 | 35/* 36 * Return the time in seconds since the beginning of the day. 37 */ 38time_t 39time(time_t *tloc) 40{ 41 int secs; 42 43 secs = ub_get_timer(0) / 1000; 44 if (tloc) 45 *tloc = secs; 46 |
45 return secs; | 47 return (secs); |
46} 47 48int 49getsecs() 50{ 51 52 return (time(NULL)); 53} 54 55/* 56 * Use U-Boot udelay() function to wait for a given microseconds period 57 */ 58void 59delay(int usecs) 60{ 61 62 ub_udelay(usecs); 63} | 48} 49 50int 51getsecs() 52{ 53 54 return (time(NULL)); 55} 56 57/* 58 * Use U-Boot udelay() function to wait for a given microseconds period 59 */ 60void 61delay(int usecs) 62{ 63 64 ub_udelay(usecs); 65} |