Commit Graph

31 Commits

Author SHA1 Message Date
Michal Meloun
4dbc00835d ARM: Remove trailing whitespace from sys/arm/include
No functional changes.

Approved by:    kib (mentor)
2015-11-10 12:02:41 +00:00
Robert Watson
ba2f5f5ed3 Add missing stack unwind information to several assembly functions on
ARMv6/7:

- Define _SAVE() macro to allow unwind data to be conditionally defined for
  ARM assembly code in the kernel.

- Use _SAVE() to provide unwind information for bcopy_page(), and two (of
  many) instances of copyin() and copyout().

Reviewed by:	andrew, imp
MFC after:	3 days
Sponsored by:	University of Cambridge
2015-10-04 09:39:40 +00:00
Andrew Turner
ae160b23fa We only support the ARM EABI in head, remove the check on __ARM_EABI__. 2015-05-31 10:51:06 +00:00
Andrew Turner
8465de8e6c Mark thumb entry points as such when building for thumb, otherwise mark
them as arm.
2015-05-11 19:04:32 +00:00
Andrew Turner
827422e3fd Use the Thumb compliant version of the add instruction. We can only use
"add Rd, Rn, Rm" from within an IT (if-then) block.
2015-05-11 19:00:02 +00:00
Ian Lepore
301e1601ad Fix alignment directives in arm asm code after clang 3.5 import.
The ancient gas we've been using interprets .align 0 as align to the
minimum required alignment for the current section.  Clang's integrated
assembler interprets it as align to a byte boundary.  Fortunately both
assemblers interpret a non-zero value as align to 2^N so just make sure
we have appropriate non-zero values everywhere.
2015-01-02 23:46:26 +00:00
Ian Lepore
54f9ec883d Define a WFI macro that expands to the right form of wait-for-interrupt
depending on the architecture.
2015-01-01 23:18:37 +00:00
Ian Lepore
efa8bab713 Include acle-compat.h directly (we use its symbols) rather than getting
it via sysreg.h.
2014-12-26 14:29:27 +00:00
Ian Lepore
eb4585bcc6 Add macros for asm barrier instructions with arch-specific implementations. 2014-12-25 19:08:39 +00:00
Ian Lepore
b05d247e35 Create 'L' variants of all the ENTRY macros for file-static/local symbols.
If it seems like this is getting out of hand, I quite agree.  I wonder if
it's safe, here in the 21st century, to lose the distinction between C and
ASM symbols?
2014-12-25 16:49:33 +00:00
Ian Lepore
714429358f Fix the GLOBAL macro so it works (upper vs lowercase X), use it in _EENTRY. 2014-12-25 16:43:15 +00:00
Ian Lepore
de064ce459 Stylish changes... put tabs where they need to be in macros, move lines
around so that related things are more grouped together, rewrite comments.

No functional changes, this is all so that the functional changes in the
next commit will stand out.
2014-12-25 16:36:02 +00:00
Ian Lepore
be483be81d Remove _PROF_PROLOGUE from the EENTRY() macros. These macros define
'extra' entry points which are nested within or provide a synonym name
for another function.  It's most likely not safe to be messing with the
IP and LR registers at anything other than the primary entry point to a
function.  Anywhere beyond initial function entry, those registers may
be in use as scratch or variable registers.
2014-12-25 04:41:43 +00:00
Andrew Turner
7f9b314ff2 Pull in the NetBSD global offset table handling code. Clang 3.5 creates
relocations the linker complains about.

Obtained from:	NetBSD
MFC after:	1 Week
2014-12-01 21:04:26 +00:00
Andrew Turner
b643b9341c Update _ENTRY to use _EENTRY to reduce the common code. 2014-11-29 19:31:23 +00:00
Ed Maste
294246bb7d Revert r274772: it is not valid on MIPS
Reported by:	sbruno
2014-11-25 03:50:31 +00:00
Ed Maste
688fd61ae8 Use canonical __PIC__ flag
It is automatically set when -fPIC is passed to the compiler.

Reviewed by:	dim, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1179
2014-11-21 02:05:48 +00:00
Andrew Turner
b8fd1e31d9 Unify interrupts bit definition and usage. While here remove PSR_C_bit.
Submitted by:	Svatopluk Kraus <onwahe at gmail.com>,
		Michal Meloun <meloun at miracle.cz>
Differential Revision: https://reviews.freebsd.org/D754
2014-09-10 15:25:15 +00:00
Andrew Turner
d7f129a3cb Add more register values to armreg.h and remove CPU_CONTROL_32BP_ENABLE
from asm.h as they were already defined in armreg.h.

Submitted by:	Michal Meloun <meloun at miracle.cz>
2014-09-10 13:38:52 +00:00
Ian Lepore
156688371b Do not generate unwind info in asm functions if _STANDALONE is defined.
The .fnend op causes the assembler to emit RELOC references to unwind
support functions that don't exist in libstand.
2014-09-01 14:57:04 +00:00
Ian Lepore
25166187e3 Fix unwind-info errors in our hand-written arm assembler code.
We have functions nested within functions, and places where we start a
function then never end it, we just jump to the middle of something else.
We tried to express this with nested ENTRY()/END() macros (which result
in .fnstart and .fnend directives), but it turns out there's no way to
express that nesting in ARM EHABI unwind info, and newer tools treat
multiple .fnstart directives without an intervening .fnend as an error.

These changes introduce two new macros, EENTRY() and EEND().  EENTRY()
creates a global label you can call/jump to just like ENTRY(), but it
doesn't emit a .fnstart.  EEND() is a no-op that just documents the
conceptual endpoint that matches up with the same-named EENTRY().

This is based on patches submitted by Stepan Dyatkovskiy, but I made some
changes and added the EEND() stuff, so blame any problems on me.

Submitted by:	Stepan Dyatkovskiy <stpworld@narod.ru>
2014-08-01 18:24:44 +00:00
Andrew Turner
0a79452954 Reduce the difference to NetBSD.
* Stop pretending we support anything other than ELF by removing code
   surrounded by #ifdef __ELF__ ... #endif.
 * Remove _JB_MAGIC_SETJMP and _JB_MAGIC__SETJMP, they are defined in
   setjmp.h, which is able to be included from asm.
 * Fix the spelling of dependent.
 * Rename END _END and add END and ASEND to complement ENTRY and ASENTRY
   respectively
 * Add macros to simplify accessing the Global Offset Table, some of these
   will be used in the upcoming update to the setjmp functions.
2013-06-07 21:23:11 +00:00
Andrew Turner
573447b6a5 Add an END macro to ARM. This is mostly used to tell gas where the bounds
of the functions are when creating the EABI unwind tables.
2013-03-16 02:48:49 +00:00
Oleksandr Tymoshenko
cf1a573f04 Merging projects/armv6, part 1
Cummulative patch of changes that are not vendor-specific:
	- ARMv6 and ARMv7 architecture support
	- ARM SMP support
	- VFP/Neon support
	- ARM Generic Interrupt Controller driver
	- Simplification of startup code for all platforms
2012-08-15 03:03:03 +00:00
Olivier Houchard
258f866cbf Define _ARM_ARCH_5E too, so that we know if pld/strd/ldrd are available.
MFC After:	3 days
2007-10-13 12:04:10 +00:00
Olivier Houchard
705fda849d Use __mcount() instead of _mcount() to reduce diffs with NetBSD. 2007-05-19 16:20:37 +00:00
Olivier Houchard
4731df1ee7 Remove dead code, already defined in sys/cdef.h
Spotted out by:	bde
2006-08-30 11:45:07 +00:00
Warner Losh
d8315c79d9 Start all license statements with /*- 2005-01-05 21:58:49 +00:00
Olivier Houchard
5f2c6402db Import a RET macro, that will use bx if the arch supports it.
Obtained from:	NetBSD
2004-11-09 16:45:55 +00:00
Olivier Houchard
a40d2bb653 We are using _mcount, not __mcount.
Remove the !__ELF__ case.
2004-09-23 22:26:29 +00:00
Olivier Houchard
6fc729af63 Import FreeBSD/arm kernel bits.
It only supports sa1110 (on simics) right now, but xscale support should come
soon.
Some of the initial work has been provided by :
Stephane Potvin <sepotvin at videotron.ca>
Most of this comes from NetBSD.
2004-05-14 11:46:45 +00:00