sysgen: Improve location of functions and global variables

Relocates a handful of functions and global variables that were
located in places that were logically inconsistent with most other
functions and variables.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
Allan Stephens 2015-04-15 15:36:02 -04:00 committed by Anas Nashif
commit 779932139c

View file

@ -66,9 +66,56 @@ group_key_list = []
# global variables used during generation of output files
kernel_main_c_data = ""
vxmicro_h_data = ""
micro_objs_h_data = ""
do_not_edit_warning = \
"\n\n\n/* THIS FILE IS AUTOGENERATED -- DO NOT MODIFY! */\n\n\n"
copyright = \
"/*\n" + \
" * Copyright (c) 2015 Wind River Systems, Inc.\n" + \
" *\n" + \
" * Redistribution and use in source and binary forms," + \
" with or without\n" + \
" * modification, are permitted provided that the following conditions" + \
" are met:\n" + \
" *\n" + \
" * 1) Redistributions of source code must retain" + \
" the above copyright notice,\n" + \
" * this list of conditions and the following disclaimer.\n" + \
" *\n" + \
" * 2) Redistributions in binary form must reproduce" + \
" the above copyright notice,\n" + \
" * this list of conditions and the following disclaimer" + \
" in the documentation\n" + \
" * and/or other materials provided with the distribution.\n" + \
" *\n" + \
" * 3) Neither the name of Wind River Systems nor the names" + \
" of its contributors\n" + \
" * may be used to endorse or promote products derived" + \
" from this software without\n" + \
" * specific prior written permission.\n" + \
" *\n" + \
" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS" + \
" AND CONTRIBUTORS \"AS IS\"\n" + \
" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING," + \
" BUT NOT LIMITED TO, THE\n" + \
" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS" + \
" FOR A PARTICULAR PURPOSE\n" + \
" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER" + \
" OR CONTRIBUTORS BE\n" + \
" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL," + \
" EXEMPLARY, OR\n" + \
" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO," + \
" PROCUREMENT OF\n" + \
" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;" + \
" OR BUSINESS\n" + \
" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY," + \
" WHETHER IN\n" + \
" * CONTRACT, STRICT LIABILITY, OR TORT" + \
" (INCLUDING NEGLIGENCE OR OTHERWISE)\n" + \
" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE," + \
" EVEN IF ADVISED OF THE\n" + \
" * POSSIBILITY OF SUCH DAMAGE.\n" + \
" */\n"
def get_output_dir():
@ -80,6 +127,14 @@ def get_output_dir():
output_dir = get_output_dir()
def write_file(filename, contents):
""" Create file using specified name and contents """
f = open(filename, 'w') # overwrites file if it already exists
f.write(contents)
f.close()
#
# CREATE INTERNAL REPRESENTATION OF SYSTEM
#
@ -180,60 +235,11 @@ def vpf_parse():
#
kernel_main_c_data = ""
kernel_main_c_filename_str = \
"/* kernel_main.c - microkernel mainline and kernel objects */\n\n"
do_not_edit_warning = \
"\n\n\n/* THIS FILE IS AUTOGENERATED -- DO NOT MODIFY! */\n\n\n"
copyright = \
"/*\n" + \
" * Copyright (c) 2015 Wind River Systems, Inc.\n" + \
" *\n" + \
" * Redistribution and use in source and binary forms," + \
" with or without\n" + \
" * modification, are permitted provided that the following conditions" + \
" are met:\n" + \
" *\n" + \
" * 1) Redistributions of source code must retain" + \
" the above copyright notice,\n" + \
" * this list of conditions and the following disclaimer.\n" + \
" *\n" + \
" * 2) Redistributions in binary form must reproduce" + \
" the above copyright notice,\n" + \
" * this list of conditions and the following disclaimer" + \
" in the documentation\n" + \
" * and/or other materials provided with the distribution.\n" + \
" *\n" + \
" * 3) Neither the name of Wind River Systems nor the names" + \
" of its contributors\n" + \
" * may be used to endorse or promote products derived" + \
" from this software without\n" + \
" * specific prior written permission.\n" + \
" *\n" + \
" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS" + \
" AND CONTRIBUTORS \"AS IS\"\n" + \
" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING," + \
" BUT NOT LIMITED TO, THE\n" + \
" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS" + \
" FOR A PARTICULAR PURPOSE\n" + \
" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER" + \
" OR CONTRIBUTORS BE\n" + \
" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL," + \
" EXEMPLARY, OR\n" + \
" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO," + \
" PROCUREMENT OF\n" + \
" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;" + \
" OR BUSINESS\n" + \
" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY," + \
" WHETHER IN\n" + \
" * CONTRACT, STRICT LIABILITY, OR TORT" + \
" (INCLUDING NEGLIGENCE OR OTHERWISE)\n" + \
" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE," + \
" EVEN IF ADVISED OF THE\n" + \
" * POSSIBILITY OF SUCH DAMAGE.\n" + \
" */\n"
def kernel_main_c_general():
kernel_main_c_out(
@ -923,14 +929,6 @@ def kernel_main_c_out(string):
kernel_main_c_data += string + "\n"
def write_file(filename, contents):
""" Create file using specified name and contents """
f = open(filename, 'w') # overwrites file if it already exists
f.write(contents)
f.close()
def kernel_main_c_generate():
""" Generate kernel_main.c file """
@ -962,6 +960,8 @@ def kernel_main_c_generate():
#
micro_objs_h_data = ""
micro_objs_h_filename_str = \
"/* microkernel_objects.h - microkernel objects */\n\n"
@ -1076,6 +1076,8 @@ def micro_objs_h_generate():
#
vxmicro_h_data = ""
vxmicro_h_filename_str = \
"/* vxmicro.h - microkernel master header file */\n\n"