!65 fix:License alarm handling

Merge pull request !65 from stone.shi/monthly_20230815
This commit is contained in:
openharmony_ci
2023-09-26 06:35:59 +00:00
committed by Gitee
5 changed files with 3 additions and 267 deletions
+1
View File
@@ -59,6 +59,7 @@ if (ohos_kernel_type == "liteos_m") {
"src/os/liteos/include",
"src/os/liteos/include_standrd",
"//commonlibrary/utils_lite/include",
"//third_party/musl/porting/liteos_m/kernel/include",
"//third_party/musl/porting/liteos_m/kernel/src/include",
"//third_party/musl/porting/liteos_m/kernel/src/internal",
"//third_party/wpa_supplicant/wpa_supplicant-2.9/src/utils",
+2 -2
View File
@@ -15,6 +15,8 @@ import("//kernel/liteos_m/liteos.gni")
module_name = get_path_info(rebase_path("."), "name")
kernel_module(module_name) {
sources = [
"//third_party/musl/src/math/fmodl.c",
"//third_party/musl/src/math/scalbnl.c",
"xt804/bsp/board_init.c",
"xt804/bsp/isr.c",
"xt804/bsp/startup.S",
@@ -26,9 +28,7 @@ kernel_module(module_name) {
"xt804/libc/liteos/math/copysignl.c",
"xt804/libc/liteos/math/fabsl.c",
"xt804/libc/liteos/math/fmod.c",
"xt804/libc/liteos/math/fmodl.c",
"xt804/libc/liteos/math/scalbn.c",
"xt804/libc/liteos/math/scalbnl.c",
"xt804/libc/liteos/stdio/puts.c",
"xt804/libc/liteos/stdio/sprintf.c",
"xt804/libc/liteos/stdio/vprintf.c",
@@ -1,120 +0,0 @@
/*
* Copyright (c) 2022 Winner Microelectronics Co., Ltd. All rights reserved.
* Licensed 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.
*/
#include "libm.h"
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double fmodl(long double x, long double y)
{
return fmod(x, y);
}
#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
long double fmodl(long double x, long double y)
{
union ldshape ux = {x}, uy = {y};
int ex = ux.i.se & 0x7fff;
int ey = uy.i.se & 0x7fff;
int sx = ux.i.se & 0x8000;
if (y == 0 || isnan(y) || ex == 0x7fff)
return (x*y)/(x*y);
ux.i.se = ex;
uy.i.se = ey;
if (ux.f <= uy.f) {
if (ux.f == uy.f)
return 0*x;
return x;
}
/* normalize x and y */
if (!ex) {
ux.f *= 0x1p120f;
ex = ux.i.se - 120;
}
if (!ey) {
uy.f *= 0x1p120f;
ey = uy.i.se - 120;
}
/* x mod y */
#if LDBL_MANT_DIG == 64
uint64_t i, mx, my;
mx = ux.i.m;
my = uy.i.m;
for (; ex > ey; ex--) {
i = mx - my;
if (mx >= my) {
if (i == 0)
return 0*x;
mx = 2*i;
} else if (2*mx < mx) {
mx = 2*mx - my;
} else {
mx = 2*mx;
}
}
i = mx - my;
if (mx >= my) {
if (i == 0)
return 0*x;
mx = i;
}
for (; (mx >> 63) == 0; mx *= 2, ex--);
ux.i.m = mx;
#elif LDBL_MANT_DIG == 113
uint64_t hi, lo, xhi, xlo, yhi, ylo;
xhi = (ux.i2.hi & -1ULL>>16) | 1ULL<<48;
yhi = (uy.i2.hi & -1ULL>>16) | 1ULL<<48;
xlo = ux.i2.lo;
ylo = uy.i2.lo;
for (; ex > ey; ex--) {
hi = xhi - yhi;
lo = xlo - ylo;
if (xlo < ylo)
hi -= 1;
if ((hi >> 63) == 0) {
if ((hi|lo) == 0)
return 0*x;
xhi = 2*hi + (lo>>63);
xlo = 2*lo;
} else {
xhi = 2*xhi + (xlo>>63);
xlo = 2*xlo;
}
}
hi = xhi - yhi;
lo = xlo - ylo;
if (xlo < ylo)
hi -= 1;
if ((hi >> 63) == 0) {
if ((hi|lo) == 0)
return 0*x;
xhi = hi;
xlo = lo;
}
for (; (xhi >> 48) == 0; xhi = 2*xhi + (xlo>>63), xlo = 2*xlo, ex--);
ux.i2.hi = xhi;
ux.i2.lo = xlo;
#endif
/* scale result */
if (ex <= 0) {
ux.i.se = (ex+120)|sx;
ux.f *= 0x1p-120f;
} else
ux.i.se = ex|sx;
return ux.f;
}
#endif
@@ -1,51 +0,0 @@
/*
* Copyright (c) 2022 Winner Microelectronics Co., Ltd. All rights reserved.
* Licensed 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.
*/
#include "libm.h"
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double scalbnl(long double x, int n)
{
return scalbn(x, n);
}
#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
long double scalbnl(long double x, int n)
{
union ldshape u;
if (n > 16383) {
x *= 0x1p16383L;
n -= 16383;
if (n > 16383) {
x *= 0x1p16383L;
n -= 16383;
if (n > 16383)
n = 16383;
}
} else if (n < -16382) {
x *= 0x1p-16382L * 0x1p113L;
n += 16382 - 113;
if (n < -16382) {
x *= 0x1p-16382L * 0x1p113L;
n += 16382 - 113;
if (n < -16382)
n = -16382;
}
}
u.f = 1.0;
u.i.se = 0x3fff + n;
return x * u.f;
}
#endif
@@ -1,94 +0,0 @@
/*
* Copyright (c) 2022 Winner Microelectronics Co., Ltd. All rights reserved.
* Licensed 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.
*/
#ifndef _WCTYPE_H
#define _WCTYPE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#define __NEED_wint_t
#define __NEED_wctype_t
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define __NEED_locale_t
#endif
#include <bits/alltypes.h>
typedef const int *wctrans_t;
#undef WEOF
#define WEOF 0xffffffffU
#undef iswdigit
int iswalnum(wint_t);
int iswalpha(wint_t);
int iswblank(wint_t);
int iswcntrl(wint_t);
int iswdigit(wint_t);
int iswgraph(wint_t);
int iswlower(wint_t);
int iswprint(wint_t);
int iswpunct(wint_t);
int iswspace(wint_t);
int iswupper(wint_t);
int iswxdigit(wint_t);
int iswctype(wint_t, wctype_t);
wint_t towctrans(wint_t, wctrans_t);
wint_t towlower(wint_t);
wint_t towupper(wint_t);
wctrans_t wctrans(const char *);
wctype_t wctype(const char *);
#ifndef __cplusplus
#undef iswdigit
#define iswdigit(a) (0 ? iswdigit(a) : ((unsigned)(a)-'0') < 10)
#endif
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
int iswalnum_l(wint_t, locale_t);
int iswalpha_l(wint_t, locale_t);
int iswblank_l(wint_t, locale_t);
int iswcntrl_l(wint_t, locale_t);
int iswdigit_l(wint_t, locale_t);
int iswgraph_l(wint_t, locale_t);
int iswlower_l(wint_t, locale_t);
int iswprint_l(wint_t, locale_t);
int iswpunct_l(wint_t, locale_t);
int iswspace_l(wint_t, locale_t);
int iswupper_l(wint_t, locale_t);
int iswxdigit_l(wint_t, locale_t);
int iswctype_l(wint_t, wctype_t, locale_t);
wint_t towlower_l(wint_t, locale_t);
wint_t towupper_l(wint_t, locale_t);
wint_t towctrans_l(wint_t, wctrans_t, locale_t);
wctrans_t wctrans_l(const char *, locale_t);
wctype_t wctype_l(const char *, locale_t);
#endif
#ifdef __cplusplus
}
#endif
#endif