Remove <nodeputy.h> from default flags
authorZaheer Chothia <zchothia@inf.ethz.ch>
Sun, 14 Dec 2014 16:02:46 +0000 (17:02 +0100)
committerZaheer Chothia <zchothia@inf.ethz.ch>
Wed, 17 Dec 2014 12:48:36 +0000 (13:48 +0100)
Summary:
Deputy annotations [1] can be used to label safety properties.  They are
used extensively in the kernel, but in user-space there is only one use.
The macros have short names (like 'COUNT', 'SAFE') which can conflict
when building other applications.  Furthermore, these are not being
checked and are just stripped during the build.

Note: the change to <kernel.h> is needed because it is included from a
generated file:
  build-x86_64/capabilities/cap_predicates.c

[1] http://ivy.cs.berkeley.edu/ivywiki/uploads/deputy-manual.html

Test Plan: `make clean && make` was successful

Differential Revision: https://code.systems.ethz.ch/D6

hake/ArchDefaults.hs
include/elf/elf.h
kernel/include/kernel.h
lib/elf/elf32.c
lib/elf/elf64.c
tools/elver/Hakefile
tools/weever/elf64.c

index e8ac60d..fac81a2 100644 (file)
@@ -26,9 +26,7 @@ commonFlags = [ Str s | s <- [ "-fno-builtin",
                                 "-Wmissing-declarations",
                                 "-Wmissing-field-initializers",
                                 "-Wredundant-decls",
-                                "-Werror",
-                                "-imacros" ] ]
-         ++ [ NoDep SrcTree "src" "/include/deputy/nodeputy.h" ]
+                                "-Werror" ] ]
 
 commonCFlags = [ Str s | s <- [ "-std=c99",
                                 "-U__STRICT_ANSI__", -- for newlib headers
index 2f6f0f4..c9145a0 100644 (file)
@@ -761,12 +761,12 @@ const char *
 elf32_get_symbolname(struct Elf32_Ehdr *head, struct Elf32_Sym *sym);
 
 void elf64_relocate(genvaddr_t dst, genvaddr_t src,
-                    struct Elf64_Rela * SAFE NONNULL rela, size_t size,
-                    struct Elf64_Sym * SAFE NONNULL symtab, size_t symsize,
+                    struct Elf64_Rela * rela, size_t size,
+                    struct Elf64_Sym * symtab, size_t symsize,
                     genvaddr_t start, void *vbase);
 void elf32_relocate(genvaddr_t dst, genvaddr_t src,
-                    struct Elf32_Rel * SAFE NONNULL rela, size_t size,
-                    struct Elf32_Sym * SAFE NONNULL symtab, size_t symsize,
+                    struct Elf32_Rel * rela, size_t size,
+                    struct Elf32_Sym * symtab, size_t symsize,
                     genvaddr_t start, void *vbase);
 
 typedef errval_t (*elf_allocator_fn)(void *state, genvaddr_t base,
index 8ae54ed..27f8bde 100644 (file)
@@ -115,12 +115,12 @@ static inline int bitaddralign(size_t n, lpaddr_t base_addr)
 #define LOG_DEBUG       4       ///< Debug
 
 void debug_print_backtrace(void);
-void panic(const char * NTS, ...)
+void panic(const char *, ...)
     __attribute__((noreturn, format(printf, 1, 2)));
 void breakpoint(void);
 void printk(int level, const char *msg, ...)
     __attribute__ ((format(printf, 2, 3)));
-int printf_nolog(const char * NTS fmt, ...)
+int printf_nolog(const char * fmt, ...)
     __attribute__ ((format(printf, 1, 2)));
 void wait_cycles(uint64_t duration);
 void kernel_startup_early(void);
index f3a1541..d563c12 100644 (file)
@@ -390,8 +390,8 @@ elf32_get_symbolname(struct Elf32_Ehdr *head,
  * \param vbase         Pointer to ELF image in virtual memory.
  */
 void elf32_relocate(genvaddr_t dst, genvaddr_t src,
-                    struct Elf32_Rel * SAFE NONNULL rel, size_t size,
-                    struct Elf32_Sym * SAFE NONNULL symtab, size_t symsize,
+                    struct Elf32_Rel * rel, size_t size,
+                    struct Elf32_Sym * symtab, size_t symsize,
                     genvaddr_t start, void *vbase)
 {
     genvaddr_t base = dst - src, abase = dst - start;
index bcfc395..0d014f1 100644 (file)
@@ -69,8 +69,8 @@ genvaddr_t elf_virtual_base64(struct Elf64_Ehdr *ehead)
  *
  * \return Pointer to first ELF section header of type 'type', or NULL.
  */
-struct Elf64_Shdr * SAFE
-elf64_find_section_header_type(struct Elf64_Shdr * SAFE NONNULL shdr,
+struct Elf64_Shdr *
+elf64_find_section_header_type(struct Elf64_Shdr * shdr,
                                uint32_t entries, uint32_t type)
 {
     int i;
@@ -366,8 +366,8 @@ elf64_find_symbol_by_addr(genvaddr_t elf_base, size_t elf_bytes,
  *
  * \return Pointer to first ELF section header loaded at 'addr', or NULL.
  */
-static struct Elf64_Shdr * SAFE
-elf64_find_section_header_vaddr(struct Elf64_Shdr * SAFE NONNULL shdr,
+static struct Elf64_Shdr *
+elf64_find_section_header_vaddr(struct Elf64_Shdr * shdr,
                                 uint32_t entries, genvaddr_t addr)
 {
     int i;
@@ -402,8 +402,8 @@ elf64_find_section_header_vaddr(struct Elf64_Shdr * SAFE NONNULL shdr,
  * \param vbase         Pointer to ELF image in virtual memory.
  */
 void elf64_relocate(genvaddr_t dst, genvaddr_t src,
-                    struct Elf64_Rela * SAFE NONNULL rela, size_t size,
-                    struct Elf64_Sym * SAFE NONNULL symtab, size_t symsize,
+                    struct Elf64_Rela * rela, size_t size,
+                    struct Elf64_Sym * symtab, size_t symsize,
                     genvaddr_t start, void *vbase)
 {
     genvaddr_t base = dst - src, abase = dst - start;
index 2a2ddee..ed48729 100644 (file)
@@ -45,9 +45,7 @@ let arch = "x86_64"
                                            "-Wmissing-declarations",
                                            "-Wmissing-field-initializers",
                                            "-Wredundant-decls",
-                                           "-Werror" ] ]
-                          ++ [ Str "-imacros",
-                               NoDep SrcTree "src" "/include/deputy/nodeputy.h" ],
+                                           "-Werror" ] ],
              optIncludes = [ NoDep SrcTree "src" "/include",
                              NoDep SrcTree "src" "/include/oldc", 
                              NoDep SrcTree "src" "/include/c", 
index 6ed18bf..2fcbf39 100644 (file)
@@ -109,8 +109,8 @@ genvaddr_t elf_virtual_base64(struct Elf64_Ehdr *ehead)
  *
  * \return Pointer to first ELF section header of type 'type', or NULL.
  */
-struct Elf64_Shdr * SAFE
-elf64_find_section_header_type(struct Elf64_Shdr * SAFE NONNULL shdr,
+struct Elf64_Shdr *
+elf64_find_section_header_type(struct Elf64_Shdr * shdr,
                                uint32_t entries, uint32_t type)
 {
     int i;
@@ -182,8 +182,8 @@ elf64_find_section_header_name(genvaddr_t  elf_base,
  *
  * \return Pointer to first ELF section header loaded at 'addr', or NULL.
  */
-static struct Elf64_Shdr * SAFE
-elf64_find_section_header_vaddr(struct Elf64_Shdr * SAFE NONNULL shdr,
+static struct Elf64_Shdr *
+elf64_find_section_header_vaddr(struct Elf64_Shdr * shdr,
                                 uint32_t entries, genvaddr_t addr)
 {
     int i;
@@ -218,8 +218,8 @@ elf64_find_section_header_vaddr(struct Elf64_Shdr * SAFE NONNULL shdr,
  * \param vbase         Pointer to ELF image in virtual memory.
  */
 void elf64_relocate(genvaddr_t dst, genvaddr_t src,
-                    struct Elf64_Rela * SAFE NONNULL rela, size_t size,
-                    struct Elf64_Sym * SAFE NONNULL symtab, size_t symsize,
+                    struct Elf64_Rela * rela, size_t size,
+                    struct Elf64_Sym * symtab, size_t symsize,
                     genvaddr_t start, void *vbase)
 {
     genvaddr_t base = dst - src, abase = dst - start;