The doxygen documents must be placed before the symbol in order
them to be shown in the generated documentation.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Make sure that network related functions are always documented.
This means keeping the prototype and possible stub together.
Fixes#12615
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
There are issues using lowercase min and max macros when compiling a C++
application with a third-party toolchain such as GNU ARM Embedded when
using some STL headers i.e. <chrono>.
This is because there are actual C++ functions called min and max
defined in some of the STL headers and these macros interfere with them.
By changing the macros to UPPERCASE, which is consistent with almost all
other pre-processor macros this naming conflict is avoided.
All files that use these macros have been updated.
Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
Upon hard/soft irq or exception entry/exit, handle transitions
off or onto the trampoline stack, which is the only stack that
can be used on the kernel side when the shadow page table
is active. We swap page tables when on this stack.
Adjustments to page tables are now as follows:
- Any adjustments for stack memory access now are always done
to the user page tables
- Any adjustments for memory domains are now always done to
the user page tables
- With KPTI, resetting a page now clears the present bit
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
If kernel page table isolation is enabled, we generate a second
set of page tables. These tables, except for the shared page, have
all non-user pages marked as non-present.
The MMU generation script has been refactored:
- Debugging output has been make significantly simpler and less
verbose
- Useless globals removed or adjusted
- MMU region list is validated as it is read
- Some tuples unpacked into individual variables to make the
code easier to read.
- Useless command line option for output binary endian-ness
remobved
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
KPTI requires that there exist one kernel page marked
'present', because switching between the kernel and the
shadow page tables is not done automatically and certain
other CPU data structures must always be in a present page.
Move IDT, GDT, all TSS to this page, and set up a small
trampoline stack as a safe landing area when doing
privilege level transitions.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
It was possible to deadlock the shell when command
suspended shell's thread and next another thread wanted
to print something on the shell.
To avoid that shell releases mutex before entering command
handler. Due to this change some adapations to shell
internal print functions have been applied.
This change addresses following usecase:
1. A command handler needs to call a (system) function which
communicate results via a callback, and this callback is expected
to print these results. The callback is called by the system from
another thread.
2. To achieve that, the handler needs to pass `struct shell *`
to callbacks, but also some other data specific to callback.
Thus, handles allocates some structure will those fields on
the stack.
3. The handler schedules this callback to be called.
4. As a reference to stack structure is passed to the callback,
the handler can't return immediately (or stack data will go out
of scope and will be overwritten).
5. So, the handler blocks waiting for callback to finish.
Previously, this scenario led to deadlock when the callback
trying or print to shell. With these changes, it just works,
as long as main handler and callback serialize there access
to the shell structure (i.e. when callback prints, the main
handler is blocked waiting for its completion).
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
shutdown() itself is described as just marking RX or TX path of a
socket as not available. For the first approximation, we implement
it just as a dummy function, to allow build existing POSIX
applications which use it.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Initial implementation of IPSO Timer object #3340
Based on: http://www.openmobilealliance.org/tech/profiles/lwm2m/3340.xml
"This IPSO object is used to time events and actions, using patterns
common to industrial timers. A POST to the trigger resource or On/Off
input state change starts the timing operation, and the timer
remaining time shows zero when the operation is complete. The
patterns supported are One-Shot (mode 1), On-Time or Interval
(mode 2), Time delay on pick-up or TDPU (tmode 3), and Time Delay
on Drop-Out or TDDO (mode 4). Mode 0 disables the timer, so the output
follows the input with no delay. A counter is provided to count
occurrences of the timer output changing from 0 to 1. Writing a value
of zero resets the counter. The Digital Input State resource reports
the state of the timer output."
NOTE: Only One-Shot Mode (mode 1) is implemented in this patch.
Signed-off-by: Michael Scott <mike@foundries.io>
During the initial work on LwM2M, the float32/64 code was
basically stubbed out. Float32 sent only whole values and
float64 was completely broken.
Let's clean up the OMA TLV formatting code by moving the float
processing code into a separate file: lwm2m_util.c.
Then using public definitions for binary32 and binary64, let's
fix the processing code to correctly fill the float32_value_t
and float64_value_t types.
Signed-off-by: Michael Scott <mike@foundries.io>
Now that legacy net_pkt_pull function has been removed, the new
function can be renamed accordingly.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now that the stack uses the new API from net_pkt for pulling, no need
to keep the legacy one around.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now that legacy net_pkt_clone function has been removed, the new
function can be renamed accordingly.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now that the stack uses the new API from net_pkt for copying, no need
to keep the legacy one around.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now that legacy net_pkt_clone function has been removed, the new
function can be renamed accordingly.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now that the stack uses the new API from net_pkt for cloning, no need to
keep the legacy one around.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It will return the amount of data to be read from current cursor
position. This will prove to be useful to remove appdatalen attribute.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It is now unused anywhere: former net_pkt_get_src/dst_addr where the
only one using it and that has been changed since.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This function is only used in sockets, thus making it a private function
of socket library and renaming it relevantly.
Note that sockets should be reviewed at some point to avoid using such
function: zsock_received_cb() already get the ip header and the protocol
header, so it could grab the src addr/port from there. It would be way
more optimized to do so, since net_pkt_get_src_addr is costly as it
parses all over again the ip/protocol headers.
utils unit test is updated and the test of the former
net_pkt_get_src_addr/net_pkt_get_dst_addr are removed.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The error message is obscure when CONFIG_PRIVILEGED_STACK_TEXT_AREA is
configured incorrectly. It looks like this:
zephyr/linker.cmd:73 cannot move location counter backwards (from
0000000000069bfc to 0000000000069bd8)
This patch re-writes the linker script mechanism in a (believed and
tested) semantically equivalent way such that it is possible to use an
assertion.
The assertion's error message now looks like this:
Memory region Used Size Region Size %age Used
FLASH: 503012 B 1 MB 47.97%
SRAM: 53760 B 256 KB 20.51%
IDT_LIST: 120 B 2 KB 5.86
real-ld: The configuration system has incorrectly set
'CONFIG_PRIVILEGED_STACK_TEXT_AREA' to
128, which is not big enough. You must
through Kconfig either disable 'CONFIG_USERSPACE', or set
'CONFIG_PRIVILEGED_STACK_TEXT_AREA' to a value larger than
128 .
collect2: error: ld returned 1 exit status
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
pkt->buffer is represented by 1+ net_buf. If some are unused, this will
deallocates them.
This situation can happen on TCP where net_pkt allocator evaluates the
header size to its maximum size. Which space might not be (fully) used
in the end. On fixed data size buffer, this might end up by having last
buffer(s) not bein used. So better removing those.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This will take into account the family and the protocol, as well as
existing buffer occupation, to return the available buffer space that
can be used for payload.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The Kconfig symbol is CONFIG_LOG_DEFAULT_LEVEL not
CONFIG_LOG_DEFAULT_LOG_LEVEL. Fix references in comments to the actual
Kconfig symbol name.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit changes the names of SYS_POWER_DEEP_SLEEP* Kconfig
options in order to match SYS_POWER_LOW_POWER_STATE* naming
scheme.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
The SYS_POWER_LOW_POWER_STATE_SUPPORTED and SYS_POWER_LOW_POWER_STATE
suggests one low power state but these options control multiple
low power state. This commit uses plural in the names to indicate
that.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
Websocket was removed in 1cba0161ed so
remove dead Kconfig references to CONFIG_WEBSOCKET_CONSOLE and
associated dead code/files.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Part of Power Management API was incorrecty documented under
"Power Management Hook Interface" section. This commit fixes
that problem by introducing "System Power Management APIs".
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
At the moment application which chosen policy based power
management does not have an option to override decision
taken by the policy (it could only disable some power
states).
This commit adds the sys_pm_force_power_state() method,
which allow the application to choose power state used
when OS decide to suspend the SoC.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
If we include this header files in cpp source code,
the compiler say"error: template with C linkage".
Include <device.h> must be moved outside the 'extern "C"' section.
Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
When NEWLIB_LIBC=y, building the hwinfo drivers fails with:
In file included from ZEPHYR_ROOT/drivers/hwinfo/hwinfo_weak_impl.c:7:0:
ZEPHYR_ROOT/include/hwinfo.h:43:1: error: unknown type name '__syscall';
did you mean '__fastcall'?
__syscall ssize_t hwinfo_get_device_id(u8_t *buffer, size_t length);
^~~~~~~~~
__fastcall
ZEPHYR_ROOT/include/hwinfo.h:43:19: error: expected '=', ',', ';', 'asm'
or '__attribute__' before 'hwinfo_get_device_id'
__syscall ssize_t hwinfo_get_device_id(u8_t *buffer, size_t length);
^~~~~~~~~~~~~~~~~~~~
ZEPHYR_ROOT/drivers/hwinfo/hwinfo_weak_impl.c:9:16: error: expected '=',
',', ';', 'asm' or '__attribute__' before '_impl_hwinfo_get_device_id'
ssize_t __weak _impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
^~~~~~~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
The <hwinfo.h> file uses __syscall and this symbols is defined by
<kernel.h>. This doesn't happen with the real drivers as they include
<device.h> and thus <kernel.h>.
Fix that by including <kernel.h> from <hwinfo.h>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This patch adds a JSON web token library that adds the capability
to sign JSON tokens. This was located in subsys due to the dependency
on MBEDTLS, which resides in /ext.
Signed-off-by: David Brown <david.brown@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Shell will store only pointer to the prompt string instead of
copying it to the RAM buffer. It will save RAM memory and
it will simplify implementation of a new feature: "select"
command. When a command will be selected than shell will
display command syntax as a prompt.
Removed obsolete ASSERT check in a static function.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
One spinlock per pipe object. Also removed some vestigial locking
around _ready_thread(). That call is internally synchronized now.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>