hw: define assembler constants in global scope

Don't define assembler constants inside macros, thereby calling the
corresponding macros isn't needed anymore. To prevent having to much
constants included in files where they aren't needed, split macros.s
file into a generic mode_transition.s part, and globally used macros.s.

Fix #1180
This commit is contained in:
Stefan Kalkowski 2014-06-12 17:00:27 +02:00 committed by Norman Feske
parent f5fdcc8f1e
commit 00ee2b565a
5 changed files with 87 additions and 91 deletions

View File

@ -85,8 +85,6 @@ proc build_boot_image {binaries} {
"\n /* core includes */" \
"\n.include \"macros.s\"" \
"\n" \
"\n_common_constants" \
"\n" \
"\n.section .data" \
"\n" \
"\n.p2align data_access_alignm_log2" \

View File

@ -13,11 +13,6 @@
.include "macros_arm.s"
/*******************
** Common macros **
*******************/
/**
* Determine the top of the kernel stack of this processor and apply it as SP
*
@ -36,82 +31,11 @@
.endm
/******************************************
** Macros regarding the mode transition **
******************************************/
/***************************************************
** Constant values that are pretty commonly used **
***************************************************/
/**
* Constant values that the mode transition uses
*/
.macro _mt_constants
/* alignment constraints */
.set min_page_size_log2, 12
.set data_access_alignm_log2, 2
/* kernel names of exceptions that can interrupt a user */
.set rst_type, 1
.set und_type, 2
.set svc_type, 3
.set pab_type, 4
.set dab_type, 5
.set irq_type, 6
.set fiq_type, 7
.set rst_pc_adjust, 0
.set und_pc_adjust, 4
.set svc_pc_adjust, 0
.set pab_pc_adjust, 4
.set dab_pc_adjust, 8
.set irq_pc_adjust, 4
.set fiq_pc_adjust, 4
/* offsets of the member variables in a processor context */
.set r12_offset, 12 * 4
.set sp_offset, 13 * 4
.set lr_offset, 14 * 4
.set pc_offset, 15 * 4
.set psr_offset, 16 * 4
.set exception_type_offset, 17 * 4
.set contextidr_offset, 18 * 4
.set section_table_offset, 19 * 4
/* size of local variables */
.set context_ptr_size, 1 * 4
.endm
/**
* Constant values that are pretty commonly used
*/
.macro _common_constants
/* alignment constraints */
.set min_page_size_log2, 12
.set data_access_alignm_log2, 2
.endm
/**
* Local data structures that the mode transition uses
*/
.macro _mt_local_variables
/* space for a copy of the kernel context */
.p2align 2
.global _mt_master_context_begin
_mt_master_context_begin:
.space 32 * 4
.global _mt_master_context_end
_mt_master_context_end:
/* space for a client context-pointer per processor */
.p2align 2
.global _mt_client_context_ptr
_mt_client_context_ptr:
.rept PROCESSORS
.space context_ptr_size
.endr
/* a globally mapped buffer per processor */
.p2align 2
.global _mt_buffer
_mt_buffer:
.rept PROCESSORS
.space buffer_size
.endr
.endm

View File

@ -0,0 +1,79 @@
/*
* \brief Mode transition definitions used by all ARM architectures
* \author Stefan Kalkowski
* \date 2014-06-12
*/
/*
* Copyright (C) 2014 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
/***************************************************
** Constant values that the mode transition uses **
***************************************************/
/* kernel names of exceptions that can interrupt a user */
.set rst_type, 1
.set und_type, 2
.set svc_type, 3
.set pab_type, 4
.set dab_type, 5
.set irq_type, 6
.set fiq_type, 7
.set rst_pc_adjust, 0
.set und_pc_adjust, 4
.set svc_pc_adjust, 0
.set pab_pc_adjust, 4
.set dab_pc_adjust, 8
.set irq_pc_adjust, 4
.set fiq_pc_adjust, 4
/* offsets of the member variables in a processor context */
.set r12_offset, 12 * 4
.set sp_offset, 13 * 4
.set lr_offset, 14 * 4
.set pc_offset, 15 * 4
.set psr_offset, 16 * 4
.set exception_type_offset, 17 * 4
.set contextidr_offset, 18 * 4
.set section_table_offset, 19 * 4
/* size of local variables */
.set context_ptr_size, 1 * 4
/*********************************************************
** Local data structures that the mode transition uses **
*********************************************************/
.macro _mt_local_variables
/* space for a copy of the kernel context */
.p2align 2
.global _mt_master_context_begin
_mt_master_context_begin:
.space 32 * 4
.global _mt_master_context_end
_mt_master_context_end:
/* space for a client context-pointer per processor */
.p2align 2
.global _mt_client_context_ptr
_mt_client_context_ptr:
.rept PROCESSORS
.space context_ptr_size
.endr
/* a globally mapped buffer per processor */
.p2align 2
.global _mt_buffer
_mt_buffer:
.rept PROCESSORS
.space buffer_size
.endr
.endm /* _mt_local_variables */

View File

@ -11,6 +11,7 @@
* under the terms of the GNU General Public License version 2.
*/
.include "arm/mode_transition.s"
.include "macros.s"
@ -21,9 +22,6 @@
/* size of local variables */
.set buffer_size, 1 * 4
/* common constants */
_mt_constants
/************
** Macros **

View File

@ -12,6 +12,7 @@
* under the terms of the GNU General Public License version 2.
*/
.include "arm/mode_transition.s"
.include "macros.s"
@ -30,10 +31,6 @@
/* size of local variables */
.set buffer_size, 2 * 4
/* common constants */
_mt_constants
_common_constants
/************
** Macros **