mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 20:44:39 +08:00
!compiler: drop CONFIG_HAVE_LONG_LONG and require long long support
Every compiler supported by NuttX provides the "long long" types,
so the CONFIG_HAVE_LONG_LONG indirection is no longer useful.
Remove the option from include/nuttx/compiler.h and treat
"long long" as unconditionally available across the OS.
In addition to deleting the guard itself, this commit unconditionally
enables the long-long flavored helpers that used to be gated behind
it:
- libs/libc/fixedmath: drop the soft-emulated b32/ub32 routines
in lib_fixedmath.c (-261 lines) and trim the matching
prototypes, Make.defs and CMakeLists.txt entries; keep only
the long-long backed implementations.
- include/sys/endian.h, include/strings.h, libs/libc/string
/lib_ffsll.c, lib_flsll.c: always expose the 64-bit byte-swap
and ffsll/flsll variants.
- libs/libm/libm/lib_llround{,f,l}.c: drop the empty stubs.
- libs/libc/stdlib (atoll, llabs, lldiv, strtoll/ull, rand48,
strtold), libs/libc/stream (libvsprintf, libvscanf,
libbsprintf, ultoa_invert), libs/libc/misc (crc64, crc64emac),
libs/libc/inttypes/strtoimax, libs/libc/lzf, libs/libc/libc.csv,
libs/libc/string (memset, vikmemcpy): remove the
#ifdef CONFIG_HAVE_LONG_LONG branches.
- include/{stddef.h,stdlib.h,fixedmath.h,sys/epoll.h,cxx/cstdlib,
nuttx/audio/audio.h,nuttx/crc64.h,nuttx/lib/math.h,
nuttx/lib/math32.h,nuttx/lib/stdbit.h}: same guard cleanup.
- drivers/note/note_driver.c, fs/spiffs/src/spiffs.h,
sched/irq/irq_procfs.c: drop their local guards as well.
- Documentation/applications/netutils/ntpclient/index.rst:
refresh the documentation snippet.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
@@ -167,7 +167,6 @@ The NTP client requires:
|
||||
- **CONFIG_NET_UDP**: UDP protocol support
|
||||
- **CONFIG_NET_SOCKOPTS**: Socket options support
|
||||
- **CONFIG_LIBC_NETDB**: DNS resolution (recommended)
|
||||
- **CONFIG_HAVE_LONG_LONG**: 64-bit integer support
|
||||
|
||||
For best results, ensure:
|
||||
- Stable network connectivity
|
||||
|
||||
@@ -1568,9 +1568,7 @@ void sched_note_vprintf_ip(uint32_t tag, uintptr_t ip, FAR const char *fmt,
|
||||
{
|
||||
int i;
|
||||
long l;
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
long long ll;
|
||||
#endif
|
||||
intmax_t im;
|
||||
size_t sz;
|
||||
ptrdiff_t ptr;
|
||||
@@ -1679,7 +1677,6 @@ void sched_note_vprintf_ip(uint32_t tag, uintptr_t ip, FAR const char *fmt,
|
||||
var->im = va_arg(*va, intmax_t);
|
||||
next += sizeof(var->im);
|
||||
}
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
else if (*(p - 2) == 'l' && *(p - 3) == 'l')
|
||||
{
|
||||
if (next + sizeof(var->ll) > length)
|
||||
@@ -1690,7 +1687,6 @@ void sched_note_vprintf_ip(uint32_t tag, uintptr_t ip, FAR const char *fmt,
|
||||
var->ll = va_arg(*va, long long);
|
||||
next += sizeof(var->ll);
|
||||
}
|
||||
#endif
|
||||
else if (*(p - 2) == 'l')
|
||||
{
|
||||
if (next + sizeof(var->l) > length)
|
||||
|
||||
@@ -122,11 +122,7 @@ struct spiffs_s
|
||||
FAR uint8_t *work; /* Secondary work buffer, size of a logical page */
|
||||
FAR uint8_t *mtd_work; /* MTD I/O buffer for read-modify-write */
|
||||
FAR void *cache; /* Cache memory */
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
off64_t media_size; /* Physical size of the SPI flash */
|
||||
#else
|
||||
off_t media_size; /* Physical size of the SPI flash */
|
||||
#endif
|
||||
int free_entry; /* Cursor for free blocks, entry index */
|
||||
int lu_entry; /* Cursor when searching, entry index */
|
||||
uint32_t total_pages; /* Total number of pages on the media */
|
||||
|
||||
@@ -72,10 +72,8 @@ namespace std
|
||||
using ::atol;
|
||||
using ::strtol;
|
||||
using ::strtoul;
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
using ::strtoll;
|
||||
using ::strtoull;
|
||||
#endif
|
||||
using ::strtof;
|
||||
#ifdef CONFIG_HAVE_DOUBLE
|
||||
using ::strtod;
|
||||
@@ -114,15 +112,11 @@ namespace std
|
||||
|
||||
using ::abs;
|
||||
using ::labs;
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
using ::llabs;
|
||||
#endif
|
||||
|
||||
using ::div;
|
||||
using ::ldiv;
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
using ::lldiv;
|
||||
#endif
|
||||
|
||||
// Temporary files
|
||||
|
||||
|
||||
+14
-43
@@ -94,15 +94,13 @@
|
||||
#define b16tob8(b) (b8_t)(((b)+0x0080)>>8)
|
||||
#define ub16toub8(b) (ub8_t)(((b)+0x0080)>>8)
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
# define b8tob32(b) (((b32_t)(b)) << 24)
|
||||
# define ub8toub32(b) (((ub32_t)(b)) << 24)
|
||||
# define b16tob32(b) (((b32_t)(b)) << 16)
|
||||
# define ub16toub32(b) (((ub32_t)(b)) << 16)
|
||||
# define b32tob16(b) (b16_t)(((b) + 0x0000000000008000)>>16)
|
||||
# define ub32toub16(b) (ub16_t)(((b) + 0x0000000000008000)>>16)
|
||||
# define b32tob8(b) (b8_t)(((b) + 0x0000000000000080)>>8)
|
||||
#endif
|
||||
#define b8tob32(b) (((b32_t)(b)) << 24)
|
||||
#define ub8toub32(b) (((ub32_t)(b)) << 24)
|
||||
#define b16tob32(b) (((b32_t)(b)) << 16)
|
||||
#define ub16toub32(b) (((ub32_t)(b)) << 16)
|
||||
#define b32tob16(b) (b16_t)(((b) + 0x0000000000008000)>>16)
|
||||
#define ub32toub16(b) (ub16_t)(((b) + 0x0000000000008000)>>16)
|
||||
#define b32tob8(b) (b8_t)(((b) + 0x0000000000000080)>>8)
|
||||
|
||||
/* 16-bit values with 8 bits of precision ***********************************/
|
||||
|
||||
@@ -168,32 +166,27 @@
|
||||
#define b16abs(b) ((b < 0) ? (-b) : (b)) /* Get the absolute value */
|
||||
#define b16sign(b) ((b > 0) ? (b16ONE) : (-b16ONE))
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
/* Multiplication operators */
|
||||
|
||||
# define b16mulb16(a,b) b32tob16((b32_t)(a)*(b32_t)(b))
|
||||
# define ub16mulub16(a,b) ub32toub16((ub32_t)(a)*(ub32_t)(b))
|
||||
#define b16mulb16(a,b) b32tob16((b32_t)(a)*(b32_t)(b))
|
||||
#define ub16mulub16(a,b) ub32toub16((ub32_t)(a)*(ub32_t)(b))
|
||||
|
||||
/* Square operators */
|
||||
|
||||
# define b16sqr(a) b16mulb16(a,a)
|
||||
# define ub16sqr(a) ub16mulub16(a,a)
|
||||
#define b16sqr(a) b16mulb16(a,a)
|
||||
#define ub16sqr(a) ub16mulub16(a,a)
|
||||
|
||||
/* Division operators */
|
||||
|
||||
# define b16divb16(a,b) (b16_t)(b16tob32(a)/(b32_t)(b))
|
||||
# define ub16divub16(a,b) (ub16_t)(ub16toub32(a)/(ub32_t)(b))
|
||||
#define b16divb16(a,b) (b16_t)(b16tob32(a)/(b32_t)(b))
|
||||
#define ub16divub16(a,b) (ub16_t)(ub16toub32(a)/(ub32_t)(b))
|
||||
|
||||
/* Square root operators */
|
||||
|
||||
# define ub16sqrtub16(a) ub32sqrtub16(ub16toub32(a))
|
||||
#else
|
||||
# define ub16sqrtub16(a) ub8toub16(ub16sqrtub8(a))
|
||||
#endif
|
||||
#define ub16sqrtub16(a) ub32sqrtub16(ub16toub32(a))
|
||||
|
||||
/* 64-bit values with 32 bits of precision **********************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
/* Conversions */
|
||||
|
||||
#define b32toi(a) ((a) >> 32) /* Conversion to integer */
|
||||
@@ -206,7 +199,6 @@
|
||||
#define b32frac(a) ((a) & 0x00000000ffffffff) /* Take fractional part */
|
||||
#define b32abs(b) ((b < 0) ? (-b) : (b)) /* Get the absolute value */
|
||||
#define b32sign(b) ((b > 0) ? (b32ONE) : (-b32ONE))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
@@ -216,10 +208,8 @@ typedef int16_t b8_t;
|
||||
typedef uint16_t ub8_t;
|
||||
typedef int32_t b16_t;
|
||||
typedef uint32_t ub16_t;
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
typedef int64_t b32_t;
|
||||
typedef uint64_t ub32_t;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
@@ -234,23 +224,6 @@ extern "C"
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
/* Multiplication operators */
|
||||
|
||||
b16_t b16mulb16(b16_t m1, b16_t m2);
|
||||
ub16_t ub16mulub16(ub16_t m1, ub16_t m2);
|
||||
|
||||
/* Square operators */
|
||||
|
||||
b16_t b16sqr(b16_t a);
|
||||
ub16_t ub16sqr(ub16_t a);
|
||||
|
||||
/* Division operators */
|
||||
|
||||
b16_t b16divb16(b16_t num, b16_t denom);
|
||||
ub16_t ub16divub16(ub16_t num, ub16_t denom);
|
||||
#endif
|
||||
|
||||
/* Trigonometric Functions */
|
||||
|
||||
b16_t b16sin(b16_t rad);
|
||||
@@ -259,9 +232,7 @@ b16_t b16atan2(b16_t y, b16_t x);
|
||||
|
||||
/* Square root operators */
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
ub16_t ub32sqrtub16(ub32_t a);
|
||||
#endif
|
||||
ub8_t ub16sqrtub8(ub16_t a);
|
||||
|
||||
#undef EXTERN
|
||||
|
||||
@@ -710,9 +710,7 @@ struct audio_caps_s
|
||||
uint8_t b[4];
|
||||
uint16_t hw[2];
|
||||
uint32_t w;
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
uint64_t qw;
|
||||
#endif
|
||||
} ac_controls;
|
||||
|
||||
/* Codec info */
|
||||
|
||||
@@ -77,14 +77,6 @@
|
||||
# define __HAVE_KERNEL_GLOBALS 1
|
||||
#endif
|
||||
|
||||
/* If CONFIG_SYSTEM_TIME64 is selected and the CPU supports long long types,
|
||||
* then a 64-bit system time will be used.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
# undef CONFIG_SYSTEM_TIME64
|
||||
#endif
|
||||
|
||||
/* The following are the bit fields of the clockid_t
|
||||
* bit 0~2: the clock type
|
||||
* CLOCK_REALTIME - 0
|
||||
|
||||
@@ -442,7 +442,6 @@
|
||||
|
||||
/* Define these here and allow specific architectures to override as needed */
|
||||
|
||||
# define CONFIG_HAVE_LONG_LONG 1
|
||||
# define CONFIG_HAVE_FLOAT 1
|
||||
# define CONFIG_HAVE_DOUBLE 1
|
||||
# define CONFIG_HAVE_LONG_DOUBLE 1
|
||||
@@ -814,7 +813,6 @@
|
||||
* double.
|
||||
*/
|
||||
|
||||
# define CONFIG_HAVE_LONG_LONG 1
|
||||
# define CONFIG_HAVE_FLOAT 1
|
||||
# undef CONFIG_HAVE_DOUBLE
|
||||
# undef CONFIG_HAVE_LONG_DOUBLE
|
||||
@@ -982,7 +980,6 @@
|
||||
* simply do not support long long or double.
|
||||
*/
|
||||
|
||||
# undef CONFIG_HAVE_LONG_LONG
|
||||
# define CONFIG_HAVE_FLOAT 1
|
||||
# undef CONFIG_HAVE_DOUBLE
|
||||
# undef CONFIG_HAVE_LONG_DOUBLE
|
||||
@@ -1106,7 +1103,6 @@
|
||||
|
||||
/* Define these here and allow specific architectures to override as needed */
|
||||
|
||||
# define CONFIG_HAVE_LONG_LONG 1
|
||||
# define CONFIG_HAVE_FLOAT 1
|
||||
# define CONFIG_HAVE_DOUBLE 1
|
||||
# define CONFIG_HAVE_LONG_DOUBLE 1
|
||||
@@ -1211,7 +1207,6 @@
|
||||
|
||||
/* Define these here and allow specific architectures to override as needed */
|
||||
|
||||
# define CONFIG_HAVE_LONG_LONG 1
|
||||
# define CONFIG_HAVE_FLOAT 1
|
||||
# define CONFIG_HAVE_DOUBLE 1
|
||||
# define CONFIG_HAVE_LONG_DOUBLE 1
|
||||
@@ -1379,7 +1374,6 @@
|
||||
# undef CONFIG_SMALL_MEMORY
|
||||
# undef CONFIG_LONG_IS_NOT_INT
|
||||
# undef CONFIG_PTR_IS_NOT_INT
|
||||
# undef CONFIG_HAVE_LONG_LONG
|
||||
# define CONFIG_HAVE_FLOAT 1
|
||||
# undef CONFIG_HAVE_DOUBLE
|
||||
# undef CONFIG_HAVE_LONG_DOUBLE
|
||||
@@ -1406,10 +1400,6 @@
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
# undef CONFIG_FS_LARGEFILE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DISABLE_FLOAT
|
||||
# undef CONFIG_HAVE_FLOAT
|
||||
# undef CONFIG_HAVE_DOUBLE
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
@@ -123,5 +121,4 @@ uint64_t crc64emac(FAR const uint8_t *src, size_t len);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_HAVE_LONG_LONG */
|
||||
#endif /* __INCLUDE_NUTTX_CRC64_H */
|
||||
|
||||
@@ -179,7 +179,6 @@ long int lround(double x);
|
||||
long int lroundl(long double x);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
long long int llroundf(float x);
|
||||
#ifdef CONFIG_HAVE_DOUBLE
|
||||
long long int llround (double x);
|
||||
@@ -187,7 +186,6 @@ long long int llround (double x);
|
||||
#ifdef CONFIG_HAVE_LONG_DOUBLE
|
||||
long long int llroundl(long double x);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
float rintf(float x); /* Not implemented */
|
||||
#ifdef CONFIG_HAVE_DOUBLE
|
||||
@@ -205,7 +203,6 @@ long int lrint(double x);
|
||||
long int lrintl(long double x);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
long long int llrintf(float x);
|
||||
#ifdef CONFIG_HAVE_DOUBLE
|
||||
long long int llrint(double x);
|
||||
@@ -213,7 +210,6 @@ long long int llrint(double x);
|
||||
#ifdef CONFIG_HAVE_LONG_DOUBLE
|
||||
long long int llrintl(long double x);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
float fabsf (float x);
|
||||
#ifdef CONFIG_HAVE_DOUBLE
|
||||
|
||||
@@ -196,7 +196,6 @@ extern "C"
|
||||
* (It is unfortunate that gcc doesn't perform all this internally.)
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
/* Default C implementation for umul64_const()
|
||||
*
|
||||
* Prototype: uint64_t umul64_const(uint64_t retval, uint64_t m,
|
||||
@@ -319,9 +318,7 @@ extern "C"
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_HAVE_LONG_LONG) && defined(CONFIG_HAVE_EXPRESSION_STATEMENT)
|
||||
#if defined(CONFIG_HAVE_EXPRESSION_STATEMENT)
|
||||
# define div64_const(n, base) \
|
||||
({ \
|
||||
uint64_t __n = (n); \
|
||||
|
||||
@@ -50,8 +50,7 @@
|
||||
# error "Generic stdbit requires CONFIG_HAVE_BUILTIN_CLZ, CTZ, POPCOUNT"
|
||||
# endif
|
||||
|
||||
# if defined(CONFIG_HAVE_LONG_LONG) && \
|
||||
!defined(CONFIG_HAVE_BUILTIN_POPCOUNTLL)
|
||||
# if !defined(CONFIG_HAVE_BUILTIN_POPCOUNTLL)
|
||||
# error "Generic stdbit 64-bit requires CONFIG_HAVE_BUILTIN_POPCOUNTLL"
|
||||
# endif
|
||||
|
||||
|
||||
@@ -72,11 +72,7 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
#if defined(CONFIG_HAVE_LONG_LONG)
|
||||
long long max_align_i;
|
||||
#else
|
||||
long max_align_i;
|
||||
#endif
|
||||
#if defined(CONFIG_HAVE_LONG_DOUBLE)
|
||||
long double max_align_f;
|
||||
#elif defined(CONFIG_HAVE_DOUBLE)
|
||||
|
||||
@@ -154,7 +154,6 @@ int rand_r(FAR unsigned int *seedp);
|
||||
void lcong48(FAR unsigned short int param[7]);
|
||||
FAR unsigned short int *seed48(FAR unsigned short int seed16v[3]);
|
||||
void srand48(long int seedval);
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
long int jrand48(FAR unsigned short int xsubi[3]);
|
||||
long int lrand48(void);
|
||||
long int mrand48(void);
|
||||
@@ -163,7 +162,6 @@ long int nrand48(FAR unsigned short int xsubi[3]);
|
||||
double drand48(void);
|
||||
double erand48(FAR unsigned short int xsubi[3]);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define srandom(s) srand(s)
|
||||
long random(void);
|
||||
@@ -209,11 +207,9 @@ FAR char *realpath(FAR const char *path, FAR char *resolved);
|
||||
|
||||
long strtol(FAR const char *nptr, FAR char **endptr, int base);
|
||||
unsigned long strtoul(FAR const char *nptr, FAR char **endptr, int base);
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
long long strtoll(FAR const char *nptr, FAR char **endptr, int base);
|
||||
unsigned long long strtoull(FAR const char *nptr, FAR char **endptr,
|
||||
int base);
|
||||
#endif
|
||||
float strtof(FAR const char *str, FAR char **endptr);
|
||||
#ifdef CONFIG_HAVE_DOUBLE
|
||||
double strtod(FAR const char *str, FAR char **endptr);
|
||||
@@ -224,9 +220,7 @@ long double strtold(FAR const char *str, FAR char **endptr);
|
||||
|
||||
int atoi(FAR const char *nptr);
|
||||
long atol(FAR const char *nptr);
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
long long atoll(FAR const char *nptr);
|
||||
#endif
|
||||
#ifdef CONFIG_HAVE_DOUBLE
|
||||
double atof(FAR const char *nptr);
|
||||
#endif
|
||||
@@ -273,15 +267,11 @@ int unlockpt(int fd);
|
||||
|
||||
int abs(int j);
|
||||
long int labs(long int j);
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
long long int llabs(long long int j);
|
||||
#endif
|
||||
|
||||
div_t div(int number, int denom);
|
||||
ldiv_t ldiv(long number, long denom);
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
lldiv_t lldiv(long long number, long long denom);
|
||||
#endif
|
||||
|
||||
/* Temporary files */
|
||||
|
||||
|
||||
+6
-12
@@ -92,16 +92,12 @@ int ffsl(long j);
|
||||
# define ffsl(j) (__builtin_ctzl(j) + 1)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
|
||||
int ffsll(long long j);
|
||||
|
||||
# ifdef CONFIG_HAVE_BUILTIN_FFSLL
|
||||
# define ffsll(j) __builtin_ffsll(j)
|
||||
# elif defined (CONFIG_HAVE_BUILTIN_CTZ)
|
||||
# define ffsll(j) (__builtin_ctzll(j) + 1)
|
||||
# endif
|
||||
|
||||
#ifdef CONFIG_HAVE_BUILTIN_FFSLL
|
||||
# define ffsll(j) __builtin_ffsll(j)
|
||||
#elif defined (CONFIG_HAVE_BUILTIN_CTZ)
|
||||
# define ffsll(j) (__builtin_ctzll(j) + 1)
|
||||
#endif
|
||||
|
||||
int fls(int j);
|
||||
@@ -118,10 +114,8 @@ int flsl(long j);
|
||||
|
||||
int flsll(long long j);
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
# ifdef CONFIG_HAVE_BUILTIN_CLZ
|
||||
# define flsll(j) ((8 * sizeof(long long)) - __builtin_clzll(j))
|
||||
# endif
|
||||
#ifdef CONFIG_HAVE_BUILTIN_CLZ
|
||||
# define flsll(j) ((8 * sizeof(long long)) - __builtin_clzll(j))
|
||||
#endif
|
||||
|
||||
unsigned int popcount(unsigned int j);
|
||||
|
||||
+26
-34
@@ -71,20 +71,18 @@
|
||||
((((uint32_t)(n)) & 0xff000000UL) >> 24))
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
# ifdef CONFIG_HAVE_BUILTIN_BSWAP64
|
||||
# define __swap_uint64(n) ((uint64_t)__builtin_bswap64(n))
|
||||
# else
|
||||
# define __swap_uint64(n) \
|
||||
(uint64_t)(((((uint64_t)(n)) & 0x00000000000000ffULL) << 56) | \
|
||||
((((uint64_t)(n)) & 0x000000000000ff00ULL) << 40) | \
|
||||
((((uint64_t)(n)) & 0x0000000000ff0000ULL) << 24) | \
|
||||
((((uint64_t)(n)) & 0x00000000ff000000ULL) << 8) | \
|
||||
((((uint64_t)(n)) & 0x000000ff00000000ULL) >> 8) | \
|
||||
((((uint64_t)(n)) & 0x0000ff0000000000ULL) >> 24) | \
|
||||
((((uint64_t)(n)) & 0x00ff000000000000ULL) >> 40) | \
|
||||
((((uint64_t)(n)) & 0xff00000000000000ULL) >> 56))
|
||||
# endif
|
||||
#ifdef CONFIG_HAVE_BUILTIN_BSWAP64
|
||||
# define __swap_uint64(n) ((uint64_t)__builtin_bswap64(n))
|
||||
#else
|
||||
# define __swap_uint64(n) \
|
||||
(uint64_t)(((((uint64_t)(n)) & 0x00000000000000ffULL) << 56) | \
|
||||
((((uint64_t)(n)) & 0x000000000000ff00ULL) << 40) | \
|
||||
((((uint64_t)(n)) & 0x0000000000ff0000ULL) << 24) | \
|
||||
((((uint64_t)(n)) & 0x00000000ff000000ULL) << 8) | \
|
||||
((((uint64_t)(n)) & 0x000000ff00000000ULL) >> 8) | \
|
||||
((((uint64_t)(n)) & 0x0000ff0000000000ULL) >> 24) | \
|
||||
((((uint64_t)(n)) & 0x00ff000000000000ULL) >> 40) | \
|
||||
((((uint64_t)(n)) & 0xff00000000000000ULL) >> 56))
|
||||
#endif
|
||||
|
||||
/* Endian-specific definitions */
|
||||
@@ -107,12 +105,10 @@
|
||||
# define be32toh(n) ((uint32_t)(n))
|
||||
# define le32toh(n) __swap_uint32(n)
|
||||
|
||||
# ifdef CONFIG_HAVE_LONG_LONG
|
||||
# define htobe64(n) ((uint64_t)(n))
|
||||
# define htole64(n) __swap_uint64(n)
|
||||
# define be64toh(n) ((uint64_t)(n))
|
||||
# define le64toh(n) __swap_uint64(n)
|
||||
# endif
|
||||
# define htobe64(n) ((uint64_t)(n))
|
||||
# define htole64(n) __swap_uint64(n)
|
||||
# define be64toh(n) ((uint64_t)(n))
|
||||
# define le64toh(n) __swap_uint64(n)
|
||||
|
||||
#else
|
||||
/* Little-endian byte order */
|
||||
@@ -132,12 +128,10 @@
|
||||
# define be32toh(n) __swap_uint32(n)
|
||||
# define le32toh(n) ((uint32_t)(n))
|
||||
|
||||
# ifdef CONFIG_HAVE_LONG_LONG
|
||||
# define htobe64(n) __swap_uint64(n)
|
||||
# define htole64(n) ((uint64_t)(n))
|
||||
# define be64toh(n) __swap_uint64(n)
|
||||
# define le64toh(n) ((uint64_t)(n))
|
||||
# endif
|
||||
# define htobe64(n) __swap_uint64(n)
|
||||
# define htole64(n) ((uint64_t)(n))
|
||||
# define be64toh(n) __swap_uint64(n)
|
||||
# define le64toh(n) ((uint64_t)(n))
|
||||
#endif
|
||||
|
||||
/* OpenBSD style */
|
||||
@@ -159,13 +153,11 @@
|
||||
#define lemtoh32(x) letoh32(*(FAR uint32_t *)(x))
|
||||
#define htolem32(x, v) (*(FAR uint32_t *)(x) = htole32(v))
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
# define betoh64 be64toh
|
||||
# define letoh64 le64toh
|
||||
# define bemtoh64(x) betoh64(*(FAR uint64_t *)(x))
|
||||
# define htobem64(x, v) (*(FAR uint64_t *)(x) = htobe64(v))
|
||||
# define lemtoh64(x) letoh64(*(FAR uint64_t *)(x))
|
||||
# define htolem64(x, v) (*(FAR uint64_t *)(x) = htole64(v))
|
||||
#endif
|
||||
#define betoh64 be64toh
|
||||
#define letoh64 le64toh
|
||||
#define bemtoh64(x) betoh64(*(FAR uint64_t *)(x))
|
||||
#define htobem64(x, v) (*(FAR uint64_t *)(x) = htobe64(v))
|
||||
#define lemtoh64(x) letoh64(*(FAR uint64_t *)(x))
|
||||
#define htolem64(x, v) (*(FAR uint64_t *)(x) = htole64(v))
|
||||
|
||||
#endif /* __INCLUDE_SYS_ENDIAN_H */
|
||||
|
||||
@@ -102,9 +102,7 @@ union epoll_data
|
||||
FAR void *ptr;
|
||||
int fd;
|
||||
uint32_t u32;
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
uint64_t u64;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef union epoll_data epoll_data_t;
|
||||
|
||||
@@ -20,5 +20,4 @@
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
target_sources(c PRIVATE lib_fixedmath.c lib_b16sin.c lib_b16cos.c
|
||||
lib_b16atan2.c lib_ubsqrt.c)
|
||||
target_sources(c PRIVATE lib_b16sin.c lib_b16cos.c lib_b16atan2.c lib_ubsqrt.c)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
# Add the fixed precision math C files to the build
|
||||
|
||||
CSRCS += lib_fixedmath.c lib_b16sin.c lib_b16cos.c lib_b16atan2.c
|
||||
CSRCS += lib_b16sin.c lib_b16cos.c lib_b16atan2.c
|
||||
CSRCS += lib_ubsqrt.c
|
||||
|
||||
# Add the fixed precision math directory to the build
|
||||
|
||||
@@ -1,261 +0,0 @@
|
||||
/****************************************************************************
|
||||
* libs/libc/fixedmath/lib_fixedmath.c
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <fixedmath.h>
|
||||
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: fixsign
|
||||
****************************************************************************/
|
||||
|
||||
static void fixsign(b16_t *parg1, b16_t *parg2, bool *pnegate)
|
||||
{
|
||||
bool negate = false;
|
||||
b16_t arg;
|
||||
|
||||
arg = *parg1;
|
||||
if (arg < 0)
|
||||
{
|
||||
*parg1 = -arg;
|
||||
negate = true;
|
||||
}
|
||||
|
||||
arg = *parg2;
|
||||
if (arg < 0)
|
||||
{
|
||||
*parg2 = -arg;
|
||||
negate ^= true;
|
||||
}
|
||||
|
||||
*pnegate = negate;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: adjustsign
|
||||
****************************************************************************/
|
||||
|
||||
static b16_t adjustsign(b16_t result, bool negate)
|
||||
{
|
||||
/* If the product is negative, then we overflowed */
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
if (result)
|
||||
{
|
||||
return b16MIN;
|
||||
}
|
||||
else
|
||||
{
|
||||
return b16MAX;
|
||||
}
|
||||
}
|
||||
|
||||
/* correct the sign of the result */
|
||||
|
||||
if (negate)
|
||||
{
|
||||
return -result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: b16mulb16
|
||||
****************************************************************************/
|
||||
|
||||
b16_t b16mulb16(b16_t m1, b16_t m2)
|
||||
{
|
||||
bool negate;
|
||||
b16_t product;
|
||||
|
||||
fixsign(&m1, &m2, &negate);
|
||||
product = (b16_t)ub16mulub16((ub16_t)m1, (ub16_t)m2);
|
||||
return adjustsign(product, negate);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: ub16mulub16
|
||||
****************************************************************************/
|
||||
|
||||
ub16_t ub16mulub16(ub16_t m1, ub16_t m2)
|
||||
{
|
||||
/* Let:
|
||||
*
|
||||
* m1 = m1i*2**16 + m1f (b16)
|
||||
* m2 = m2i*2**16 + m2f (b16)
|
||||
*
|
||||
* Then:
|
||||
*
|
||||
* m1*m2 = (m1i*m2i)*2**32 + (m1i*m2f + m2i*m1f)*2**16 + m1f*m2f (b32)
|
||||
* = (m1i*m2i)*2**16 + (m1i*m2f + m2i*m1f) + m1f*m2f*2**-16 (b16)
|
||||
* = a*2**16 + b + c*2**-16
|
||||
*/
|
||||
|
||||
uint32_t m1i = ((uint32_t)m1 >> 16);
|
||||
uint32_t m2i = ((uint32_t)m1 >> 16);
|
||||
uint32_t m1f = ((uint32_t)m1 & 0x0000ffff);
|
||||
uint32_t m2f = ((uint32_t)m2 & 0x0000ffff);
|
||||
|
||||
return (m1i*m2i << 16) + m1i*m2f + m2i*m1f + (((m1f*m2f) + b16HALF) >> 16);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: b16sqr
|
||||
****************************************************************************/
|
||||
|
||||
b16_t b16sqr(b16_t a)
|
||||
{
|
||||
b16_t sq;
|
||||
|
||||
/* The result is always positive. Just take the absolute value */
|
||||
|
||||
if (a < 0)
|
||||
{
|
||||
a = -a;
|
||||
}
|
||||
|
||||
/* Overflow occurred if the result is negative */
|
||||
|
||||
sq = (b16_t)ub16sqr(a);
|
||||
if (sq < 0)
|
||||
{
|
||||
sq = b16MAX;
|
||||
}
|
||||
|
||||
return sq;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: b16divb16
|
||||
****************************************************************************/
|
||||
|
||||
ub16_t ub16sqr(ub16_t a)
|
||||
{
|
||||
/* Let:
|
||||
*
|
||||
* m = mi*2**16 + mf (b16)
|
||||
*
|
||||
* Then:
|
||||
*
|
||||
* m*m = (mi*mi)*2**32 + 2*(m1*m2)*2**16 + mf*mf (b32)
|
||||
* = (mi*mi)*2**16 + 2*(mi*mf) + mf*mf*2**-16 (b16)
|
||||
*/
|
||||
|
||||
uint32_t mi = ((uint32_t)a >> 16);
|
||||
uint32_t mf = ((uint32_t)a & 0x0000ffff);
|
||||
|
||||
return (mi*mi << 16) + (mi*mf << 1) + ((mf*mf + b16HALF) >> 16);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: b16divb16
|
||||
****************************************************************************/
|
||||
|
||||
b16_t b16divb16(b16_t num, b16_t denom)
|
||||
{
|
||||
bool negate;
|
||||
b16_t quotient;
|
||||
|
||||
fixsign(&num, &denom, &negate);
|
||||
quotient = (b16_t)ub16divub16((ub16_t)num, (ub16_t)denom);
|
||||
return adjustsign(quotient, negate);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: ub16divub16
|
||||
****************************************************************************/
|
||||
|
||||
ub16_t ub16divub16(ub16_t num, ub16_t denom)
|
||||
{
|
||||
uint32_t term1;
|
||||
uint32_t numf;
|
||||
uint32_t product;
|
||||
|
||||
/* Let:
|
||||
*
|
||||
* num = numi*2**16 + numf (b16)
|
||||
* den = deni*2**16 + denf (b16)
|
||||
*
|
||||
* Then:
|
||||
*
|
||||
* num/den = numi*2**16 / den + numf / den (b0)
|
||||
* = numi*2**32 / den + numf*2**16 /den (b16)
|
||||
*/
|
||||
|
||||
/* Check for overflow in the first part of the quotient */
|
||||
|
||||
term1 = ((uint32_t)num & 0xffff0000) / denom;
|
||||
if (term1 >= 0x00010000)
|
||||
{
|
||||
return ub16MAX; /* Will overflow */
|
||||
}
|
||||
|
||||
/* Finish the division */
|
||||
|
||||
numf = num - term1 * denom;
|
||||
term1 <<= 16;
|
||||
product = term1 + (numf + (denom >> 1)) / denom;
|
||||
|
||||
/* Check for overflow */
|
||||
|
||||
if (product < term1)
|
||||
{
|
||||
return ub16MAX; /* Overflowed */
|
||||
}
|
||||
|
||||
return product;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -31,8 +31,6 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
|
||||
/****************************************************************************
|
||||
* Name: ub32sqrtub16
|
||||
*
|
||||
@@ -76,8 +74,6 @@ ub16_t ub32sqrtub16(ub32_t a)
|
||||
return (ub16_t)xk;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: ub16sqrtub8
|
||||
*
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
* available if long long types are supported.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -113,4 +111,3 @@ intmax_t strtoimax(FAR const char *nptr, FAR char **endptr, int base)
|
||||
return (intmax_t)accum;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_HAVE_LONG_LONG */
|
||||
|
||||
+4
-11
@@ -20,13 +20,9 @@
|
||||
"atof","stdlib.h","defined(CONFIG_HAVE_DOUBLE)","double","FAR const char *"
|
||||
"atoi","stdlib.h","","int","FAR const char *"
|
||||
"atol","stdlib.h","","long","FAR const char *"
|
||||
"atoll","stdlib.h","defined(CONFIG_HAVE_LONG_LONG)","long long","FAR const char *"
|
||||
"b16atan2","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","b16_t","b16_t","b16_t"
|
||||
"atoll","stdlib.h","","long long","FAR const char *"
|
||||
"b16cos","fixedmath.h","","b16_t","b16_t"
|
||||
"b16divb16","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","b16_t","b16_t","b16_t"
|
||||
"b16mulb16","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","b16_t","b16_t","b16_t"
|
||||
"b16sin","fixedmath.h","","b16_t","b16_t"
|
||||
"b16sqr","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","b16_t","b16_t"
|
||||
"basename","libgen.h","","FAR char *","FAR char *"
|
||||
"bind_textdomain_codeset","libintl.h","defined(CONFIG_LIBC_LOCALE_GETTEXT)","FAR char *","FAR const char *","FAR const char *"
|
||||
"bindtextdomain","libintl.h","defined(CONFIG_LIBC_LOCALE_GETTEXT)","FAR char *","FAR const char *","FAR const char *"
|
||||
@@ -162,7 +158,7 @@
|
||||
"lib_dumpbuffer","debug.h","","void","FAR const char *","FAR const uint8_t *","unsigned int"
|
||||
"lib_get_stream","nuttx/tls.h","","FAR struct file_struct *","int"
|
||||
"lio_listio","aio.h","defined(CONFIG_FS_AIO)","int","int","FAR struct aiocb * const []|FAR struct aiocb * const *","int","FAR struct sigevent *"
|
||||
"llabs","stdlib.h","defined(CONFIG_HAVE_LONG_LONG)","long long int","long long int"
|
||||
"llabs","stdlib.h","","long long int","long long int"
|
||||
"localtime","time.h","","struct tm *","const time_t *"
|
||||
"localtime_r","time.h","","FAR struct tm *","FAR const time_t *","FAR struct tm *"
|
||||
"mallinfo","malloc.h","","struct mallinfo","void"
|
||||
@@ -320,10 +316,10 @@
|
||||
"strtok","string.h","","FAR char *","FAR char *","FAR const char *"
|
||||
"strtok_r","string.h","","FAR char *","FAR char *","FAR const char *","FAR char **"
|
||||
"strtol","stdlib.h","","long","FAR const char *","FAR char **","int"
|
||||
"strtoll","stdlib.h","defined(CONFIG_HAVE_LONG_LONG)","long long","FAR const char *","FAR char **","int"
|
||||
"strtoll","stdlib.h","","long long","FAR const char *","FAR char **","int"
|
||||
"strtoul","stdlib.h","","unsigned long","FAR const char *","FAR char **","int"
|
||||
"strtoull","stdlib.h","","unsigned long long int","FAR const char *","FAR char **","int"
|
||||
"strtoull","stdlib.h","defined(CONFIG_HAVE_LONG_LONG)","unsigned long long","FAR const char *","FAR char **","int"
|
||||
"strtoull","stdlib.h","","unsigned long long","FAR const char *","FAR char **","int"
|
||||
"strtoumax","inttypes.h","","uintmax_t","FAR const char *","FAR char **","int"
|
||||
"strxfrm","string.h","defined(CONFIG_LIBC_LOCALE)","size_t","FAR char *","FAR const char *","size_t"
|
||||
"swab","unistd.h","","void","FAR const void *","FAR void *","ssize_t"
|
||||
@@ -345,9 +341,6 @@
|
||||
"towlower","wchar.h","","wint_t","wint_t"
|
||||
"towupper","wchar.h","","wint_t","wint_t"
|
||||
"truncate","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char *","off_t"
|
||||
"ub16divub16","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","ub16_t","ub16_t","ub16_t"
|
||||
"ub16mulub16","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","ub16_t","ub16_t","ub16_t"
|
||||
"ub16sqr","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","ub16_t","ub16_t"
|
||||
"uname","sys/utsname.h","","int","FAR struct utsname *"
|
||||
"ungetc","stdio.h","defined(CONFIG_FILE_STREAM)","int","int","FAR FILE *"
|
||||
"ungetwc","wchar.h","defined(CONFIG_FILE_STREAM)","wint_t","wint_t","FAR FILE *"
|
||||
|
||||
|
@@ -2,7 +2,8 @@
|
||||
* libs/libc/lzf/lzf_c.c
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-FileCopyrightText: 2000-2010 Marc Alexander Lehmann <schmorp@schmorp.de>
|
||||
* SPDX-FileCopyrightText:
|
||||
* 2000-2010 Marc Alexander Lehmann <schmorp@schmorp.de>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -146,11 +147,7 @@ size_t lzf_compress(FAR const void *const in_data,
|
||||
* special workaround for it.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
uint64_t off; /* Workaround for missing POSIX compliance */
|
||||
#else
|
||||
unsigned long off;
|
||||
#endif
|
||||
unsigned int hval;
|
||||
int lit;
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
|
||||
#include <nuttx/crc64.h>
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
@@ -290,4 +288,3 @@ uint64_t crc64(FAR const uint8_t *src, size_t len)
|
||||
return crc64part(src, len, CRC64_INIT) ^ CRC64_XOROUT;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_HAVE_LONG_LONG */
|
||||
|
||||
@@ -55,8 +55,6 @@
|
||||
|
||||
#include <nuttx/crc64.h>
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
@@ -289,4 +287,3 @@ uint64_t crc64emac(FAR const uint8_t *src, size_t len)
|
||||
return crc64emac_part(src, len, 0x0000000000000000ull);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_HAVE_LONG_LONG */
|
||||
|
||||
@@ -30,9 +30,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
long long atoll(FAR const char *nptr)
|
||||
{
|
||||
return strtoll(nptr, NULL, 10);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
long long int llabs(long long int j)
|
||||
{
|
||||
if (j < 0)
|
||||
@@ -42,4 +41,3 @@ long long int llabs(long long int j)
|
||||
|
||||
return j;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -45,8 +45,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(CONFIG_HAVE_LONG_LONG)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -80,4 +78,3 @@ lldiv_t lldiv(long long numer, long long denom)
|
||||
return f;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_HAVE_LONG_LONG */
|
||||
|
||||
@@ -50,7 +50,6 @@ static unsigned short int g_seed48[7] =
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
static uint64_t rand48_step(FAR unsigned short int *xi,
|
||||
FAR unsigned short int *lc)
|
||||
{
|
||||
@@ -66,7 +65,6 @@ static uint64_t rand48_step(FAR unsigned short int *xi,
|
||||
xi[2] = x >> 32;
|
||||
return x & 0xffffffffffffull;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -117,7 +115,6 @@ void lcong48(FAR unsigned short int p[7])
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
long jrand48(FAR unsigned short int s[3])
|
||||
{
|
||||
return (long)(rand48_step(s, g_seed48 + 3) >> 16);
|
||||
@@ -201,4 +198,3 @@ double drand48(void)
|
||||
return erand48(g_seed48);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -76,13 +76,8 @@
|
||||
# define ldbl_min_10_exp FLT_MIN_10_EXP
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
# define long_long long long
|
||||
# define llong_min LLONG_MIN
|
||||
#else
|
||||
# define long_long long
|
||||
# define llong_min LONG_MIN
|
||||
#endif
|
||||
#define long_long long long
|
||||
#define llong_min LLONG_MIN
|
||||
|
||||
#define shgetc(f) (*(f)++)
|
||||
#define shunget(f) ((f)--)
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
|
||||
#include "libc.h"
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -127,4 +125,3 @@ long long strtoll(FAR const char *nptr, FAR char **endptr, int base)
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
|
||||
#include "libc.h"
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -139,4 +137,3 @@ unsigned long long strtoull(FAR const char *nptr,
|
||||
return accum;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -44,9 +44,7 @@ int lib_bsprintf(FAR struct lib_outstream_s *s, FAR const IPTR char *fmt,
|
||||
short int si;
|
||||
int i;
|
||||
long l;
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
long long ll;
|
||||
#endif
|
||||
intmax_t im;
|
||||
size_t sz;
|
||||
ptrdiff_t pd;
|
||||
@@ -97,13 +95,11 @@ int lib_bsprintf(FAR struct lib_outstream_s *s, FAR const IPTR char *fmt,
|
||||
offset += sizeof(var->im);
|
||||
ret += lib_sprintf(s, fmtstr, var->im);
|
||||
}
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
else if (*(fmt - 2) == 'l' && *(fmt - 3) == 'l')
|
||||
{
|
||||
offset += sizeof(var->ll);
|
||||
ret += lib_sprintf(s, fmtstr, var->ll);
|
||||
}
|
||||
#endif
|
||||
else if (*(fmt - 2) == 'l')
|
||||
{
|
||||
offset += sizeof(var->l);
|
||||
|
||||
@@ -40,10 +40,6 @@
|
||||
* support long long types.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
# undef CONFIG_LIBC_LONG_LONG
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LIBC_SCANSET
|
||||
# define SCANSET_MODS "["
|
||||
#else
|
||||
@@ -245,9 +241,7 @@ static int vscanf_internal(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||
int base = 10;
|
||||
char tmp[MAXLN];
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
FAR unsigned long long *plonglong = NULL;
|
||||
#endif
|
||||
FAR unsigned long *plong = NULL;
|
||||
FAR unsigned int *pint = NULL;
|
||||
FAR unsigned short *pshort = NULL;
|
||||
@@ -345,7 +339,7 @@ static int vscanf_internal(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||
{
|
||||
modifier = L_MOD;
|
||||
}
|
||||
#if defined(CONFIG_HAVE_LONG_LONG) && ULLONG_MAX != ULONG_MAX
|
||||
#if ULLONG_MAX != ULONG_MAX
|
||||
else if (sizeof(size_t) == sizeof(unsigned long long))
|
||||
{
|
||||
modifier = LL_MOD;
|
||||
@@ -353,13 +347,9 @@ static int vscanf_internal(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||
#endif
|
||||
else
|
||||
{
|
||||
/* The only known cases that the default will be hit
|
||||
* are (1) the eZ80 which has sizeof(size_t) = 3 which
|
||||
* is the same as the sizeof(int). And (2) if
|
||||
* CONFIG_HAVE_LONG_LONG
|
||||
* is not enabled and sizeof(size_t) is equal to
|
||||
* sizeof(unsigned long long). This latter case is an
|
||||
* error.
|
||||
/* The only known case that the default will be hit
|
||||
* is the eZ80 which has sizeof(size_t) = 3 which is
|
||||
* the same as the sizeof(int).
|
||||
* Treat as integer with no size qualifier.
|
||||
*/
|
||||
|
||||
@@ -369,11 +359,8 @@ static int vscanf_internal(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||
else if (fmt_char(fmt) == 'j')
|
||||
{
|
||||
/* Same as long long if available. Otherwise, long. */
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
|
||||
modifier = LL_MOD;
|
||||
#else
|
||||
modifier = L_MOD;
|
||||
#endif
|
||||
}
|
||||
else if (fmt_char(fmt) == 'h' || fmt_char(fmt) == 'H')
|
||||
{
|
||||
@@ -612,13 +599,11 @@ static int vscanf_internal(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||
*plong = 0;
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
case LL_MOD:
|
||||
plonglong = next_arg(varg, vabuf,
|
||||
FAR unsigned long long *);
|
||||
*plonglong = 0;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -640,9 +625,8 @@ static int vscanf_internal(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||
bool stopconv;
|
||||
int errsave;
|
||||
unsigned long tmplong = 0;
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
unsigned long long tmplonglong = 0;
|
||||
#endif
|
||||
|
||||
/* Copy the real string into a temporary working buffer. */
|
||||
|
||||
if (!width || width > sizeof(tmp) - 1)
|
||||
@@ -858,9 +842,6 @@ static int vscanf_internal(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||
|
||||
switch (modifier)
|
||||
{
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
case LL_MOD:
|
||||
#endif
|
||||
case HH_MOD:
|
||||
case H_MOD:
|
||||
case NO_MOD:
|
||||
@@ -875,7 +856,6 @@ static int vscanf_internal(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
case LL_MOD:
|
||||
if (sign)
|
||||
{
|
||||
@@ -894,7 +874,6 @@ static int vscanf_internal(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||
# endif
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Check if the number was successfully converted */
|
||||
@@ -926,18 +905,13 @@ static int vscanf_internal(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||
*pint = (unsigned int)tmplong;
|
||||
break;
|
||||
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
case L_MOD:
|
||||
#endif
|
||||
default:
|
||||
*plong = tmplong;
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
case LL_MOD:
|
||||
*plonglong = tmplonglong;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
assigncount++;
|
||||
@@ -1191,13 +1165,11 @@ static int vscanf_internal(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||
*plong = (unsigned long)nchars;
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
case LL_MOD:
|
||||
plonglong = next_arg(varg, vabuf,
|
||||
FAR unsigned long long *);
|
||||
*plonglong = (unsigned long long)nchars;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,10 +61,6 @@
|
||||
* support long long types.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
# undef CONFIG_LIBC_LONG_LONG
|
||||
#endif
|
||||
|
||||
#define stream_putc(c,stream) (total_len++, lib_stream_putc(stream, c))
|
||||
#define stream_puts(buf, len, stream) \
|
||||
(total_len += len, lib_stream_puts(stream, buf, len))
|
||||
@@ -122,9 +118,7 @@ union arg_u
|
||||
{
|
||||
unsigned int u;
|
||||
unsigned long ul;
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
unsigned long long ull;
|
||||
#endif
|
||||
double d;
|
||||
FAR char *cp;
|
||||
};
|
||||
@@ -400,7 +394,7 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
|
||||
{
|
||||
c = 'l';
|
||||
}
|
||||
#if defined(CONFIG_HAVE_LONG_LONG) && ULLONG_MAX != ULONG_MAX
|
||||
#if ULLONG_MAX != ULONG_MAX
|
||||
else if (sizeof(size_t) == sizeof(unsigned long long))
|
||||
{
|
||||
c = 'l';
|
||||
@@ -410,13 +404,9 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
|
||||
#endif
|
||||
else
|
||||
{
|
||||
/* The only known cases that the default will be hit are
|
||||
* (1) the eZ80 which has sizeof(size_t) = 3 which is the
|
||||
* same as the sizeof(int). And (2) if
|
||||
* CONFIG_HAVE_LONG_LONG
|
||||
* is not enabled and sizeof(size_t) is equal to
|
||||
* sizeof(unsigned long long). This latter case is an
|
||||
* error.
|
||||
/* The only known case that the default will be hit is
|
||||
* the eZ80 which has sizeof(size_t) = 3 which is the
|
||||
* same as the sizeof(int).
|
||||
* Treat as integer with no size qualifier.
|
||||
*/
|
||||
|
||||
@@ -428,9 +418,7 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
|
||||
{
|
||||
/* Same as long long if available. Otherwise, long. */
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
flags |= FL_REPD_TYPE;
|
||||
#endif
|
||||
flags |= FL_LONG;
|
||||
flags &= ~FL_SHORT;
|
||||
continue;
|
||||
@@ -482,13 +470,11 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
|
||||
|
||||
flags &= ~(FL_LONG | FL_REPD_TYPE);
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
if (sizeof(FAR void *) == sizeof(unsigned long long))
|
||||
{
|
||||
flags |= (FL_LONG | FL_REPD_TYPE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (sizeof(FAR void *) == sizeof(unsigned long))
|
||||
{
|
||||
flags |= FL_LONG;
|
||||
@@ -951,9 +937,6 @@ str_lpad:
|
||||
|
||||
if (c == 'd' || c == 'i')
|
||||
{
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
long x;
|
||||
#else
|
||||
long long x;
|
||||
|
||||
if ((flags & FL_LONG) != 0 && (flags & FL_REPD_TYPE) != 0)
|
||||
@@ -972,7 +955,6 @@ str_lpad:
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if ((flags & FL_LONG) != 0)
|
||||
{
|
||||
#ifdef CONFIG_LIBC_NUMBERED_ARGS
|
||||
@@ -1018,11 +1000,7 @@ str_lpad:
|
||||
flags &= ~(FL_NEGATIVE | FL_ALT);
|
||||
if (x < 0)
|
||||
{
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
x = -(unsigned long)x;
|
||||
#else
|
||||
x = -(unsigned long long)x;
|
||||
#endif
|
||||
flags |= FL_NEGATIVE;
|
||||
}
|
||||
|
||||
@@ -1032,7 +1010,7 @@ str_lpad:
|
||||
}
|
||||
else
|
||||
{
|
||||
#if !defined(CONFIG_LIBC_LONG_LONG) && defined(CONFIG_HAVE_LONG_LONG)
|
||||
#if !defined(CONFIG_LIBC_LONG_LONG)
|
||||
DEBUGASSERT(x >= 0 && x <= ULONG_MAX);
|
||||
#endif
|
||||
c = __ultoa_invert(x, buf, 10) - buf;
|
||||
@@ -1041,9 +1019,6 @@ str_lpad:
|
||||
else
|
||||
{
|
||||
int base;
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
unsigned long x;
|
||||
#else
|
||||
unsigned long long x;
|
||||
|
||||
if ((flags & FL_LONG) != 0 && (flags & FL_REPD_TYPE) != 0)
|
||||
@@ -1062,7 +1037,6 @@ str_lpad:
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if ((flags & FL_LONG) != 0)
|
||||
{
|
||||
#ifdef CONFIG_LIBC_NUMBERED_ARGS
|
||||
@@ -1218,7 +1192,7 @@ str_lpad:
|
||||
}
|
||||
else
|
||||
{
|
||||
#if !defined(CONFIG_LIBC_LONG_LONG) && defined(CONFIG_HAVE_LONG_LONG)
|
||||
#if !defined(CONFIG_LIBC_LONG_LONG)
|
||||
DEBUGASSERT(x <= ULONG_MAX);
|
||||
#endif
|
||||
c = __ultoa_invert(x, buf, base) - buf;
|
||||
@@ -1355,10 +1329,8 @@ int lib_vsprintf(FAR struct lib_outstream_s *stream,
|
||||
switch (arglist.type[i])
|
||||
{
|
||||
case TYPE_LONG_LONG:
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
arglist.value[i].ull = va_arg(ap, unsigned long long);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case TYPE_LONG:
|
||||
arglist.value[i].ul = va_arg(ap, unsigned long);
|
||||
|
||||
@@ -50,10 +50,6 @@
|
||||
* support long long types.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
# undef CONFIG_LIBC_LONG_LONG
|
||||
#endif
|
||||
|
||||
/* Next flags are to use with `base'. Unused fields are reserved. */
|
||||
|
||||
#define XTOA_PREFIX 0x0100 /* Put prefix for octal or hex */
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
|
||||
/****************************************************************************
|
||||
* Name: ffsll
|
||||
*
|
||||
@@ -67,4 +65,3 @@ int ffsll(long long j)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
|
||||
/****************************************************************************
|
||||
* Name: flsll
|
||||
*
|
||||
@@ -67,4 +65,3 @@ int flsll(long long j)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -34,18 +34,6 @@
|
||||
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Can't support CONFIG_LIBC_MEMSET_64BIT if the platform does not
|
||||
* have 64-bit integer types.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
# undef CONFIG_LIBC_MEMSET_64BIT
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
@@ -45,14 +45,6 @@
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Can't support CONFIG_LIBC_MEMCPY_64BIT if the platform does not have
|
||||
* 64-bit integer types.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
# undef CONFIG_LIBC_MEMCPY_64BIT
|
||||
#endif
|
||||
|
||||
/* Remove definitions when CONFIG_LIBC_MEMCPY_INDEXED_COPY is defined */
|
||||
|
||||
#ifdef CONFIG_LIBC_MEMCPY_INDEXED_COPY
|
||||
@@ -307,15 +299,31 @@ FAR void *memcpy(FAR void *dest, FAR const void *src, size_t count)
|
||||
|
||||
switch ((((uintptr_t)src8) PRE_SWITCH_ADJUST) & (TYPE_WIDTH - 1))
|
||||
{
|
||||
case 0: COPY_NO_SHIFT(); break;
|
||||
case 1: COPY_SHIFT(1); break;
|
||||
case 2: COPY_SHIFT(2); break;
|
||||
case 3: COPY_SHIFT(3); break;
|
||||
case 0:
|
||||
COPY_NO_SHIFT();
|
||||
break;
|
||||
case 1:
|
||||
COPY_SHIFT(1);
|
||||
break;
|
||||
case 2:
|
||||
COPY_SHIFT(2);
|
||||
break;
|
||||
case 3:
|
||||
COPY_SHIFT(3);
|
||||
break;
|
||||
#if TYPE_WIDTH > 4
|
||||
case 4: COPY_SHIFT(4); break;
|
||||
case 5: COPY_SHIFT(5); break;
|
||||
case 6: COPY_SHIFT(6); break;
|
||||
case 7: COPY_SHIFT(7); break;
|
||||
case 4:
|
||||
COPY_SHIFT(4);
|
||||
break;
|
||||
case 5:
|
||||
COPY_SHIFT(5);
|
||||
break;
|
||||
case 6:
|
||||
COPY_SHIFT(6);
|
||||
break;
|
||||
case 7:
|
||||
COPY_SHIFT(7);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -33,11 +33,9 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
#ifdef CONFIG_HAVE_DOUBLE
|
||||
long long llround(double x)
|
||||
{
|
||||
return (long long)round(x);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -33,9 +33,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
long long llroundf(float x)
|
||||
{
|
||||
return (long long)roundf(x);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -33,11 +33,9 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
#ifdef CONFIG_HAVE_LONG_DOUBLE
|
||||
long long llroundl(long double x)
|
||||
{
|
||||
return (long long)roundl(x);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -35,24 +35,6 @@
|
||||
#include <nuttx/compiler.h>
|
||||
#include <nuttx/spinlock_type.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* If CONFIG_SYSTEM_TIME64 is selected and the CPU supports long long types,
|
||||
* then a 64-bit system time will be used.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_HAVE_LONG_LONG
|
||||
# undef CONFIG_SYSTEM_TIME64
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Type Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
@@ -55,9 +55,8 @@
|
||||
* IRQ HANDLER ARGUMENT COUNT RATE TIME
|
||||
* DDD XXXXXXXX XXXXXXXX DDDDDDDDDD DDDD.DDD DDDD
|
||||
*
|
||||
* NOTE: This assumes that an address can be represented in 32-bits. In
|
||||
* the typical configuration where CONFIG_HAVE_LONG_LONG=y, the COUNT field
|
||||
* may not be wide enough.
|
||||
* NOTE: This assumes that an address can be represented in 32-bits. The
|
||||
* COUNT field may not be wide enough.
|
||||
*/
|
||||
|
||||
#define HDR_FMT "IRQ HANDLER ARGUMENT COUNT RATE TIME\n"
|
||||
@@ -201,7 +200,6 @@ static int irq_callback(int irq, FAR struct irq_info_s *info,
|
||||
elapsed = now - copy.start;
|
||||
perf_convert(copy.time, &delta);
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
/* elapsed = <current-time> - <start-time>, units=clock ticks
|
||||
* rate = <interrupt-count> * TICKS_PER_SEC / elapsed
|
||||
*/
|
||||
@@ -230,9 +228,6 @@ static int irq_callback(int irq, FAR struct irq_info_s *info,
|
||||
{
|
||||
count = (unsigned long)copy.count;
|
||||
}
|
||||
#else
|
||||
# error Missing logic
|
||||
#endif
|
||||
|
||||
/* Output information about this interrupt */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user