diff --git a/firmware/include/ctype.h b/firmware/include/ctype.h new file mode 100644 index 0000000000000000000000000000000000000000..b227864c970063dc254b12a78572618887fed3eb --- /dev/null +++ b/firmware/include/ctype.h @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2014, Galois, Inc. + * This sotware is distributed under a standard, three-clause BSD license. + * Please see the file LICENSE, distributed with this software, for specific + * terms and conditions. + */ +#ifndef MINLIBC_CTYPE_H +#define MINLIBC_CTYPE_H + +int isdigit(int c); +int isspace(int c); +int tolower(int c); +int toupper(int c); + +#endif diff --git a/firmware/include/defines.h b/firmware/include/defines.h new file mode 100644 index 0000000000000000000000000000000000000000..d6dd6b8b4df3c4368f9c3f2724f7d39194b0053f --- /dev/null +++ b/firmware/include/defines.h @@ -0,0 +1,5 @@ +#define NUM_BITS_PER_TOKEN 16 +#define NUM_INPUT_NEURONS 5 +#define NUM_OUTPUT_NEURONS 16 +#define NUM_HIDDEN_NEURONS_W 5 +#define NUM_HIDDEN_NEURONS_H 6 diff --git a/firmware/io.h b/firmware/include/io.h similarity index 100% rename from firmware/io.h rename to firmware/include/io.h diff --git a/firmware/rnn.h b/firmware/include/rnn.h similarity index 100% rename from firmware/rnn.h rename to firmware/include/rnn.h diff --git a/firmware/include/stdlib.h b/firmware/include/stdlib.h new file mode 100644 index 0000000000000000000000000000000000000000..f116c4c093a79b75939ea382d892ad3ef57a2337 --- /dev/null +++ b/firmware/include/stdlib.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2014, Galois, Inc. + * This sotware is distributed under a standard, three-clause BSD license. + * Please see the file LICENSE, distributed with this software, for specific + * terms and conditions. + */ +#ifndef MINLIBC_STDLIB_H +#define MINLIBC_STDLIB_H + +#define NULL 0 +#define EXIT_SUCCESS 0 +#define EXIT_FAILURE 1 + +typedef unsigned long int size_t; + +double atof(const char *nptr); +int atoi(const char *nptr); +long int strtol(const char *nptr, char **endptr, int base); +unsigned long long strtoull (const char *__restrict, char **__restrict, int); + +char *getenv(const char *name); +void abort(void) __attribute__((noreturn)); +void exit(int status) __attribute__((noreturn)); + +void *malloc(size_t size); +void *realloc(void *ptr, size_t size); +void *calloc(size_t nmemb, size_t size); +void free(void *ptr); + +int mkstemp(char *template); + +void *bsearch(const void *, const void *, size_t, size_t, + int (*)(const void *, const void *)); + +int putenv(char *str); +int unsetenv(const char *name); + +int abs(int j); + +int rand (void); +void srand (unsigned); + +#endif diff --git a/firmware/string.h b/firmware/include/string.h similarity index 100% rename from firmware/string.h rename to firmware/include/string.h