[app][warnings] fix -Wmissing-declarations warnings in app/
This commit is contained in:
@@ -35,6 +35,8 @@
|
|||||||
#include <platform/zynq.h>
|
#include <platform/zynq.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "lkboot.h"
|
||||||
|
|
||||||
#define bootdevice "spi0"
|
#define bootdevice "spi0"
|
||||||
|
|
||||||
#define LOCAL_TRACE 0
|
#define LOCAL_TRACE 0
|
||||||
|
|||||||
@@ -279,6 +279,7 @@ static status_t lkboot_server(lk_time_t timeout) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* platform code can override this to conditionally abort autobooting from flash */
|
/* platform code can override this to conditionally abort autobooting from flash */
|
||||||
|
bool platform_abort_autoboot(void);
|
||||||
__WEAK bool platform_abort_autoboot(void) {
|
__WEAK bool platform_abort_autoboot(void) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ exit:
|
|||||||
elf_close_handle(&elf);
|
elf_close_handle(&elf);
|
||||||
}
|
}
|
||||||
|
|
||||||
int tftp_callback(void *data, size_t len, void *arg) {
|
static int tftp_callback(void *data, size_t len, void *arg) {
|
||||||
download_t *download = arg;
|
download_t *download = arg;
|
||||||
size_t final_len;
|
size_t final_len;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016 Travis Geiselbrecht
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a MIT-style
|
||||||
|
* license that can be found in the LICENSE file or at
|
||||||
|
* https://opensource.org/licenses/MIT
|
||||||
|
*/
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <lk/debug.h>
|
#include <lk/debug.h>
|
||||||
#include <lk/err.h>
|
#include <lk/err.h>
|
||||||
@@ -5,6 +12,7 @@
|
|||||||
#include <lk/console_cmd.h>
|
#include <lk/console_cmd.h>
|
||||||
#include <lib/heap.h>
|
#include <lib/heap.h>
|
||||||
#include <rand.h>
|
#include <rand.h>
|
||||||
|
#include <app/tests.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define ASSERT_EQ(a, b) \
|
#define ASSERT_EQ(a, b) \
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ bail:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int two_threads_basic(void) {
|
static int two_threads_basic(void) {
|
||||||
port_t w_port;
|
port_t w_port;
|
||||||
status_t st = port_create("ping_port", PORT_MODE_BROADCAST, &w_port);
|
status_t st = port_create("ping_port", PORT_MODE_BROADCAST, &w_port);
|
||||||
if (st < 0) {
|
if (st < 0) {
|
||||||
@@ -401,7 +401,7 @@ typedef struct {
|
|||||||
port_t port;
|
port_t port;
|
||||||
} watcher_cmd;
|
} watcher_cmd;
|
||||||
|
|
||||||
status_t send_watcher_cmd(port_t cmd_port, action_t action, port_t port) {
|
static status_t send_watcher_cmd(port_t cmd_port, action_t action, port_t port) {
|
||||||
watcher_cmd _cmd = {action, port};
|
watcher_cmd _cmd = {action, port};
|
||||||
return port_write(cmd_port, ((port_packet_t *) &_cmd), 1);;
|
return port_write(cmd_port, ((port_packet_t *) &_cmd), 1);;
|
||||||
}
|
}
|
||||||
@@ -487,7 +487,7 @@ static status_t make_port_pair(const char *name, void *ctx, port_t *write, port_
|
|||||||
return port_open(name,ctx, read);
|
return port_open(name,ctx, read);
|
||||||
}
|
}
|
||||||
|
|
||||||
int group_basic(void) {
|
static int group_basic(void) {
|
||||||
// we spin a thread that connects to a well known port, then we
|
// we spin a thread that connects to a well known port, then we
|
||||||
// send two ports that it will add to a group port.
|
// send two ports that it will add to a group port.
|
||||||
port_t cmd_port;
|
port_t cmd_port;
|
||||||
@@ -563,7 +563,7 @@ int group_basic(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int group_dynamic(void) {
|
static int group_dynamic(void) {
|
||||||
status_t st;
|
status_t st;
|
||||||
|
|
||||||
port_t w_test_port1, r_test_port1;
|
port_t w_test_port1, r_test_port1;
|
||||||
@@ -631,7 +631,7 @@ int group_dynamic(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
event_t group_waiting_sync_evt;
|
static event_t group_waiting_sync_evt;
|
||||||
|
|
||||||
static int receive_thread(void *arg) {
|
static int receive_thread(void *arg) {
|
||||||
port_t pg = (port_t)arg;
|
port_t pg = (port_t)arg;
|
||||||
@@ -651,7 +651,7 @@ static int receive_thread(void *arg) {
|
|||||||
/* Test the edge case where a read port with data available is added to a port
|
/* Test the edge case where a read port with data available is added to a port
|
||||||
* group that has a read-blocked receiver.
|
* group that has a read-blocked receiver.
|
||||||
*/
|
*/
|
||||||
int group_waiting(void) {
|
static int group_waiting(void) {
|
||||||
status_t st;
|
status_t st;
|
||||||
|
|
||||||
event_init(&group_waiting_sync_evt, false, EVENT_FLAG_AUTOUNSIGNAL);
|
event_init(&group_waiting_sync_evt, false, EVENT_FLAG_AUTOUNSIGNAL);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ static int sleep_thread(void *arg) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sleep_test(void) {
|
static int sleep_test(void) {
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i < 16; i++)
|
for (i=0; i < 16; i++)
|
||||||
thread_detach_and_resume(thread_create("sleeper", &sleep_thread, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE));
|
thread_detach_and_resume(thread_create("sleeper", &sleep_thread, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE));
|
||||||
@@ -165,7 +165,7 @@ static int mutex_zerotimeout_thread(void *arg) {
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mutex_test(void) {
|
static int mutex_test(void) {
|
||||||
static mutex_t imutex = MUTEX_INITIAL_VALUE(imutex);
|
static mutex_t imutex = MUTEX_INITIAL_VALUE(imutex);
|
||||||
printf("preinitialized mutex:\n");
|
printf("preinitialized mutex:\n");
|
||||||
hexdump(&imutex, sizeof(imutex));
|
hexdump(&imutex, sizeof(imutex));
|
||||||
@@ -252,7 +252,7 @@ static int event_waiter(void *arg) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void event_test(void) {
|
static void event_test(void) {
|
||||||
thread_t *threads[5];
|
thread_t *threads[5];
|
||||||
|
|
||||||
static event_t ievent = EVENT_INITIAL_VALUE(ievent, true, 0x1234);
|
static event_t ievent = EVENT_INITIAL_VALUE(ievent, true, 0x1234);
|
||||||
@@ -306,7 +306,7 @@ static int quantum_tester(void *arg) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void quantum_test(void) {
|
static void quantum_test(void) {
|
||||||
thread_detach_and_resume(thread_create("quantum tester 0", &quantum_tester, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE));
|
thread_detach_and_resume(thread_create("quantum tester 0", &quantum_tester, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE));
|
||||||
thread_detach_and_resume(thread_create("quantum tester 1", &quantum_tester, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE));
|
thread_detach_and_resume(thread_create("quantum tester 1", &quantum_tester, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE));
|
||||||
thread_detach_and_resume(thread_create("quantum tester 2", &quantum_tester, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE));
|
thread_detach_and_resume(thread_create("quantum tester 2", &quantum_tester, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE));
|
||||||
@@ -338,7 +338,7 @@ static int context_switch_tester(void *arg) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void context_switch_test(void) {
|
static void context_switch_test(void) {
|
||||||
event_init(&context_switch_event, false, 0);
|
event_init(&context_switch_event, false, 0);
|
||||||
event_init(&context_switch_done_event, false, 0);
|
event_init(&context_switch_done_event, false, 0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user