trezorhal: reorder stuff in common.{c,h}; remove unnecessary externs for functions

pull/25/head
Pavol Rusnak 7 years ago
parent d9574bf131
commit 879a3e85bd
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -318,7 +318,7 @@ static bool _read_payload(pb_istream_t *stream, const pb_field_t *field, void **
static image_header hdr;
extern secbool load_vendor_header_keys(const uint8_t * const data, vendor_header * const vhdr);
secbool load_vendor_header_keys(const uint8_t * const data, vendor_header * const vhdr);
secbool compare_to_current_vendor_header(const vendor_header * const new_vhdr)
{

@ -385,7 +385,7 @@ void display_print(const char *text, int textlen)
}
#ifndef TREZOR_UNIX
extern int mini_vsnprintf(char* buffer, unsigned int buffer_len, const char *fmt, va_list va);
int mini_vsnprintf(char* buffer, unsigned int buffer_len, const char *fmt, va_list va);
#endif
// variadic display_print

@ -30,13 +30,6 @@ void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg,
for (;;);
}
uint32_t __stack_chk_guard = 0;
void __attribute__((noreturn)) __stack_chk_fail(void)
{
ensure(secfalse, "Stack smashing detected");
}
#ifndef NDEBUG
void __assert_func(const char *file, int line, const char *func, const char *expr) {
__fatal_error(expr, "assert failed", file, line, func);
@ -59,3 +52,10 @@ void clear_otg_hs_memory(void)
memset_reg((volatile void *) USB_OTG_HS_DATA_FIFO_RAM, (volatile void *) (USB_OTG_HS_DATA_FIFO_RAM + USB_OTG_HS_DATA_FIFO_SIZE), 0);
__HAL_RCC_USB_OTG_HS_CLK_DISABLE(); // disable USB OTG_HS peripheral clock as the peripheral is not needed right now
}
uint32_t __stack_chk_guard = 0;
void __attribute__((noreturn)) __stack_chk_fail(void)
{
ensure(secfalse, "Stack smashing detected");
}

@ -4,20 +4,20 @@
#include <stdint.h>
#include "secbool.h"
extern void memset_reg(volatile void *start, volatile void *stop, uint32_t val);
void clear_otg_hs_memory(void);
void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, const char *file, int line, const char *func);
#define ensure(expr, msg) (((expr) == sectrue) ? (void)0 : __fatal_error(#expr, msg, __FILE__, __LINE__, __func__))
void jump_to(uint32_t address);
void hal_delay(uint32_t ms);
void shutdown(void);
void clear_otg_hs_memory(void);
extern uint32_t __stack_chk_guard;
// the following functions are defined in util.s
void memset_reg(volatile void *start, volatile void *stop, uint32_t val);
void jump_to(uint32_t address);
void shutdown(void);
#endif

@ -52,7 +52,7 @@ void SysTick_Handler(void)
uwTick++;
}
extern void shutdown(void);
void shutdown(void);
void PVD_IRQHandler(void)
{

Loading…
Cancel
Save