Commit Graph

11 Commits

Author SHA1 Message Date
Jeff Andersen
0d385e7e57 Add uint_(least|fast)*_t types
This commit adds typedefs for signed and unsigned variants of the
_fast and _least integer types.

BUG=None
BRANCH=None
TEST=make buildall -J

Change-Id: Idefc8f9529d22f17af57859be3c25c36a7f8ec25
Reviewed-on: https://chromium-review.googlesource.com/602870
Commit-Ready: Jeff Andersen <jeffandersen@google.com>
Tested-by: Jeff Andersen <jeffandersen@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-08-07 19:29:13 -07:00
Jeff Andersen
b07cdf6bdd Add #defines for UINT62_MAX and INT64_MAX.
Some files being included in firmware expect <stdint.h> to provide
these definitions.

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: I7313f05d9925a8fdfc4d1d0e8eea6ebcf999802e
Reviewed-on: https://chromium-review.googlesource.com/484119
Commit-Ready: Jeff Andersen <jeffandersen@google.com>
Tested-by: Carl Hamilton <carlh@chromium.org>
Tested-by: Jeff Andersen <jeffandersen@google.com>
Reviewed-by: Carl Hamilton <carlh@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2017-04-25 16:32:49 -07:00
Vincent Palatin
0d858f1544 curve25519: strip-down, build and test
Keep only the most compact version of the curve25519 code
and remove the remaining unused code for easier compilation.
Do the minimal changes to make it compile in the EC code base,
there should be no real functional changes.

Re-use the wording from BoringSSL include/openssl/curve25519.h for the
header.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=chrome-os-partner:62991
TEST=run x25519 on host (ie 'make run-x25519')
and the STM32L4 target:
make BOARD=eve_fp PROJECT=x25519 TEST_BUILD=y
./util/flash_ec --board=eve_fp --image=build/eve_fp/x25519.bin
execute 'runtest' in the console.

Change-Id: I13dbe453eff39b461effb1b3ffa549afc1749fef
Reviewed-on: https://chromium-review.googlesource.com/444187
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Adam Langley <agl@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-02-23 16:02:03 -08:00
Nadim Taha
69c3fc2378 builtin: Expands string.h / stdint.h
Declares UINT8_MAX, INT8_MAX and defines strnlen(), strncpy(), strncmp() &
memchr(). Needed by a module I'm integrating into cr51.

BRANCH=none
BUG=none
TEST=make buildall -j

Change-Id: I894b0297216df1b945b36fc77cd3bc5c4ef8aa2b
Signed-off-by: Nadim Taha <ntaha@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/436786
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-02-17 01:46:31 +00:00
Johnnie Chan
3337c17efd Adding offsetof macro to stddef.h.
This duplicates the macro definition that exists in compile_time_macros.h.
Adding it is okay since they are both guarded by a #ifndef #endif check.
This is needed by code being pulled in from google3 which expects the
macro to be defined in the standard place.

BUG=none
BRANCH=none
TEST=make BOARD=haven_dev

Change-Id: Ibddefcd8bbfe0d121b3ce65950ce979e65778761
Reviewed-on: https://chromium-review.googlesource.com/403573
Commit-Ready: Johnnie Chan <johnniec@google.com>
Tested-by: Johnnie Chan <johnniec@google.com>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-10-26 19:59:17 -07:00
Carl Hamilton
066d1b6a5f Added "stdbool.h" and definition of uint_least8_t to "stdint.h".
The two types added, bool and uint_least8_t, are needed by the nanopb
common header file "pb.h".

The file added and the file modified are EC versions of files that are
normally provided by the compiler. This change follows the approach
already take to provide our own, mimimalist versions of these files.

BUG=none
BRANCH=none
TEST=make buildall -j

Change-Id: I892e25b14f7cbe3ecca6f60d6a2955d4d628e3a9
Reviewed-on: https://chromium-review.googlesource.com/398921
Commit-Ready: Carl Hamilton <carlh@chromium.org>
Tested-by: Carl Hamilton <carlh@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-10-17 17:41:06 -07:00
nagendra modadugu
e1dc48480f CR50: remove dependence of assert.h on util.h
Third party code includes standard system headers,
but may not have include paths configured for the
platform.

Remove the dependency between assert.h and
platform headers util.h, and panic.h.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=make buildall succeeds

Change-Id: Ic8d4dc1944765d2f0f80782afa574d7b8e54eb0f
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/347080
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-25 18:51:07 -07:00
nagendra modadugu
28827163c5 Move include/byteorder.h -> builtin/endian.h
Move endian routines to builtin/ so that portable third_party
code may build without glibc.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=none

Change-Id: Icb900d1e9c56dc68ec1ef4b536ebc9dcf6ebcd69
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/340432
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-04-22 20:40:03 -07:00
nagendra modadugu
1546b4de0b Add the memmove() function prototype to builtin/string.h
Add memmove() to builtin/string.h so that portable third_party
code may build without glibc.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=none

Change-Id: I8c165d71d9c01d2f869329b3600aac0970f41e71
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/340293
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
2016-04-22 12:02:30 -07:00
nagendra modadugu
c65700730d Add the memcmp() function prototype to builtin/string.h
Add memcmp() to builtin/string.h so that portable third_party
code may build without glibc.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=none
Signed-off-by: nagendra modadugu <ngm@google.com>

Change-Id: Id52c9c76fceac94bf1998958b43f42ad5d5298d3
Reviewed-on: https://chromium-review.googlesource.com/339878
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@google.com>
2016-04-21 03:08:16 -07:00
Stefan Reinauer
bc404c94b4 Enforce compilation without system headers
This patch introduces HOST_CPPFLAGS to be used for all
objects being compiled with HOSTCC rather then the target
compiler.

Since glibc is not linked into the EC, no glibc include files
should be included in the EC code base. Hence, create local
definitions for clock_t and wchar_t that match what the glibc
include would have done, and remove some unneeded includes.

Due to very eager optimization, we have to give gcc a little
notch to not kick out memset.

Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
BUG=chrome-os-partner:43025
BUG=chrome-os-partner:49517
BRANCH=none
TEST=compile tested

Change-Id: Idf3a2881fa8352756b0927b09c6a97473358f239
Reviewed-on: https://chromium-review.googlesource.com/322435
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-02-03 15:00:50 -08:00