Go to file
Nicolas Pitre f32330b22c stdint.h: streamline type definitions
Compilers (at least gcc and clang) already provide definitions to
create standard types and their range. For example, __INT16_TYPE__ is
normally defined as a short to be used with the int16_t typedef, and
__INT16_MAX__ is defined as 32767. So it makes sense to rely on them
rather than hardcoding our own, especially for the fast types where
the compiler itself knows what basic type is best.

Using compiler provided definitions makes even more sense when dealing
with 64-bit targets where some types such as intptr_t and size_t must
have a different size and range. Those definitions are then adjusted
by the compiler directly.

However there are two cases for which we should override those
definitions:

* The __INT32_TYPE__ definition on 32-bit targets vary between an int
  and a long int depending on the architecture and configuration.
  Notably, all compilers shipped with the Zephyr SDK, except for the
  i586-zephyr-elfiamcu variant, define __INT32_TYPE__ to a long int.
  Whereas, all Linux configurations for gcc, both 32-bit and 64-bit,
  always define __INT32_TYPE__ as an int. Having variability here is
  not welcome as pointers to a long int and to an int are not deemed
  compatible by the compiler, and printing an int32_t defined with a
  long using %d makes the compiler to complain, even if they're the
  same size on 32-bit targets. Given that an int is always 32 bits
  on all targets we might care about, and given that Zephyr hardcoded
  int32_t to an int before, then we just redefine __INT32_TYPE__ and
  derrivatives to an int to keep the peace in the code.

* The confusion also exists with __INTPTR_TYPE__. Looking again at the
  Zephyr SDK, it is defined as an int, even even when __INT32_TYPE__ is
  initially a long int. One notable exception is i586-zephyr-elf where
  __INTPTR_TYPE__ is a long int even when using -m32. On 64-bit targets
  this is always a long int. So let's redefine __INTPTR_TYPE__ to always
  be a long int on Zephyr which simplifies the code, works for both
  32-bit and 64-bit targets, and mimics what the Linux kernel does.
  Only a few print format strings needed adjustment.

In those two cases, there is a safeguard to ensure the type we're
enforcing has the right size and fail the build otherwise.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-25 23:29:22 -04:00
.github/ISSUE_TEMPLATE
.known-issues
arch stdint.h: streamline type definitions 2019-06-25 23:29:22 -04:00
boards boards: shields: x_nucleo_iks01a2: doc: update dead URL link 2019-06-25 10:44:30 -05:00
cmake cmake: toolchain_cc_imacros: don't use space separated arguments 2019-06-25 23:29:22 -04:00
doc scripts/dts: Remove DT_CHOSEN generation 2019-06-25 08:43:58 -05:00
drivers drivers: modem: modem_receiver.h: move header from /include/ 2019-06-25 15:27:00 -04:00
dts drivers/interrupt_controller/mvic.c: remove MVIC interrupt controller 2019-06-25 08:06:43 -04:00
ext drivers: clock_control: mcux_scg: add NXP MCUX SCG clock control driver 2019-06-24 14:33:46 -05:00
include stdint.h: streamline type definitions 2019-06-25 23:29:22 -04:00
kernel stdint.h: streamline type definitions 2019-06-25 23:29:22 -04:00
lib stdint.h: streamline type definitions 2019-06-25 23:29:22 -04:00
misc
modules ext: hal: st: move to modules 2019-06-18 13:08:07 -04:00
samples Bluetooth: central_hr: use new API to get value handle 2019-06-25 18:24:32 +02:00
scripts scripts: remove runner related cruft 2019-06-26 01:25:54 +02:00
soc include: move interrupt controller headers to interrupt_controller/ 2019-06-25 15:27:00 -04:00
subsys include: move system timer headers to include/drivers/timer/ 2019-06-25 15:27:00 -04:00
tests tests: thread_apis: exercise some system calls 2019-06-25 22:45:09 -04:00
.checkpatch.conf scripts/checkpatch.pl: fix root dir detection and enable it 2019-05-22 12:40:20 -04:00
.clang-format
.codecov.yml
.editorconfig
.gitattributes
.gitignore
.gitlint gitlint: match max title length restriction with checkpatch 2019-05-29 14:43:16 -04:00
.mailmap
.shippable.yml ci: move to new docker with new SDK 2019-06-14 09:26:40 -04:00
.uncrustify.cfg
CMakeLists.txt stdint.h: streamline type definitions 2019-06-25 23:29:22 -04:00
CODE_OF_CONDUCT.md
CODEOWNERS CODEOWNERS: remove non-existing files 2019-06-25 23:16:35 -04:00
CONTRIBUTING.rst
Kconfig
Kconfig.zephyr docs: fix misspelling across the tree 2019-06-19 15:34:13 -05:00
LICENSE
Makefile
README.rst doc: add references to builds mailing list 2019-05-21 21:40:20 -04:00
VERSION
version.h.in cmake: explain BUILD_VERSION and KERNEL_VERSION_* 2019-05-09 11:52:05 +02:00
west.yml ext: hal: st: move to modules 2019-06-18 13:08:07 -04:00
zephyr-env.cmd
zephyr-env.sh env: ignore unset var 2019-05-20 09:26:31 -04:00

.. raw:: html

   <a href="https://www.zephyrproject.org">
     <p align="center">
       <img src="doc/images/Zephyr-Project.png">
     </p>
   </a>

   <a href="https://bestpractices.coreinfrastructure.org/projects/74"><img
   src="https://bestpractices.coreinfrastructure.org/projects/74/badge"></a>
   <img
   src="https://api.shippable.com/projects/58ffb2b8baa5e307002e1d79/badge?branch=master">


The Zephyr Project is a scalable real-time operating system (RTOS) supporting
multiple hardware architectures, optimized for resource constrained devices,
and built with security in mind.

The Zephyr OS is based on a small-footprint kernel designed for use on
resource-constrained systems: from simple embedded environmental sensors and
LED wearables to sophisticated smart watches and IoT wireless gateways.

The Zephyr kernel supports multiple architectures, including ARM Cortex-M,
Intel x86, ARC, Nios II, Tensilica Xtensa, and RISC-V, and a large number of
`supported boards`_.

.. below included in doc/introduction/introduction.rst

.. start_include_here

Getting Started
***************

Welcome to Zephyr! See the `Introduction to Zephyr`_ for a high-level overview,
and the documentation's `Getting Started Guide`_ to start developing.

Community Support
*****************

Community support is provided via mailing lists and Slack; see the Resources
below for details.

Resources
*********

Here's a quick summary of resources to help you find your way around:

* **Help**: `Asking for Help Tips`_
* **Documentation**: http://docs.zephyrproject.org (`Getting Started Guide`_)
* **Source Code**: https://github.com/zephyrproject-rtos/zephyr is the main
  repository; https://elixir.bootlin.com/zephyr/latest/source contains a
  searchable index
* **Releases**: https://zephyrproject.org/developers/#downloads
* **Samples and example code**: see `Sample and Demo Code Examples`_
* **Mailing Lists**: users@lists.zephyrproject.org and
  devel@lists.zephyrproject.org are the main user and developer mailing lists,
  respectively. You can join the developer's list and search its archives at
  `Zephyr Development mailing list`_. The other `Zephyr mailing list
  subgroups`_ have their own archives and sign-up pages.
* **Nightly CI Build Status**: https://lists.zephyrproject.org/g/builds
  The builds@lists.zephyrproject.org mailing list archives the CI
  (shippable) nightly build results.
* **Chat**: Zephyr's Slack workspace is https://zephyrproject.slack.com.  Use
  this `Slack Invite`_ to register.
* **Contributing**: see the `Contribution Guide`_
* **Wiki**: `Zephyr GitHub wiki`_
* **Issues**: https://github.com/zephyrproject-rtos/zephyr/issues
* **Security Issues**: Email vulnerabilities@zephyrproject.org to report
  security issues; also see our `Security`_ documentation. Security issues are
  tracked separately at https://zephyrprojectsec.atlassian.net.
* **Zephyr Project Website**: https://zephyrproject.org

.. _Slack Invite: https://tinyurl.com/yarkuemx
.. _supported boards: http://docs.zephyrproject.org/latest/boards
.. _Zephyr Documentation: http://docs.zephyrproject.org
.. _Introduction to Zephyr: http://docs.zephyrproject.org/latest/introduction/index.html
.. _Getting Started Guide: http://docs.zephyrproject.org/latest/getting_started/index.html
.. _Contribution Guide: http://docs.zephyrproject.org/latest/contribute/index.html
.. _Zephyr GitHub wiki: https://github.com/zephyrproject-rtos/zephyr/wiki
.. _Zephyr Development mailing list: https://lists.zephyrproject.org/g/devel
.. _Zephyr mailing list subgroups: https://lists.zephyrproject.org/g/main/subgroups
.. _Sample and Demo Code Examples: http://docs.zephyrproject.org/latest/samples/index.html
.. _Security: http://docs.zephyrproject.org/latest/security/index.html
.. _Asking for Help Tips: https://docs.zephyrproject.org/latest/guides/getting-help.html