Eliminate exposure of non-public microkernel structures
Renames the include file defining non-public microkernel structures from k_struct.h to kernel_structures.h, and relocates it to the microkernel's non-public include file directory. This means that applications and drivers including the microkernel's public APIs, using microkernel.h, can no longer access non-public information. Note: This change also eliminates some redundant #includes by the microkernel's own subsystems, since the inclusion of minik.h brings in the vast majority of public and non-public APIs. Change-Id: Ic7d9ec1ebb8a124ccd0aaad98b50e16c197ffa00 Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
parent
4a56570f9c
commit
a02396098d
38 changed files with 45 additions and 54 deletions
|
@ -41,8 +41,8 @@ the PendSV exception.
|
|||
*/
|
||||
|
||||
#ifdef CONFIG_MICROKERNEL
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <microkernel.h>
|
||||
#include <kernel_struct.h>
|
||||
#endif
|
||||
|
||||
#include <nanok.h>
|
||||
|
|
|
@ -43,7 +43,6 @@ Currently empty, only here for abstraction.
|
|||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <minik.h>
|
||||
#include <nanok.h>
|
||||
#include <cputype.h>
|
||||
|
|
|
@ -39,8 +39,8 @@ processor architecture.
|
|||
/* includes */
|
||||
|
||||
#ifdef CONFIG_MICROKERNEL
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <microkernel.h>
|
||||
#include <kernel_struct.h>
|
||||
#endif /* CONFIG_MICROKERNEL */
|
||||
|
||||
#include <toolchain.h>
|
||||
|
|
|
@ -96,8 +96,8 @@ enable FP resource sharing on its behalf.
|
|||
*/
|
||||
|
||||
#ifdef CONFIG_MICROKERNEL
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <microkernel.h>
|
||||
#include <kernel_struct.h>
|
||||
#endif /* CONFIG_MICROKERNEL */
|
||||
|
||||
#include <nanok.h>
|
||||
|
|
|
@ -41,7 +41,6 @@ Intel-specific parts of start_task(). Only FP functionality currently.
|
|||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <minik.h>
|
||||
#include <nanok.h>
|
||||
#include <cputype.h>
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
/* includes */
|
||||
|
||||
#include <nanokernel.h>
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <clock_vars.h>
|
||||
|
||||
/* externs */
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <minik.h>
|
||||
#include <ch_buff.h>
|
||||
|
||||
|
|
|
@ -30,9 +30,8 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -32,9 +32,8 @@
|
|||
|
||||
/* includes */
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
|
@ -30,9 +30,8 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -32,9 +32,8 @@
|
|||
|
||||
/* includes */
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <microkernel/chan.h>
|
||||
#include <toolchain.h>
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <minik.h>
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
|
|
|
@ -30,9 +30,8 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
#include <misc/__assert.h>
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
|
|
|
@ -30,9 +30,8 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
#include <misc/__assert.h>
|
||||
|
|
|
@ -30,9 +30,8 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
#include <misc/__assert.h>
|
||||
|
|
|
@ -30,9 +30,8 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
#include <misc/__assert.h>
|
||||
|
|
|
@ -30,9 +30,8 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
#include <misc/__assert.h>
|
||||
|
|
|
@ -30,9 +30,8 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
#include <misc/__assert.h>
|
||||
|
|
|
@ -30,9 +30,8 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
#include <misc/__assert.h>
|
||||
|
|
|
@ -32,9 +32,8 @@
|
|||
|
||||
/* includes */
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
#include <misc/__assert.h>
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
/* includes */
|
||||
|
||||
#include <microkernel.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
#include <misc/__assert.h>
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
/* includes */
|
||||
|
||||
#include <microkernel.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
#include <misc/__assert.h>
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
/* includes */
|
||||
|
||||
#include <microkernel.h>
|
||||
#include <kchan.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
#include <misc/__assert.h>
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <minik.h>
|
||||
#include <kchan.h>
|
||||
#include <string_s.h>
|
||||
|
|
|
@ -56,7 +56,6 @@ that have an ISR component should use their own command packet set.
|
|||
|
||||
#include <nanokernel.h>
|
||||
#include <nanokernel/cpu.h>
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <microkernel/cmdPkt.h>
|
||||
#include <minik.h>
|
||||
#include <sections.h>
|
||||
|
|
|
@ -36,7 +36,6 @@ Microkernel idle logic. Different forms of idling are performed by the idle
|
|||
task, depending on how the kernel is configured.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <minik.h>
|
||||
#include <nanok.h>
|
||||
#include <nanokernel/cpu.h>
|
||||
|
|
|
@ -33,8 +33,6 @@
|
|||
#ifndef _ENTRIES_H
|
||||
#define _ENTRIES_H
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* microkernel/k_struct.h */
|
||||
/* major non-public microkernel structures */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997-2015 Wind River Systems, Inc.
|
||||
|
@ -30,8 +30,8 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _K_STRUCT_H
|
||||
#define _K_STRUCT_H
|
||||
#ifndef _KERNEL_STRUCT_H
|
||||
#define _KERNEL_STRUCT_H
|
||||
|
||||
#include <microkernel/k_types.h>
|
||||
#include <microkernel/k_chstr.h>
|
||||
|
@ -502,4 +502,4 @@ struct evstr {
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* _K_STRUCT_H */
|
||||
#endif /* _KERNEL_STRUCT_H */
|
|
@ -33,7 +33,7 @@
|
|||
#ifndef MINIK_H
|
||||
#define MINIK_H
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <kernel_struct.h>
|
||||
#include <kernel_main.h>
|
||||
#include <clock_vars.h>
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "microkernel/k_struct.h"
|
||||
#include "minik.h"
|
||||
#include "microkernel/event.h"
|
||||
#include <toolchain.h>
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "microkernel/k_struct.h"
|
||||
#include "minik.h" /* _k_mem_map_list, _k_mem_map_count */
|
||||
#include <sections.h>
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ single invocation of the K_swapper fiber. However, it can also be used by
|
|||
a task to measure the overhead involved in issuing a kernel service request.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <minik.h>
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <minik.h>
|
||||
#include <string.h>
|
||||
#include <toolchain.h>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
/* includes */
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <minik.h>
|
||||
#include <string_s.h>
|
||||
#include <toolchain.h>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
#ifdef CONFIG_TASK_MONITOR
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <minik.h>
|
||||
#include <microkernel/ticks.h>
|
||||
#include <drivers/system_timer.h>
|
||||
|
|
|
@ -38,7 +38,6 @@ This module implements the microkernel's tick event handler.
|
|||
#include <nanokernel.h>
|
||||
#include <nanokernel/cpu.h>
|
||||
|
||||
#include <microkernel/k_struct.h>
|
||||
#include <minik.h>
|
||||
#include <drivers/system_timer.h>
|
||||
#include <microkernel.h>
|
||||
|
|
|
@ -38,7 +38,8 @@
|
|||
|
||||
# Generates:
|
||||
# - kernel_main.c file
|
||||
# - kernel_main.h file
|
||||
# - kernel_main.h file (local copy)
|
||||
# - kernel_struct.h file (local copy)
|
||||
# - vxmicro.h file
|
||||
|
||||
import os
|
||||
|
@ -305,6 +306,7 @@ def kernel_main_c_header():
|
|||
"\n" +
|
||||
"#include <vxmicro.h>\n" +
|
||||
"#include <drivers/system_timer.h>\n" +
|
||||
"#include <kernel_struct.h>\n" +
|
||||
"#include <kernel_main.h>\n" +
|
||||
"#include <toolchain.h>\n" +
|
||||
"#include <sections.h>\n")
|
||||
|
@ -1058,6 +1060,24 @@ def kernel_main_h_generate():
|
|||
output_dir])
|
||||
|
||||
|
||||
#
|
||||
# GENERATE kernel_struct.h FILE
|
||||
#
|
||||
|
||||
|
||||
def kernel_struct_h_generate():
|
||||
""" Generate kernel_struct.h file """
|
||||
|
||||
global output_dir
|
||||
|
||||
subprocess.check_call([
|
||||
"cp",
|
||||
"-f",
|
||||
os.environ["VXMICRO_BASE"] +
|
||||
"/kernel/microkernel/include/kernel_struct.h",
|
||||
output_dir])
|
||||
|
||||
|
||||
#
|
||||
# GENERATE vxmicro.h FILE
|
||||
#
|
||||
|
@ -1178,4 +1198,5 @@ vpf_parse()
|
|||
get_output_dir()
|
||||
kernel_main_c_generate()
|
||||
kernel_main_h_generate()
|
||||
kernel_struct_h_generate()
|
||||
vxmicro_h_generate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue