Commit Graph

150 Commits

Author SHA1 Message Date
mrg 046047ef8e add a weak alias for __ffssi2 2011-07-09 14:57:29 +00:00
mrg 1866376e13 sh3 needs the __ffssi2 weak symbol, too. 2011-07-04 12:18:05 +00:00
mrg 259d2a08e1 add a weak alias from ffs to __ffssi2. newsmips kernels link now. 2011-07-04 11:35:26 +00:00
mrg 88fcb00c03 add a weak alias from ffs to __ffssi2. sparc dynamic works with gcc 4.5 now. 2011-07-04 11:18:23 +00:00
matt 633cce5ea2 Add a weak symbol definition for __ffssi2 so that __builtin_ffs will use
this if no strong defintion of __ffssi2 is available.
2011-07-03 07:13:31 +00:00
joerg bdaa91a3a8 Add support for size optimised versions of the assembler functions in
the small subdirectory. Provide more compact versions of the functions
used by bootxx in x86.
2011-06-16 16:39:14 +00:00
pooka f3da52f3a1 Add PIC variant for fetching the lock address.
librump.so now works on sparc
2011-02-22 18:45:10 +00:00
matt c2f76ff004 Use END(sym)
use RCSID
2011-01-25 04:45:28 +00:00
matt 3c6f3faa1a Add a new O(log(2) implementation. On mips32/mips64, use clz/dclz. 2011-01-23 06:47:14 +00:00
joerg 13d8b2b89c Move SPARC and SPARC64 to modern CPP. Update UPDATING note for this and
Alpha.
2011-01-17 18:11:09 +00:00
skrll a673bf604d Add an membar_ops.S - not used currently. 2011-01-17 07:40:21 +00:00
skrll b095c54869 Tweak layout - no functional change. 2011-01-17 07:29:17 +00:00
skrll 0dec4d9c8e Fix RCSId. 2011-01-16 12:07:26 +00:00
matt cf88c3890b Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
2011-01-15 07:31:11 +00:00
joerg d3a052c472 Allow use of traditional CPP to be set on a per platform base in sys.mk.
Honour this for dependency processing in bsd.dep.mk.  Switch i386 and
amd64 assembly to use ISO C90 preprocessor concat and drop the
-traditional-cpp on this platform.
2011-01-12 23:12:10 +00:00
matt 1b9f1d30ee Make these 64-bit clean. 2011-01-02 02:58:52 +00:00
mrg 26c2cb31ec define _NOREGNAMES before including <machine/asm.h>, like powerpc does.
from dennis.c.ferguson@gmail.com in PR#43022.
2010-03-22 02:22:32 +00:00
uwe 6fc217346b Add memset to libkern on vax, moving existing memset.S to src/common.
While kernel source code is supposed to use <machine/macros.h> via
<sys/param.h> and pick an inline asm version from there, gcc itself
can generate direct calls to memset() for structure initialization, so
the symbol must be provided.

Fixes INSTALL kernel, for which -Os caused gcc to use memset() call to
initialize a struct in uvm_fault_internal().
2010-03-12 09:12:34 +00:00
joerg 56da4fa7b5 Move AMD64's bswap64 implementation from libc to src/common and share it
with the kernel.
2010-01-14 02:09:46 +00:00
pooka 817cd31541 Don't export __ffstab, it's used only in this routine. This gets
rid of one of those evil common symbols in the __ namespace.

reviewed by martin
2009-12-19 19:09:48 +00:00
matt 8daf714e68 Merge from matt-nb5-mips64 2009-12-14 00:38:59 +00:00
pooka 043ef3bc71 Use strong alias within the kernel namespace regardless of if we're
dealing with a hard or soft kernel (kernel linker doesn't support
weak symbols).
2009-11-26 07:40:34 +00:00
dsl 8fee27ec00 Align to the destination buffer.
This probably costs 1 clock (on modern cpus) in the normal case.
But gives a big benefit when the destination is misaligned.
In particular when the source has the same misalignment - although
that may not be a gain on Nehalem!
Fixes PR/35535
2009-11-22 17:25:47 +00:00
dsl a6f75e27d4 Avoid doing two 'rep movs' operations. 2009-11-21 19:52:54 +00:00
skrll 88855871f7 New binutils seems to want end of functions marked. 2009-11-09 14:22:02 +00:00
dsl d582bd909a In the misaligned case, xor the read word with the target pattern
before making the unwanted bytes non-zero.
Means that memchr(buf, 0xff) is no longer a special case.
2009-08-01 20:47:02 +00:00
dsl 170e962b6c Remove some long dependant instruction sequences (ie allow parallel code).
Since 'rep stos' will have a long setup time, avoid doing it more than once.
For misaligned (start address or length) write an unaligned word at both
ends of the buffer then aligned 'rep stosd' the middle.
Use the same code for bzero().
bzero.S is left being compiled for a while (empty) - to avoid issues with
duplicate symbols in libc.a after update builds.
2009-08-01 20:35:45 +00:00
christos 28a175e482 Put back dsl's string changes, but fix memchr.S to use cmp (rather
than test) so that the condition code is set correctly (and fix the
comments: 0x10->0x01 and ^->&).   From Anon Ymous

XXX: There are similar comment errors in some of the other string code.

XXX: We really need a regression test that includes misaligned memory
with searches designed to catch corner cases such as searching for 0,
-1, etc, and search length limit violations.  Searching for 0 on
misaligned memory would have caught this problem.
2009-07-20 15:21:00 +00:00
christos 13763a400f Put back dsl's string changes, but fix memchr.S to use cmp so that the
condition code is set (and fix the comments 0x10->0x01). From Anon Ymous
We need a test for memchr(x, -1)...
2009-07-20 15:20:59 +00:00
christos 1621a90cd8 revert changes that made new kernels hang in ACPI detection 2009-07-19 23:45:29 +00:00
dsl 97943df1a9 A better memchr().
Always read aligned words, invalidating unwanted bytes in first word,
and checking that any match in the last word is before the buffer end.
No loops apart from the one through the data.
2009-07-18 18:06:56 +00:00
dsl 6bdd82f5c7 Shorten a dependency chain by using 'sbb, xor' (at a time when carry is set)
instead of 'mov, neg, dec'.
('mov, not' can't be used because it doesn't set the flags.)
2009-07-18 16:40:31 +00:00
dsl 957285f031 Remove a pointless _ALIGN_TEXT.
XXX ffs() ought to be a gcc inline asm.
2009-07-18 12:03:31 +00:00
dsl 6054206dee Replace with a version that:
1) doesn't do byte compares to find which byte matched
2) doesn't do byte compares if any top bits are set
3) doesn't use a loop when the input is misaligned
4) has less mispredicted branches
Passes regression tests and 'build.sh' doesn't explode (and more than usual).
2009-07-18 11:41:23 +00:00
dsl 082a39150a Delete files that are no longer needed. 2009-07-17 19:42:04 +00:00
dsl 53a0f227e6 Change all archs so that strchr.[cS] and strrchr.[cS] exist and generate
duplicate symbols for index() and rindex().
2009-07-17 19:37:57 +00:00
dsl 487c31f545 Add asm files for str(r)chr by copying the files for (r)index from
src/libc/arch/mips/string.
Add XLEAF() for index entry points.
2009-07-16 21:25:36 +00:00
dsl 5f3551c2f8 Add netbsd copyright.
Reorder a few instructions to interleave a dependency chain.
(I'm really not sure of the best order for those instructions!)
2009-07-12 21:24:21 +00:00
dsl f9b60c2be5 Correct some comments 2009-07-12 21:00:54 +00:00
dsl 66df44074f After alg 2 triggers, mask with ~x (alg 3) to ignore bytes with top bit set.
Then use bit scan to work out which byte is zero.
If the source is misaligned read the aligned word and make the unwanted
(low order) bytes non-zero.
Passes regression test - which probably tests just enough cases.
2009-07-11 11:57:47 +00:00
dsl 5acd65fcb7 Change comments about algorithms, 99.6% for random data isn't 'rare' in my book!
(The 'rare' case is any byte values 0x80-0xff.)
2009-07-11 08:48:51 +00:00
enami 09fcc8b316 So that profile kernel runs again,
- Adjust the size of functions used to patch.
- Fix the jump offset of mcount call when patching functions.

Approved by Andrew Doran.
2009-04-02 00:19:02 +00:00
abs b17f6f5834 Revert test from MACHINE_ARCH to MACHINE, as this can be called with
with MACHINE_ARCH=sparc MACHINE=sparc64 when building 32bit kernels for
ultrasparc hardware. Picked up by nakayama@ - thanks.
Add a comment explaining this odd case
2009-03-13 19:16:46 +00:00
nakayama fd33b05ec2 Fix typo. (s/_HARKDERNEL/_HARDKERNEL/) 2009-03-13 16:40:22 +00:00
abs f681b265bc Prefer MACHINE_ARCH to MACHINE in some tests 2009-03-12 17:16:58 +00:00
he 91cab67b08 Follow up the powerpc side by using %rN instead of rN for registers. 2009-03-08 12:08:19 +00:00
pooka 654753c2e1 include sys/param.h for _HARDKERNEL instead of homegrown def. 2009-01-12 02:53:29 +00:00
pooka 132ffc213b Include userland version of atomic cas routines in librump.
(the kernel version disables interrupts and therefore can't be used)
2009-01-10 23:36:22 +00:00
mjf a15a784800 The .if conditional crosses a line boundary, so add a backslash.
This fixes the kernel build for hppa.
2009-01-06 13:23:31 +00:00
pooka 69885c98a3 Do not use lockpatches with _RUMPKERNEL (non-PIC ... and pointless). 2009-01-04 18:46:16 +00:00