[inc][c++] add some additional __BEGIN_CDECL/__END_CDECLS to various global headers

Just a few that were missed, and picked up with some additional C++ code.
This commit is contained in:
Travis Geiselbrecht
2021-01-19 22:17:15 -08:00
parent 3083f63253
commit 7033559d38
10 changed files with 37 additions and 2 deletions

View File

@@ -46,3 +46,5 @@ static int atomic_or(volatile int *ptr, int val);
#endif
__END_CDECLS

View File

@@ -7,10 +7,15 @@
*/
#pragma once
#include <lk/compiler.h>
#include <sys/types.h>
#include <kernel/mp.h>
__BEGIN_CDECLS
/* send inter processor interrupt, if supported */
status_t arch_mp_send_ipi(mp_cpu_mask_t target, mp_ipi_t ipi);
void arch_mp_init_percpu(void);
__END_CDECLS

View File

@@ -9,9 +9,13 @@
// give the arch code a chance to declare the arch_thread struct
#include <arch/arch_thread.h>
#include <lk/compiler.h>
__BEGIN_CDECLS
struct thread;
void arch_thread_initialize(struct thread *);
void arch_context_switch(struct thread *oldthread, struct thread *newthread);
__END_CDECLS

View File

@@ -86,7 +86,7 @@ static inline void mp_init(void) {}
static inline void mp_reschedule(mp_cpu_mask_t target, uint flags) {}
static inline void mp_set_curr_cpu_active(bool active) {}
static inline enum handler_return mp_mbx_reschedule_irq(void) { return 0; }
static inline enum handler_return mp_mbx_reschedule_irq(void) { return INT_NO_RESCHEDULE; }
// only one cpu exists in UP and if you're calling these functions, it's active...
static inline int mp_is_cpu_active(uint cpu) { return 1; }

View File

@@ -10,6 +10,9 @@
#include <arch.h>
#include <stddef.h>
#include <stdlib.h>
#include <lk/compiler.h>
__BEGIN_CDECLS
#define PAGE_ALIGN(x) ALIGN(x, PAGE_SIZE)
#define IS_PAGE_ALIGNED(x) IS_ALIGNED(x, PAGE_SIZE)
@@ -35,3 +38,5 @@ struct page_range {
};
int novm_get_arenas(struct page_range *ranges, int number_of_ranges);
__END_CDECLS

View File

@@ -7,6 +7,9 @@
*/
#pragma once
#include <lk/compiler.h>
__BEGIN_CDECLS
/* Previously, this file was included to get access to defining a console
* command. This logic has been moved into the following header, which is
@@ -33,4 +36,4 @@ extern int lastresult;
#define ENABLE_PANIC_SHELL 1
#endif
__END_CDECLS

View File

@@ -10,6 +10,9 @@
#include <stdbool.h>
#include <stddef.h>
#include <sys/types.h>
#include <lk/compiler.h>
__BEGIN_CDECLS
/* included from top level lk/console_cmd.h when lib/console is built.
* Provides definitions for how to register a command block to be picked up by
@@ -50,4 +53,5 @@ typedef struct _cmd_block {
#define STATIC_COMMAND_MASKED(command_str, help_str, func, availability_mask) \
{ command_str, help_str, func, availability_mask },
__END_CDECLS

View File

@@ -12,6 +12,8 @@
#include <stddef.h>
#include <sys/types.h>
__BEGIN_CDECLS
/* command args */
typedef struct {
const char *str;
@@ -27,6 +29,8 @@ typedef int (*console_cmd_func)(int argc, const console_cmd_args *argv);
#define CMD_AVAIL_PANIC (0x1 << 1)
#define CMD_AVAIL_ALWAYS (CMD_AVAIL_NORMAL | CMD_AVAIL_PANIC)
__END_CDECLS
/* Register a static block of commands at init time when lib/console is
* paret of the build. Otherwise stub out these definitions so that they do
* not get included.
@@ -47,4 +51,5 @@ typedef int (*console_cmd_func)(int argc, const console_cmd_args *argv);
#define STATIC_COMMAND(command_str, help_str, func)
#define STATIC_COMMAND_MASKED(command_str, help_str, func, availability_mask)
#endif

View File

@@ -10,6 +10,8 @@
#include <lk/compiler.h>
#include <sys/types.h>
__BEGIN_CDECLS
/*
* LK's init system
*/
@@ -69,3 +71,5 @@ struct lk_init_struct {
#define LK_INIT_HOOK(_name, _hook, _level) \
LK_INIT_HOOK_FLAGS(_name, _hook, _level, LK_INIT_FLAG_PRIMARY_CPU)
__END_CDECLS

View File

@@ -10,7 +10,10 @@
#include <lk/compiler.h>
#include <sys/types.h>
__BEGIN_CDECLS
void lk_main(ulong arg0, ulong arg1, ulong arg2, ulong arg3) __NO_RETURN __EXTERNALLY_VISIBLE;
void lk_secondary_cpu_entry(void);
void lk_init_secondary_cpus(uint secondary_cpu_count);
__END_CDECLS