and enable on sim as a demo. Here is the paper:
ftp://gcc.gnu.org/pub/gcc/summit/2003/Stackguard.pdf
Signed-off-by: qiaowei <qiaowei@xiaomi.com>
Change-Id: I1926936328dad54eee16b322dcaad0b42f9c4a62
1.Expose the notification through fb_vtable_s::updatearea
2.Incorporate old nx_notify_rectangle into the new updatearea callback
3.Migrate the calle of nx_notify_rectangle to fb_vtable_s::updatearea
Change-Id: Ia3d1f73e8757b2d381586d76ec6adc16c810018d
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
drivers/net/ftmac100.c, libs/libc/stdlib/lib_aligned_alloc.c
A continuation of PRs #1507, #1510, and #1512. See Issue #1481 for additional information.
Found by clang-check:
modlib/modlib_sections.c:93:3: warning: Value stored to 'buffer' is never read
buffer = loadinfo->iobuffer;
^ ~~~~~~~~~~~~~~~~~~
1 warning generated.
simplify and symmetry the implementation in KERNEL/PROTECTED build
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iefdeea5f6ef6348c774b2ca9f7e45fe89c0c22dd
Make.dep file should be updated by .config changed after first make.
There are 2 cases affected for this problem:
1) Add source files by config symbol
2) Include header files in #ifdef directive
These 2 cases may not be included in Make.dep and this may prevent the
differential build from working correctly.
since libc++ declare these function in ctime by:
using ::localtime[_r];
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic0bb68b44c0cab838ab7cc34baee2aaa3ca8a9b5
since exit will be only callable from userspace and change
the 1st argument from "const uint8_t *" to "const char *"
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I86487d57210ab63109148232da71dbc4d60a563b
because the logic:
1.only work on arm platform
2.couple with elf format
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I25dc95b5fc7b24196e2e71fdcf82d71d621ee2d3
since sim arch has to use other instance provided by host glibc
also initialize __dso_handle to self as glibc:
https://github.com/bminor/glibc/blob/master/csu/dso_handle.c#L21
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I7531ae58fc4dbe4600bcb2c2c3a6cac021378bc1
otherwise the user is shocked that using cin/cout/cerr will crash the system
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I453427261f3e2a6e60f7dd2398f7d3bd1043a0d5
1.Remove CONFIG_HAVE_INLINE macro
2.Change the ANSI C function to normal function
3.Other simple non ANSI function to macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
to avoid the similar code spread around each application
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8967d647eaf2ecae47f29f83e7fa322ef1b42a02
since double_t move from sys/types.h to math.h now and remove
math.h inclusion too because lib_dtoa_engine.h already include
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3497a73908301d999cf1cfc4a66552a7ca4868c6
As it's stated in the standards.
The original code look at the first Xs. It can end up with
an unexpected behavior, if a template contains multiple series of Xs.
E.g. /tmp/XXXXXX/XXXXXX
This backs out a part of PR 1179 which has a very serious error: If C buffered I/O is available, then printf() and vprintf MUST use it. Otherwise, the ordering of the I/O will be screwed up. They must not use direct file descriptor I/O UNLESS C buffered I/O is disabled.
and update the related stuff in libs/libc/libc.csv
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id695a7f07bf18a7b4e526297f9131c75ddb79d30
Functions within the OS must never set the errno value. fs_fdopen() was setting the errno value. Now, after some parameter changes, it reports errors via a negated errno integer return value as do most all other internal OS functions.
It's better to have a default working for many cases.
Usually DNS servers are not optimized for embedded clients.
Users can fine tune for their environment anyway.
1. Move pthread-specific data files from sched/pthread/ to libs/libc/pthread.
2. Remove pthread-specific data functions from syscalls.
3. Implement tls_alloc() and tls_free() with system calls.
4. Reimplement pthread_key_create() and pthread_key_free() using tls_alloc() and tls_free().
5. Reimplement pthread_set_specific() and pthread_get_specicif() using tls_set_value() and tls_get_value()
- Remove per-thread errno from the TCB structure (pterrno)
- Remove get_errno() and set_errno() as functions. The macros are still available as stubs and will be needed in the future if we need to access the errno from a different address environment (KERNEL mode).
- Add errno value to the tls_info_s structure definitions
- Move sched/errno to libs/libc/errno. Replace old TCB access to the errno with TLS access to the errno.
Move the logic to get TLS information from an inline function to a normal function. For the unaligned case, it is probably too large to be inlined.
Also fixes some minor things from review of previous commits.
CONFIG_TLS_ALIGNED will select the (legacy) aligned stack implementation of TLS. If CONFIG_TLS_ALIGNED is not defined, then the new, implementation of TLS using an unaligned stack will be enabled.
The new OS interface, sched_get_stackinfo() combines two pthread-specific interfaces into a single generic interface. The existing pthread_get_stackaddr_np() and pthread_get_stacksize_np() are moved from sched/pthread to libs/libc/pthread.
There are two motivations for this change: First, it reduces the number of system calls. Secondly, it adds a common hook that is going to used for a future implementation of TLS.
Align the generated files name, so make distclean could also remove all nxfonts_bitmaps_*.c files, no
need to add one more extra DELFILE for nxfonts_tom-thumb-4x6.c.
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
This change is needed to be able to fix the warnings on the audio core
and includes the propagation of the fix in the audio.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
arp/arp_notify.c:132:43: warning: for loop has empty body [-Wempty-body]
prev = curr, curr = curr->nt_flink);
^
sixlowpan/sixlowpan_tcpsend.c:806:31: warning: implicit conversion from 'unsigned int' to 'uint16_t' (aka 'unsigned short') changes value from 4294967295 to 65535 [-Wconstant-conversion]
_SO_TIMEOUT(psock->s_sndtimeo));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Numerous warnings like:
ieee802154_getreq.c:93:3: warning: implicit declaration of function 'memcpy' is invalid in C99 [-Wimplicit-function-declaration]
IEEE802154_EADDRCOPY(eaddr, req.attrval.mac.eaddr);
^
nxfonts/nxfonts_cache.c:839:35: warning: for loop has empty body [-Wempty-body]
fcache = fcache->flink);
bluetooth/bluetooth_finddev.c💯11: warning: implicit declaration of function 'memcmp' is invalid in C99 [-Wimplicit-function-declaration]
if (BLUETOOTH_ADDRCMP(dev->d_mac.radio.nv_addr, match->bf_addr))
^
rwbuffer.c:559:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (rwb->rhmaxblocks > 0 && rwb->rhnblocks > 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/telnet.c:1317:40: warning: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare]
if (priv->td_pending < CONFIG_TELNET_RXBUFFER_SIZE)
~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
time/lib_localtime.c:569:32: warning: sizeof on pointer operation will return size of 'char *' instead of 'char [33]' [-Wsizeof-array-decay]
sizeof(lsp->fullname - 1) <= strlen(p) + strlen(name))
~~~~~~~~~~~~~ ^
Run all files modified by PR 766 through nxstyle and fix any resulting complaints.
NOTE: Numerous "Mixed case identifier" errors in arch/arm/src/cxd56xx/cxd56_gnss.c were not fixed because this problem is of much larger scope than this file.
This commit resolves issue #620:
Remove CONFIG_CAN_PASS_STRUCTS #620
The configuration option CONFIG_CAN_PASS_STRUCTS was added many years ago to support an old version of the SDCC compiler. That compiler is currently used only with the Z80 and Z180 targets. The limitation of that old compiler was that it could not pass structures or unions as either inputs or outputs. For example:
#ifdef CONFIG_CAN_PASS_STRUCTS
struct mallinfo mallinfo(void);
#else
int mallinfo(FAR struct mallinfo *info);
#endif
And even leads to violation of a few POSIX interfaces like:
#ifdef CONFIG_CAN_PASS_STRUCTS
int sigqueue(int pid, int signo, union sigval value);
#else
int sigqueue(int pid, int signo, FAR void *sival_ptr);
#endif
This breaks the 1st INVIOLABLES rule:
Strict POSIX compliance
-----------------------
o Strict conformance to the portable standard OS interface as defined at
OpenGroup.org.
o A deeply embedded system requires some special support. Special
support must be minimized.
o The portable interface must never be compromised only for the sake of
expediency.
o Expediency or even improved performance are not justifications for
violation of the strict POSIX interface
Also, it appears that the current SDCC compilers have resolve this issue and so, perhaps, this is no longer a problem: z88dk/z88dk#1132
NOTE: This commit cannot pass the PR checks because it depends on matching changes to the apps/ directory.
So call 'make EXTRAFLAGS=-Wno-cpp' could suppress the warnings with pre-processor
directive #warning in GCC.
Change-Id: Iaa618238924c9969bf91db22117b39e6d2fc9bb6
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
since some host have multiple IPv4 address, the dns cache may fill in all
Ipv4 address and refuse to accept any IPv6 address if we query IPv4 first
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I229a7a524fb9daa7498c66913a2de61f11d6fb43
and let other function call the new internal function gethostentbyname_r
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic6137d6cf03f75d6ed33e23bf04ae74b7264e682
so netdb could reuse these global variable directly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iaa26ddbdaf416f64d43c6e8888a14bbe0c3405eb
* The appropriate size of stack varies among archs.
E.g. for 64-bit sim, 2048 is way too small, especially when the task
happens to use host OS functionalities.
I plan to allow an arch provide its own default.
* I plan to use this to replace hardcoded "STACKSIZE = 2048" in APPDIR.
This reverts commit b9ace36fcc.
This change was added by PR 625 but has a serious logic flaw. It removes all occurrences of INCDIROPT and replaces it with a definition in tools/Config.mk:
else ifeq ($(WINTOOL),y)
DEFINE = "$(TOPDIR)/tools/define.sh"
INCDIR = "$(TOPDIR)/tools/incdir.sh" -w
This logic flaw is the Config.mk is included in all Make.defs files BEFORE WINTOOL is defined. As a result, the definition is wrong in many places when building under Cygwin with a Windows native toolchain.
boards/z80/ez80/z20x: Increase RX buffer size to 4Kb, reduce BAUD to 2400 in w25boot configuration
arch/z80/src/ez80/ez80_serial.c: Reduce Rx FIFO trigger level for eZ80F92 to 1 so that will respond more quickly to incoming data.
Rename lib_rawinstream.c to lib_rawsistream.c and lib_rawsistream.c to lib_rawinstream.c so that the content of the files match the name of the files. While we are at it, update the file license to Apache 2.0
Kconfig files. Repartition some functionality. Bootloader support will need to be provided in logic under arch/z80/src/ez80 so the critical configuration selections were moved the Kconfig file there.
arch/z80/src/ez80/ez80_i2c.h: Rename arch/z80/src/ez80/ez80f91_i2c.h. It is sharable by both ez80f91 and ez80f92.
arch/z80/src/ez80/: Add logic to perform an additional level of interrupt redirection. This is necessary because the the interrupt handling is part of the loader FLASH-based logic. In order to share interrupts with the program loaded into RAM by the loader, another layer or redirection is required to get control to the interrupt handlers in the loaded program. See ez809f2_loader.asm and ez80f92_program.asm
boards/z80/ez80/z20x/scripts: Reduce size of the interrupt re-direction buffer from 1Kb to 512b.
* Adding support for BQ769x0 Battery Monitor IC (Work In Progress)
* Additional changes to support BQ769x0
* Store cell count and chip type when setting up
* Added shutdown, limits, charge/discharge switch, and clear faults operations
* Added support for current measurement; some cleanup
* Updated temperature reporting. Fixed negative current reporting.
* When setting safety limits, update limit structure with actual values used.
* Added note on battery limit structure
* Updates to BQ769x0. Re-ordered fault reporting, added fault cache, added ordered fault clearing
Eliminate the MOVEOBJ definition from tools/Config.mk, Makefiles, and other locations. The MOVEOBJ definition was used to work around the case where the object output of a compile or assemble is in a different directory than the source file. The ZDS-II tools have no command line option to perform this move; MOVEOBJ handled the move as a post-compiler operation.
MOVEOBJ is no longer needed because this the ez80 COMPILE and ASSEMBLE definitions now handle all of the object file movement cases.
PR317 removed definitions for SEC_PER_MIN, SEC_PER_HOUR, and SEC_PER_DAY because these were duplicates of definitions in include/nuttx/clock.h. However, the PR did not include nuttx/clock.h so the removal of these definitions resulted in compilation failures.
Noted by Ouss4
time/lib_gmtimer.c:54: warning: "SEC_PER_MIN" redefined
54 | #define SEC_PER_MIN ((time_t)60)
|
In file included from nuttx/include/nuttx/semaphore.h:48,
from nuttx/include/pthread.h:56,
from nuttx/include/signal.h:50,
from nuttx/include/sys/select.h:46,
from nuttx/include/sys/types.h:305,
from nuttx/include/time.h:46,
from time/lib_gmtimer.c:44:
nuttx/include/nuttx/clock.h:125: note: this is the location of the previous definition
125 | #define SEC_PER_MIN 60L
|
time/lib_gmtimer.c:55: warning: "SEC_PER_HOUR" redefined
55 | #define SEC_PER_HOUR ((time_t)60 * SEC_PER_MIN)
|
In file included from nuttx/include/nuttx/semaphore.h:48,
from nuttx/include/pthread.h:56,
from nuttx/include/signal.h:50,
from nuttx/include/sys/select.h:46,
from nuttx/include/sys/types.h:305,
from nuttx/include/time.h:46,
from time/lib_gmtimer.c:44:
nuttx/include/nuttx/clock.h:138: note: this is the location of the previous definition
138 | #define SEC_PER_HOUR (SEC_PER_MIN * MIN_PER_HOUR)
|
time/lib_gmtimer.c:56: warning: "SEC_PER_DAY" redefined
56 | #define SEC_PER_DAY ((time_t)24 * SEC_PER_HOUR)
|
In file included from nuttx/include/nuttx/semaphore.h:48,
from nuttx/include/pthread.h:56,
from nuttx/include/signal.h:50,
from nuttx/include/sys/select.h:46,
from nuttx/include/sys/types.h:305,
from nuttx/include/time.h:46,
from time/lib_gmtimer.c:44:
nuttx/include/nuttx/clock.h:141: note: this is the location of the previous definition
141 | #define SEC_PER_DAY (HOURS_PER_DAY * SEC_PER_HOUR)
|
To ensure size_t same as toolchain definition in the first place and rename CXX_NEWLONG to ARCH_SIZET_LONG. The change also check whether __SIZE_TYPE__ exist before CONFIG_ARCH_SIZET_LONG so our definition can align with toolchain(gcc/clang) definition automatically.