1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Applied patch to fix failure with build on gcc-powerpc (provide sqlite3Hwtime). Ticket #3256. (CVS 5516)

FossilOrigin-Name: c9ecd88e273aee56b4af5b69fae94e1f98d3e43d
This commit is contained in:
shane
2008-08-01 14:33:15 +00:00
parent d300b8a30b
commit 5cd89cfe71
3 changed files with 24 additions and 9 deletions

View File

@@ -13,7 +13,7 @@
** This file contains inline asm code for retrieving "high-performance"
** counters for x86 class CPUs.
**
** $Id: hwtime.h,v 1.2 2008/06/12 02:24:39 shane Exp $
** $Id: hwtime.h,v 1.3 2008/08/01 14:33:15 shane Exp $
*/
#ifndef _HWTIME_H_
#define _HWTIME_H_
@@ -54,6 +54,21 @@
return val;
}
#elif (defined(__GNUC__) && defined(__ppc__))
__inline__ sqlite_uint64 sqlite3Hwtime(void){
unsigned long long retval;
unsigned long junk;
__asm__ __volatile__ ("\n\
1: mftbu %1\n\
mftb %L0\n\
mftbu %0\n\
cmpw %0,%1\n\
bne 1b"
: "=r" (retval), "=r" (junk));
return retval;
}
#else
#error Need implementation of sqlite3Hwtime() for your platform.