2005-04-17 02:20:36 +04:00
#
# frv/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (c) 2003, 2004 Red Hat Inc.
# - Written by David Howells <dhowells@redhat.com>
# - Derived from arch/m68knommu/Makefile,
# Copyright (c) 1999,2001 D. Jeff Dionne <jeff@lineo.ca>,
# Rt-Control Inc. / Lineo, Inc.
#
# Copyright (C) 1998,1999 D. Jeff Dionne <jeff@uclinux.org>,
# Kenneth Albanowski <kjahds@kjahds.com>,
#
# Based on arch/m68k/Makefile:
# Copyright (C) 1994 by Hamish Macdonald
#
CCSPECS := $( shell $( CC) -v 2>& 1 | grep "^Reading specs from " | head -1 | cut -c20-)
CCDIR := $( strip $( patsubst %/specs,%,$( CCSPECS) ) )
CPUCLASS := fr400
# test for cross compiling
COMPILE_ARCH = $( shell uname -m)
i f d e f C O N F I G _ M M U
UTS_SYSNAME = -DUTS_SYSNAME= \" Linux\"
e l s e
UTS_SYSNAME = -DUTS_SYSNAME= \" uClinux\"
e n d i f
ARCHMODFLAGS += -G0 -mlong-calls
i f d e f C O N F I G _ G P R E L _ D A T A _ 8
CFLAGS += -G8
e l s e
i f d e f C O N F I G _ G P R E L _ D A T A _ 4
CFLAGS += -G4
e l s e
i f d e f C O N F I G _ G P R E L _ D A T A _ N O N E
CFLAGS += -G0
e n d i f
e n d i f
e n d i f
#LDFLAGS_vmlinux := -Map linkmap.txt
i f d e f C O N F I G _ G C _ S E C T I O N S
CFLAGS += -ffunction-sections -fdata-sections
LINKFLAGS += --gc-sections
e n d i f
i f n d e f C O N F I G _ F R A M E _ P O I N T E R
CFLAGS += -mno-linked-fp
e n d i f
i f d e f C O N F I G _ C P U _ F R 4 5 1 _ C O M P I L E
CFLAGS += -mcpu= fr450
AFLAGS += -mcpu= fr450
ASFLAGS += -mcpu= fr450
e l s e
i f d e f C O N F I G _ C P U _ F R 5 5 1 _ C O M P I L E
CFLAGS += -mcpu= fr550
AFLAGS += -mcpu= fr550
ASFLAGS += -mcpu= fr550
e l s e
CFLAGS += -mcpu= fr400
AFLAGS += -mcpu= fr400
ASFLAGS += -mcpu= fr400
e n d i f
e n d i f
# pretend the kernel is going to run on an FR400 with no media-fp unit
# - reserve CC3 for use with atomic ops
# - all the extra registers are dealt with only at context switch time
CFLAGS += -mno-fdpic -mgpr-32 -msoft-float -mno-media
[PATCH] FRV: Use virtual interrupt disablement
Make the FRV arch use virtual interrupt disablement because accesses to the
processor status register (PSR) are relatively slow and because we will
soon have the need to deal with multiple interrupt controls at the same
time (separate h/w and inter-core interrupts).
The way this is done is to dedicate one of the four integer condition code
registers (ICC2) to maintaining a virtual interrupt disablement state
whilst inside the kernel. This uses the ICC2.Z flag (Zero) to indicate
whether the interrupts are virtually disabled and the ICC2.C flag (Carry)
to indicate whether the interrupts are physically disabled.
ICC2.Z is set to indicate interrupts are virtually disabled. ICC2.C is set
to indicate interrupts are physically enabled. Under normal running
conditions Z==0 and C==1.
Disabling interrupts with local_irq_disable() doesn't then actually
physically disable interrupts - it merely sets ICC2.Z to 1. Should an
interrupt then happen, the exception prologue will note ICC2.Z is set and
branch out of line using one instruction (an unlikely BEQ). Here it will
physically disable interrupts and clear ICC2.C.
When it comes time to enable interrupts (local_irq_enable()), this simply
clears the ICC2.Z flag and invokes a trap #2 if both Z and C flags are
clear (the HI integer condition). This can be done with the TIHI
conditional trap instruction.
The trap then physically reenables interrupts and sets ICC2.C again. Upon
returning the interrupt will be taken as interrupts will then be enabled.
Note that whilst processing the trap, the whole exceptions system is
disabled, and so an interrupt can't happen till it returns.
If no pending interrupt had happened, ICC2.C would still be set, the HI
condition would not be fulfilled, and no trap will happen.
Saving interrupts (local_irq_save) is simply a matter of pulling the ICC2.Z
flag out of the CCR register, shifting it down and masking it off. This
gives a result of 0 if interrupts were enabled and 1 if they weren't.
Restoring interrupts (local_irq_restore) is then a matter of taking the
saved value mentioned previously and XOR'ing it against 1. If it was one,
the result will be zero, and if it was zero the result will be non-zero.
This result is then used to affect the ICC2.Z flag directly (it is a
condition code flag after all). An XOR instruction does not affect the
Carry flag, and so that bit of state is unchanged. The two flags can then
be sampled to see if they're both zero using the trap (TIHI) as for the
unconditional reenablement (local_irq_enable).
This patch also:
(1) Modifies the debugging stub (break.S) to handle single-stepping crossing
into the trap #2 handler and into virtually disabled interrupts.
(2) Removes superseded fixup pointers from the second instructions in the trap
tables (there's no a separate fixup table for this).
(3) Declares the trap #3 vector for use in .org directives in the trap table.
(4) Moves irq_enter() and irq_exit() in do_IRQ() to avoid problems with
virtual interrupt handling, and removes the duplicate code that has now
been folded into irq_exit() (softirq and preemption handling).
(5) Tells the compiler in the arch Makefile that ICC2 is now reserved.
(6) Documents the in-kernel ABI, including the virtual interrupts.
(7) Renames the old irq management functions to different names.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-15 00:53:20 +03:00
CFLAGS += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15 -ffixed-icc2
2005-04-17 02:20:36 +04:00
AFLAGS += -mno-fdpic
ASFLAGS += -mno-fdpic
# make sure the .S files get compiled with debug info
# and disable optimisations that are unhelpful whilst debugging
i f d e f C O N F I G _ D E B U G _ I N F O
CFLAGS += -O1
AFLAGS += -Wa,--gdwarf2
ASFLAGS += -Wa,--gdwarf2
e n d i f
head-y := arch/frv/kernel/head.o arch/frv/kernel/init_task.o
core-y += arch/frv/kernel/ arch/frv/mm/
libs-y += arch/frv/lib/
core-$(CONFIG_MB93090_MB00) += arch/frv/mb93090-mb00/
all : Image
Image : vmlinux
$( Q) $( MAKE) $( build) = arch/frv/boot $@
bootstrap :
$( Q) $( MAKEBOOT) bootstrap
archmrproper :
2006-01-08 12:01:25 +03:00
$( Q) $( MAKE) $( build) = arch/frv/boot mrproper
2005-04-17 02:20:36 +04:00
archclean :
2006-01-08 12:01:25 +03:00
$( Q) $( MAKE) $( build) = arch/frv/boot clean
2005-04-17 02:20:36 +04:00
archdep : scripts /mkdep symlinks
2006-01-08 12:01:25 +03:00
$( Q) $( MAKE) $( build) = arch/frv/boot dep