Commit Graph

1247 Commits

Author SHA1 Message Date
Rafal Jaworowski
a715909b3e Improve error handling in pcib_mbus_identify(). 2008-11-19 17:07:01 +00:00
Rafal Jaworowski
e33d259975 Improve style(9) and other cosmetics in Marvell SOCs code. 2008-11-19 11:57:16 +00:00
Rafal Jaworowski
b4ef1cb7e8 Fix off-by-one error in mbus_attach(). 2008-11-19 11:49:35 +00:00
Rafal Jaworowski
09f90fe045 Enable PCI in Marvell kernel configs. 2008-11-19 11:47:23 +00:00
Rafal Jaworowski
6975124c23 PCI/PCI-Express support for Marvell systems.
Obtained from:	Marvell, Semihalf
2008-11-19 11:30:44 +00:00
Stanislav Sedov
ec5556611c - Fix two minor errors in at91 code.
PR:		arm/128959
Submitted by:	Bjorn Konig <bkoenig@alpha-tierchen.de>
Approved by:	kib (mentor)
2008-11-18 12:42:59 +00:00
Rafal Jaworowski
65d75768c3 ARM pmap style(9) and cosmetics. 2008-11-06 16:28:28 +00:00
Rafal Jaworowski
71f00bea66 Auto-size kernel page tables allocation on Marvell systems.
This allows mini dumps to fully work for these platforms.

Obtained from:	Juniper Networks, Semihalf
2008-11-06 16:25:12 +00:00
Rafal Jaworowski
8e321b7943 Support kernel crash mini dumps on ARM architecture.
Obtained from:	Juniper Networks, Semihalf
2008-11-06 16:20:27 +00:00
Alexander Motin
3a4a255741 Allow card reader bridge driver to report maximum supported transfer size.
sdhci supports up to 65535 blocks transfers, at91_mci - one block.

Enable multiblock operations disabled before to follow at91_mci driver
limitations.

Reviewed by:	imp@
2008-10-29 20:01:26 +00:00
Stanislav Sedov
e06d0e0a92 - Add stream bus_space operations.
Reviewed by:	cognet
Approved by:	kib (mentor, implicit)
MFC after:	1 week
2008-10-26 22:53:59 +00:00
Stanislav Sedov
baf7d37113 - Add a missing NULL-pointer check.
Reviewed by:	cognet
Approved by:	kib (mentor, implicit)
MFC after:	3 days
2008-10-26 22:52:57 +00:00
Dag-Erling Smørgrav
1ede983cc9 Retire the MALLOC and FREE macros. They are an abomination unto style(9).
MFC after:	3 months
2008-10-23 15:53:51 +00:00
Marcel Moolenaar
1706f03059 Add arm/conf/DEFAULTS and populate it with:
machine arm
        device  mem
        options GEOM_BSD
        options GEOM_MBR

Remove the first two from all kernel configuration files and
change geom_bsd and geom_mbr from standard to optional.
2008-10-23 01:51:55 +00:00
Rafal Jaworowski
df38b76405 Eliminate flushing of L2 cache in ARM context switch routines.
With VIPT L2 cache such syncing not only is redundant, but also a performance
penalty.

Pointed out by:	cognet
2008-10-16 19:06:24 +00:00
Sam Leffler
0c7b0d4568 correct sizeof calculation
PR:		arm/128095
Submitted by:	Henning Petersen
MFC after:	1 week
2008-10-14 16:27:52 +00:00
Rafal Jaworowski
0ed948780c Initial support of loader(8) for ARM machines running U-Boot.
This uses the common U-Boot support lib (sys/boot/uboot, already used on
FreeBSD/powerpc), and assumes the underlying firmware has the modern API for
stand-alone apps enabled in the config (CONFIG_API).

Only netbooting is supported at the moment.

Obtained from:	Marvell, Semihalf
2008-10-14 10:11:14 +00:00
Rafal Jaworowski
d0ee9aab8e Add kernel config files for Marvell development boards.
FreeBSD 8-CURRENT was tested and run successfully on the following eval
boards and devices :

  * DB-88F5182, DB-88F5281 (Orion based)

  * DB-88F6281, RD-88F6281 (Kirkwood based)

  * DB-78100 (Discovery based)

For more detailed info on build instructions and other examples please refer
to http://wiki.freebsd.org/FreeBSDMarvell

Obtained from:	Marvell, Semihalf
2008-10-14 08:18:27 +00:00
Rafal Jaworowski
373bbe25ff Introduce basic support for Marvell families of system-on-chip ARM devices:
*  Orion
     - 88F5181
     - 88F5182
     - 88F5281

  * Kirkwood
     - 88F6281

  * Discovery
     - MV78100

The above families of SOCs are built around CPU cores compliant with ARMv5TE
instruction set architecture definition. They share a number of integrated
peripherals. This commit brings support for the following basic elements:

  * GPIO
  * Interrupt controller
  * L1, L2 cache
  * Timers, watchdog, RTC
  * TWSI (I2C)
  * UART

Other peripherals drivers will be introduced separately.

Reviewed by:	imp, marcel, stass (Thanks guys!)
Obtained from:	Marvell, Semihalf
2008-10-13 20:07:13 +00:00
Rafal Jaworowski
dd891816df One more L2 cache synchronization call that didn't make the previous commit. 2008-10-13 19:14:14 +00:00
Rafal Jaworowski
62a5c95054 Provide L2 cache synchronization (write back + invalidation) on ARM.
Note the cpu_l2cache_wbinv_* routines are no-ops on systems not populated with
L2 caches.

Obtained from:	Marvell, Semihalf
2008-10-13 18:59:59 +00:00
Rafal Jaworowski
5289eda203 Do not use cached page for temporary mapping in pmap_zero_page_generic()
The physical page which we clear is accessed via additional temp kernel
mapping for the period of zeroing operation. However in systems with virtual
d-cache (most ARMs) when write-allocate feature is enabled, we can have
modified but unflushed content pertaining to this physical page still in the
d-cache due to its primary (pre-existing) mapping. In such scenario that
cached content upon flush is likely to overwrite [portions of] the physical
page we want to zero here..

This is a general problem with multiple virtual mappings covering the same
physical page with write-allocate and virtual d-cache: there is inherent
potential for corruptions of this kind, which are not easily resolved; it is
best policy that such multiple mappings be not allowed.

Obtained from:	Marvell, Semihalf
2008-10-13 18:42:25 +00:00
Rafal Jaworowski
ba6faad63c Introduce low-level support for new Marvell core CPUs: 88FR131, 88FR571.
They are compliant with ARMv5TE and integrated on 88F6281 (Kirkwood) and
MV78100 (Discovery) system-on-chip families.

Obtained from:	Marvell, Semihalf
2008-10-13 18:16:54 +00:00
Warner Losh
2bfca5e908 Use bus_get_dma_tag() instead of NULL here. Not really needed for atmel
at the moment, but it is more correct.
2008-10-07 17:23:16 +00:00
Bruce M Simpson
db494010a3 Allow static hints to override kenv. 2008-10-02 22:31:30 +00:00
Peter Wemm
e6592ee55c Collect N identical (or near identical) mkdumpheader() implementations into
one, as threatened in the comment.  Textdump magic can be passed in.
2008-10-01 22:08:53 +00:00
Warner Losh
cc35bcd157 Properly implement read only. Also, the caps implementation is wrong
here, so I'm backing it out.
2008-09-30 02:32:41 +00:00
Warner Losh
093bb0f8cf Implement MMCBR_IVAR_CAPS for AT91 MCI device.
Submitted by:	mav@ (well, not this one, but the base impl was)
2008-09-28 23:37:56 +00:00
Warner Losh
59574d9379 White space nit. 2008-09-28 05:36:25 +00:00
Ed Schouten
6bfa9a2d66 Replace all calls to minor() with dev2unit().
After I removed all the unit2minor()/minor2unit() calls from the kernel
yesterday, I realised calling minor() everywhere is quite confusing.
Character devices now only have the ability to store a unit number, not
a minor number. Remove the confusion by using dev2unit() everywhere.

This commit could also be considered as a bug fix. A lot of drivers call
minor(), while they should actually be calling dev2unit(). In -CURRENT
this isn't a problem, but it turns out we never had any problem reports
related to that issue in the past. I suspect not many people connect
more than 256 pieces of the same hardware.

Reviewed by:	kib
2008-09-27 08:51:18 +00:00
Konstantin Belousov
a8d403e102 Change the static struct sysentvec and struct Elf_Brandinfo initializers
to the C99 style. At least, it is easier to read sysent definitions
that way, and search for the actual instances of sigcode etc.

Explicitely initialize sysentvec.sv_maxssiz that was missed in most
sysvecs.

No objection from:	jhb
MFC after:	1 month
2008-09-24 10:14:37 +00:00
Olivier Houchard
34ba28d182 Bandaid: disable interrupts to make sure intr_enabled and the IER register
are in sync. I'm not sure why it is needed, and why it wouldn't be on other
arm platforms, but it prevents a lockup under heavy I/O.
2008-09-11 20:43:38 +00:00
Olivier Houchard
5ac74cc6e4 Remove the unused field "pc_prvspace" from the MD fields for the struct
pcpu. There's not even a thing such as a "struct pcup".
While I'm there, remove a comment that makes no sense for arm.

Spotted out by:	Mark Tinguely
2008-09-11 20:39:46 +00:00
Rafal Jaworowski
217d7296a8 ARM nexus style(9) improvements. 2008-09-11 12:39:54 +00:00
Rafal Jaworowski
f4e42148d7 ARM interrupts improvements.
- Fix nexus_setup_intr() abuse of setting up multiple IRQs in one go. Calling
  arm_setup_irqhandler() in loop is bogus, as there's just one cookie given
  from the caller and it is overwritten in each iteration so that only the
  last handler's cookie value prevails.

- Proper intr masking/unmasking handling: the IRQ source is masked at PIC level
  only after the last handler has been removed from the list.

Reviewed by:	cognet, imp, sam, stass
Obtained from:	Grzegorz Bernacki gjb ! semihalf dot com
2008-09-11 12:36:13 +00:00
Rafal Jaworowski
e29b1b389b IXP425: split handling of the two QMGR interrupts so they are separately
managed. Adjust ixpqmgr_{attach,detach} to comply with device_* interface.

Reviewed by:	cognet, imp, sam, stass
Tested by:	cognet
2008-09-11 12:17:21 +00:00
Warner Losh
7217c39672 Commit the no-brainer parts of my space saving kernel experiments. We
don't inline the locking primitives, and only grab those parts of mii
that we really need.  Other space optimizations are too agressive for
the generic file (removing all of usb, and loading it as kernel
modules).
2008-09-08 00:41:32 +00:00
Warner Losh
33b4ae7d79 Minor cleanup of this config file:
o It has been tested only on KB9202, KB9202A and KB9202B boards
o Better comments about hints
o option<space><tab>
o Add newer SX_NOINLINE option.
o Fix a few comments
2008-09-07 18:55:55 +00:00
Warner Losh
8691fc004b Turn some lame pseudo-code into a less lame comment. 2008-09-05 22:30:59 +00:00
Warner Losh
5fdde3724c Kill bogus #if 0'd stuff for interrupts. They don't happen, and this
driver will need more serious help to work with an interrupt driven
path.  There's many subtleties in driving the DMA engine with
interrupts in many configurations.  Best to not "guess" what the right
way would be and mislead people.
2008-09-05 22:29:50 +00:00
Warner Losh
e704206e27 Kill vestiges of the special case code we once had in place for usb
memory allocation.  It was change to include the range in the normal
memory area, so these ifdef'd out special cases are no longer useful
to keep around.
2008-09-05 22:27:10 +00:00
Warner Losh
9df90e6ba5 Kill bogus #if 1. There's no need for it since usb works these days. 2008-09-05 22:23:41 +00:00
Warner Losh
fcce278bf2 Use a locally assigned address rather than stealing Atmel's which
might cause a conflict...
2008-08-31 18:20:01 +00:00
Stanislav Sedov
a0ac6fc0bc - Fix comment.
- Set U/L bit of generated ethernet address to 1 to not
  clash with Atmel assigned addresses.

Suggested by:	yar
Approved by:	kib (mentor)
2008-08-31 09:28:49 +00:00
Stanislav Sedov
0787c9a03f - Try to look for MAC address in all SA registers, not only in the
first one. U-boot, for example, uses the second register to store
  MAC.[1]
- Use random MAC address if none configured instead of failing.

Submitted by:	Bjorn Konig <bkoenig@alpha-tierchen.de> [1]
Reviewed by:	imp
Approved by:	kib (mentor)
MFC after:	1 week
2008-08-30 15:16:40 +00:00
Stanislav Sedov
ae8b75dddb - Style fix.
Approved by:	kib (mentor)
MFC after:	1 week
2008-08-30 15:04:53 +00:00
Warner Losh
5f00fec406 Whitespace nit. 2008-08-23 23:35:08 +00:00
Warner Losh
5385196376 Provide hooks into the GPIO lines and the ability to set/clear
interrupts from them.  This should be more generalized, but is
sufficient for now.

Submitted by:	Hans Petter Selasky
2008-08-19 22:17:14 +00:00
Warner Losh
86f88de002 Use the proper clock domain for the usb host controller.
Submitted by:	Hans Petter Selasky
2008-08-19 22:16:10 +00:00
Warner Losh
5d8e2080ac Add IRQ line for usb device. I'm not 100% sure this is the right
place to add this connection, since the interrupt is for a GPIO pin,
but since we have no alternative at the moment...

Submitted by:	Hans Petter Selasky
2008-08-19 22:15:14 +00:00
John Baldwin
70d12a18f2 Export 'struct pcpu' to userland w/o requiring _KERNEL. A few ports
already define _KERNEL to get to this and I'm about to add hooks to
libkvm to access per-CPU data.

MFC after:	1 week
2008-08-19 19:53:52 +00:00
Bjoern A. Zeeb
603724d3ab Commit step 1 of the vimage project, (network stack)
virtualization work done by Marko Zec (zec@).

This is the first in a series of commits over the course
of the next few weeks.

Mark all uses of global variables to be virtualized
with a V_ prefix.
Use macros to map them back to their global names for
now, so this is a NOP change only.

We hope to have caught at least 85-90% of what is needed
so we do not invalidate a lot of outstanding patches again.

Obtained from:	//depot/projects/vimage-commit2/...
Reviewed by:	brooks, des, ed, mav, julian,
		jamie, kris, rwatson, zec, ...
		(various people I forgot, different versions)
		md5 (with a bit of help)
Sponsored by:	NLnet Foundation, The FreeBSD Foundation
X-MFC after:	never
V_Commit_Message_Reviewed_By:	more people than the patch
2008-08-17 23:27:27 +00:00
John Baldwin
13e3657b7b Add locking to the various iicbus(4) bridge drivers:
- Just grab Giant in the ixp425_iic(4) driver since this driver uses
  a shared address/data register window pair to access the actual
  I2C registers.  None of the other ixp425 drivers lock access to these
  shared address/data registers yet and that would need to be done before
  this could use any meaningful locking.
- Add locking to the interrupt handler and 'iicbus_reset' methods of the
  at91_twi(4) driver.
- Add locking to the pcf(4) driver.  Other pcf(4) fixes include:
  - Don't needlessly zero the softc.
  - Use bus_foo rather than bus_space_foo and remove bus space tag and
    handle from softc.
- The lpbb(4) driver just grabs Giant for now.  This will be refined later
  when ppbus(4) is locked.
- As was done with smbus earlier, move the DRIVER_MODULE() lines to match
  the bus driver (either iicbus or iicbb) to the bridge driver into the
  bridge drivers.

Tested by:	sam (arm/ixp425)
2008-08-04 20:46:15 +00:00
Olivier Houchard
c611e0d78c Do not modify td->td_intr_nesting_level, it is now done in the MI code.
This fixes the cpu time being falsely reported as interrupt time.

MFC after:	3 days
2008-08-04 20:29:39 +00:00
Rafal Jaworowski
1cba14c456 Fix ARM nocache allocator:
- let the loop iterate every page (as intended), and not some multiplies
  (which led to a fake exhaustion of the ARM_NOCACHE_KVA_SIZE)

- eliminate using MIN(): it compared number of pages vs. address
  (ARM_TP_ADDRESS), which was bogus

Reviewed by:	cognet, imp
Obtained from:	Piotr Ziecik kosmo ! semihalf dot com
MFC after:	3 days
2008-08-04 14:47:49 +00:00
Olivier Houchard
cf1f6a4da0 Remove unneeded #include <stdlib.h> (?)
MFC after:	3 days
2008-08-04 14:37:32 +00:00
Olivier Houchard
f0fe5e9127 Add "add pc, whatever" as a branch instruction, we use it in memcpy().
MFC after:	3 days
2008-08-03 15:35:32 +00:00
Ed Schouten
200d80cd74 Disconnect drivers that haven't been ported to MPSAFE TTY yet.
As clearly mentioned on the mailing lists, there is a list of drivers
that have not been ported to the MPSAFE TTY layer yet. Remove them from
the kernel configuration files. This means people can now still use
these drivers if they explicitly put them in their kernel configuration
file, which is good.

People should keep in mind that after August 10, these drivers will not
work anymore. Even though owners of the hardware are capable of getting
these drivers working again, I will see if I can at least get them to a
compilable state (if time permits).
2008-08-03 10:32:17 +00:00
Warner Losh
93757e6b48 Kernel config for the Linksys NSLU2. This is just a basic configuration,
with no support for the LED, buttons, realtime clock or flash support.
2008-08-03 07:10:25 +00:00
Olivier Houchard
fcfc49979c Handle ldr pc, [reg] in branch_taken().
Obtained from:	NetBSD
MFC after:	3 days
2008-08-03 01:53:14 +00:00
Olivier Houchard
697292d902 Add blx as a branch instruction.
MFC after:	3 days
2008-08-03 01:51:30 +00:00
Warner Losh
c65b00d158 Minor style nit. 2008-08-02 22:53:43 +00:00
Olivier Houchard
4ed897041f Add yet another branch instruction.
Obtained from:	NetBSD
MFC after:	3 days
2008-08-02 12:48:30 +00:00
Ed Schouten
6d09e4f1a8 Make the at91 uart(4) driver compile again.
As of r178766 this driver didn't compile anymore, because it missed a
switch()-statement. I'm getting tired of seeing this driver being broken
for two months already. When I run `make universe', everything passes,
except the BWCT kernel configuration file.
2008-08-02 08:01:56 +00:00
Warner Losh
504ff11df7 ixp425 parts aren't multicore, so remove the SMP option. They also
don't support the ioapic either, so remove that option too.  These
were commented out, but could never be enabled, unlike the other
options in the file that are commented out.
2008-08-02 07:20:30 +00:00
Warner Losh
319150067f Conform to the options<space><tab> convention everywhere in this file.
This is just a white space change, no functional change.
2008-08-02 07:18:12 +00:00
Olivier Houchard
939e434def Store the PC while context switching, for the benefits of DDB. 2008-08-02 00:10:38 +00:00
Stanislav Sedov
cde9cd82fe - Whitespace fixes.
Approved by:	gonzo
MFC after:	1 week
2008-07-22 14:04:06 +00:00
Alan Cox
7b4270021d Eliminate unused global variables. (These global variables became fields of
struct kva_md_info many years ago.)
2008-07-18 06:14:36 +00:00
Bernd Walter
fe228e4a7a fix multicast hash register definition 2008-07-12 23:40:07 +00:00
Ed Schouten
721351876c Remove the unused major/minor numbers from iodev and memdev.
Now that st_rdev is being automatically generated by the kernel, there
is no need to define static major/minor numbers for the iodev and
memdev. We still need the minor numbers for the memdev, however, to
distinguish between /dev/mem and /dev/kmem.

Approved by:	philip (mentor)
2008-06-25 07:45:31 +00:00
Kevin Lo
57deb21ad4 Fix a typo: i80321_pci_probe -> i81342_pci_probe 2008-06-12 01:46:06 +00:00
Kevin Lo
45c08eec9a Add the pxa_teardown_intr() bus method function to de-associate the
interrupt handler
2008-06-10 06:06:15 +00:00
Kevin Lo
43d8707e0f Pull all the code to deal with bus space methods into a shared set of
routines.
2008-06-10 03:44:14 +00:00
Wojciech A. Koszek
10170e4559 Since we create a DMA tag "mtag" for TX map with bus_dmamap_create(),
we must synchronize such a map against "mtag" with bus_dmamap_sync(),
not the tag designated for RX map.

Fix it.

Approved by:	cognet
2008-06-09 21:51:48 +00:00
Kevin Lo
247ac1530d Remove sa1_cache_clean_addr 2008-06-09 05:53:04 +00:00
Kevin Lo
6799ed5dd8 Unify arminit() and clean up 2008-06-09 05:50:42 +00:00
Benno Rice
9722a61504 Support for the XScale PXA255 SoC as found on the Gumstix Basix and Connex
boards.  This is enough to net-boot to multiuser.

Also supported is the SMSC LAN91C111 parts used on the netCF, netDUO and netMMC
add-on boards.

I'll be putting some instructions on how to boot this on the Gumstix boards
online soon.

This is still fairly rough and will be refined over time but I felt it was
better to get this out there where other people can help out.
2008-06-06 05:08:09 +00:00
Warner Losh
70311cad4b Release the resources for the registers for the TWI device with
SYS_RES_MEMORY to match how we allocate them...

Noticed by: Ian Lepore
2008-05-28 14:35:15 +00:00
Alan Cox
d1fdd63483 The VM system no longer uses setPQL2(). Remove it and its helpers. 2008-05-23 04:03:54 +00:00
Alan Cox
1ec1304bdb Retire pmap_addr_hint(). It is no longer used. 2008-05-18 04:16:57 +00:00
Alan Cox
2d17f90775 Add a stub for pmap_align_superpage() on machines that don't (yet)
implement pmap-level support for superpages.
2008-05-09 23:31:42 +00:00
Peter Wemm
43d7128c14 Expand kdb_alt_break a little, most commonly used with the option
ALT_BREAK_TO_DEBUGGER.  In addition to "Enter ~ ctrl-B" (to enter the
debugger), there is now "Enter ~ ctrl-P" (force panic) and
"Enter ~ ctrl-R" (request clean reboot, ala ctrl-alt-del on syscons).

We've used variations of this at work.  The force panic sequence is
best used with KDB_UNATTENDED for when you just want it to dump and
get on with it.

The reboot request is a safer way of getting into single user than
a power cycle.  eg: you've hosed the ability to log in (pam, rtld, etc).
It gives init the reboot signal, which causes an orderly reboot.

I've taken my best guess at what the !x86 and non-sio code changes
should be.

This also makes sio release its spinlock before calling KDB/DDB.
2008-05-04 23:29:38 +00:00
Jeff Roberson
6c47aaae12 - Add an integer argument to idle to indicate how likely we are to wake
from idle over the next tick.
 - Add a new MD routine, cpu_wake_idle() to wakeup idle threads who are
   suspended in cpu specific states.  This function can fail and cause the
   scheduler to fall back to another mechanism (ipi).
 - Implement support for mwait in cpu_idle() on i386/amd64 machines that
   support it.  mwait is a higher performance way to synchronize cpus
   as compared to hlt & ipis.
 - Allow selecting the idle routine by name via sysctl machdep.idle.  This
   replaces machdep.cpu_idle_hlt.  Only idle routines supported by the
   current machine are permitted.

Sponsored by:	Nokia
2008-04-25 05:18:50 +00:00
Poul-Henning Kamp
9b4a8ab7ba Now that all platforms use genclock, shuffle things around slightly
for better structure.

Much of this is related to <sys/clock.h>, which should really have
been called <sys/calendar.h>, but unless and until we need the name,
the repocopy can wait.

In general the kernel does not know about minutes, hours, days,
timezones, daylight savings time, leap-years and such.  All that
is theoretically a matter for userland only.

Parts of kernel code does however care: badly designed filesystems
store timestamps in local time and RTC chips almost universally
track time in a YY-MM-DD HH:MM:SS format, and sometimes in local
timezone instead of UTC.  For this we have <sys/clock.h>

<sys/time.h> on the other hand, deals with time_t, timeval, timespec
and so on.  These know only seconds and fractions thereof.

Move inittodr() and resettodr() prototypes to <sys/time.h>.
Retain the names as it is one of the few surviving PDP/VAX references.

Move startrtclock() to <machine/clock.h> on relevant platforms, it
is a MD call between machdep.c/clock.c.  Remove references to it
elsewhere.

Remove a lot of unnecessary <sys/clock.h> includes.

Move the machdep.disable_rtc_set sysctl to subr_rtc.c where it belongs.
XXX: should be kern.disable_rtc_set really, it's not MD.
2008-04-22 19:38:30 +00:00
Poul-Henning Kamp
0051271e12 Make genclock standard on all platforms.
Thanks to: grehan & marcel for platform support on ia64 and ppc.
2008-04-21 10:09:55 +00:00
Olivier Houchard
e19357d3a5 On the AT91, we need to write on the EOI register after we handle an
interrupt. So, add a new function pointer, arm_post_filter, which defaults
to NULL, and which will be used as the post_filter arg for
intr_event_create(). Set it properly for the AT91, so that it boots again.

Reported by:	hps
2008-04-20 23:29:06 +00:00
Sam Leffler
b032f27c36 Multi-bss (aka vap) support for 802.11 devices.
Note this includes changes to all drivers and moves some device firmware
loading to use firmware(9) and a separate module (e.g. ral).  Also there
no longer are separate wlan_scan* modules; this functionality is now
bundled into the wlan module.

Supported by:	Hobnob and Marvell
Reviewed by:	many
Obtained from:	Atheros (some bits)
2008-04-20 20:35:46 +00:00
Jeff Roberson
9b33b154b5 - Add the interrupt vector number to intr_event_create so MI code can
lookup hard interrupt events by number.  Ignore the irq# for soft intrs.
 - Add support to cpuset for binding hardware interrupts.  This has the
   side effect of binding any ithread associated with the hard interrupt.
   As per restrictions imposed by MD code we can only bind interrupts to
   a single cpu presently.  Interrupts can be 'unbound' by binding them
   to all cpus.

Reviewed by:	jhb
Sponsored by:	Nokia
2008-04-11 03:26:41 +00:00
Kevin Lo
97344c5281 Remove some long-dead code
Reviewed by: cognet
2008-04-08 10:24:42 +00:00
Olivier Houchard
a90c089ccd Remove bus_space_generic.c from the per-plarform files. Having it in the
per-cpu files should be enough.
2008-04-05 21:57:11 +00:00
Olivier Houchard
e5add3326c Add bus_space_generic.c for the i81342 as well. 2008-04-05 21:51:11 +00:00
John Baldwin
1ee1b68792 Add a MI intr_event_handle() routine for the non-INTR_FILTER case. This
allows all the INTR_FILTER #ifdef's to be removed from the MD interrupt
code.
- Rename the intr_event 'eoi', 'disable', and 'enable' hooks to
  'post_filter', 'pre_ithread', and 'post_ithread' to be less x86-centric.
  Also, add a comment describe what the MI code expects them to do.
- On amd64, i386, and powerpc this is effectively a NOP.
- On arm, don't bother masking the interrupt unless the ithread is
  scheduled in the non-INTR_FILTER case to match what INTR_FILTER did.
  Also, don't bother unmasking the interrupt in the post_filter case if
  we never masked it.  The INTR_FILTER case had been doing this by having
  arm_unmask_irq for the post_filter (formerly 'eoi') hook.
- On ia64, stray interrupts are now masked for the non-INTR_FILTER case.
  They were already masked in the INTR_FILTER case.
- On sparc64, use the a NULL pre_ithread hook and use intr_enable_eoi() for
  both the 'post_filter' and 'post_ithread' hooks to match what the
  non-INTR_FILTER code did.
- On sun4v, retire the ithread wrapper hack by using an appropriate
  'post_ithread' hook instead (it's what 'post_ithread'/'enable' was
  designed to do even in 5.x).

Glanced at by:	piso
Reviewed by:	marius
Requested by:	marius [1], [5]
Tested on:	amd64, i386, arm, sparc64
2008-04-05 19:58:30 +00:00
Warner Losh
1ff6c09714 Fix stupid typo 2008-04-04 18:22:16 +00:00
Rafal Jaworowski
367bbd3833 Make kernel.tramp build properly on ARM9E.
Reviewed by:	imp
Approved by:	cognet (mentor)
2008-04-04 17:35:24 +00:00
Rafal Jaworowski
15898edac1 Now really add the bus_space_generic.c file...
Reviewed by:	sam
Approved by:	cognet (mentor)
2008-04-03 18:28:34 +00:00
Rafal Jaworowski
47e972c91a Refactor certain ARM bus space methods: instead of having multiple copies of
the same code introduce sys/arm/arm/bus_space_generic.c for a shared set of
routines.

Reviewed by:	sam
Approved by:	cognet (mentor)
2008-04-03 18:22:08 +00:00
Rafal Jaworowski
b7170e5c34 Fix AVILA build.
Reviewed by:	sam
Approved by:	cognet(mentor)
2008-04-03 18:20:39 +00:00
Warner Losh
aa037d58ea Take the first baby step towards unifying and cleaning up arminit():
- Pull all the code to deal with the trampoline stuff into one
	  centeralized place and use it from everywhere.
	- Some minor style tidiness

Reviewed by: tinguely
2008-04-03 16:44:50 +00:00
Warner Losh
d93b192e7a KERNBASE + 0x00200000 is the same thing as KERNVIRTADDR on this
platform, so use the latter in preference to the former.  This makes
the fake_preload setup be the same between kb920x_machdep.c and
avila_machdep.c....
2008-04-03 06:14:23 +00:00
Warner Losh
e5a11098e8 Remove unnecessary #define. 2008-04-03 06:07:45 +00:00
Doug Rabson
fa9d9930ca Add kernel module support for nfslockd and krpc. Use the module system
to detect (or load) kernel NLM support in rpc.lockd. Remove the '-k'
option to rpc.lockd and make kernel NLM the default. A user can still
force the use of the old user NLM by building a kernel without NFSLOCKD
and/or removing the nfslockd.ko module.
2008-03-27 11:54:20 +00:00
John Birrell
e483943791 When building a kernel module, define MAXCPU the same as SMP so
that modules work with and without SMP.
2008-03-27 05:03:26 +00:00
Olivier Houchard
2c361379e4 We need to prototype _start() as well, as we use it to test if we're running
from flash or from RAM.

Reported by:	imp
MFC After:	3 days
2008-03-22 20:34:07 +00:00
Sam Leffler
dd5ac081b8 add hints to specify how NPE ports are mapped to MAC+PHY; these
could be commented out as they just duplicate the defaults that
are built into the code

Reviewed by:	imp
MFC after:	1 week
2008-03-22 16:55:51 +00:00
Sam Leffler
c7ad0d8736 Improve mac+phy configuration so that hints can be used to describe
layouts different than the defaults:
o hint.npe.0.mac="A", "B", etc. specifies the window for MAC register accesses
o hint.npe.0.mii="A", "B", etc. specifies PHY registers
o hint.npe.1.phy=%d specifies the PHY to map to a port

This allows devices like NSLU to be setup w/o code changes and will
also be used for forthcoming support for more Avila boards.

Reviewed by:	imp
MFC after	1 week
2008-03-22 16:53:28 +00:00
Sam Leffler
ef0e4fc4f5 add usb devices and more wlan stuff now that usb is functional
MFC after:	1 month
2008-03-20 17:44:58 +00:00
Sam Leffler
f9f98a6a18 map device 5; the optional USB controller on Gateworks 2348 boards
shows up here instead of the minipci slot at J4

Reviewed by:	cognet, imp
MFC after:	1 week
2008-03-20 15:54:19 +00:00
John Baldwin
6d2d1c044f Simplify the interrupt code a bit:
- Always include the ie_disable and ie_eoi methods in 'struct intr_event'
  and collapse down to one intr_event_create() routine.  The disable and
  eoi hooks simply aren't used currently in the !INTR_FILTER case.
- Expand 'disab' to 'disable' in a few places.
- Use function casts for arm and i386:intr_eoi_src() instead of wrapper
  routines since to trim one extra indirection.

Compiled on:	{arm,amd64,i386,ia64,ppc,sparc64} x {FILTER, !FILTER}
Tested on:	{amd64,i386} x {FILTER, !FILTER}
2008-03-17 22:42:01 +00:00
Robert Watson
237fdd787b In keeping with style(9)'s recommendations on macros, use a ';'
after each SYSINIT() macro invocation.  This makes a number of
lightweight C parsers much happier with the FreeBSD kernel
source, including cflow's prcc and lxr.

MFC after:	1 month
Discussed with:	imp, rink
2008-03-16 10:58:09 +00:00
John Baldwin
eaf86d1678 Add preliminary support for binding interrupts to CPUs:
- Add a new intr_event method ie_assign_cpu() that is invoked when the MI
  code wishes to bind an interrupt source to an individual CPU.  The MD
  code may reject the binding with an error.  If an assign_cpu function
  is not provided, then the kernel assumes the platform does not support
  binding interrupts to CPUs and fails all requests to do so.
- Bind ithreads to CPUs on their next execution loop once an interrupt
  event is bound to a CPU.  Only shared ithreads are bound.  We currently
  leave private ithreads for drivers using filters + ithreads in the
  INTR_FILTER case unbound.
- A new intr_event_bind() routine is used to bind an interrupt event to
  a CPU.
- Implement binding on amd64 and i386 by way of the existing pic_assign_cpu
  PIC method.
- For x86, provide a 'intr_bind(IRQ, cpu)' wrapper routine that looks up
  an interrupt source and binds its interrupt event to the specified CPU.
  MI code can currently (ab)use this by doing:

	intr_bind(rman_get_start(irq_res), cpu);

  however, I plan to add a truly MI interface (probably a bus_bind_intr(9))
  where the implementation in the x86 nexus(4) driver would end up calling
  intr_bind() internally.

Requested by:	kmacy, gallatin, jeff
Tested on:	{amd64, i386} x {regular, INTR_FILTER}
2008-03-14 19:41:48 +00:00
Rafal Jaworowski
507ea268f2 Respect RF_SHAREABLE flag in ARM nexus_setup_intr()
Reviewed by:	imp
Approved by:	cognet (mentor)
2008-03-12 15:46:25 +00:00
Rafal Jaworowski
1397332d85 Improve ARM bus_dmamap_load_buffer() error handling.
Reviewed by:	imp
Approved by:	cognet (mentor)
Spotted by:	Grzegorz Bernacki gjb AT semihalf DOT com
2008-03-12 15:31:37 +00:00
Jeff Roberson
6617724c5f Remove kernel support for M:N threading.
While the KSE project was quite successful in bringing threading to
FreeBSD, the M:N approach taken by the kse library was never developed
to its full potential.  Backwards compatibility will be provided via
libmap.conf for dynamically linked binaries and static binaries will
be broken.
2008-03-12 10:12:01 +00:00
Olivier Houchard
af9db76b65 MFi386:
revision 1.6
date: 2004/08/21 18:50:34;  author: alc;  state: Exp;  lines: +3 -1
Properly free the temporary sf_buf in uiomove_fromphys() if a copyin or
copyout fails.

Obtained from: DragonFlyBSD

Spotted out by:	Mark Tinguely
MFC After:	3 days
2008-03-06 22:27:35 +00:00
Olivier Houchard
41c0d2813b Remove unused pv_list_count from the vm_page, and pm_count from the struct
pmap.

Submitted by:	Mark Tinguely
2008-03-06 21:59:47 +00:00
Kevin Lo
cecb2ec213 Add rl(4) support 2008-03-05 07:55:45 +00:00
Kevin Lo
223a605ac5 Convert to be a 2-clause bsd-only license.
Pointed out by: rwatson
2008-03-03 06:39:36 +00:00
Robert Watson
1fb18eea38 Remove errant % in license comment.
MFC after:	3 days
2008-02-26 11:45:32 +00:00
Robert Watson
18d59070d6 On the ixp425, when we fail to initialize the memory rman instance, the
panic message should read "memory", not "IRQ".

MFC after:	3 days
2008-02-26 11:44:41 +00:00
Rafal Jaworowski
72c6438b52 ARM locore cosmetics.
Approved by:	cognet (mentor)
2008-02-05 10:23:42 +00:00
Rafal Jaworowski
e081d0ac19 Improve ARM_TP_ADDRESS and RAS area.
De-hardcode usage of ARM_TP_ADDRESS and RAS local storage, and move this
special purpose page to a more convenient place i.e. after the vectors high
page, more towards the end of address space. Previous location (0xe000_0000)
caused grief if KVA was to go beyond the default limit.

Note that ARM world rebuilding is required after this change since the
location of ARM_TP_ADDRESS is shared between kernel and userland.

Submitted by:	Grzegorz Bernacki (gjb AT semihalf dot com)
Reviewed by:	imp
Approved by:	cognet (mentor)
2008-02-05 10:22:33 +00:00
Olivier Houchard
8f2948f1c1 Bring in the nice work from Mark Tinguely on arm pmap.
The only downside is that it renames pmap_vac_me_harder() to pmap_fix_cache().
From Mark's email on -arm :
pmap_get_vac_flags(), pmap_vac_me_harder(), pmap_vac_me_kpmap(), and
pmap_vac_me_user() has been rewritten as pmap_fix_cache() to be more
efficient in the kernel map case. I also removed the reference to
the md.kro_mappings, md.krw_mappings, md.uro_mappings, and md.urw_mappings
counts.

In pmap_clearbit(), we can also skip over tests and writeback/invalidations
in the PVF_MOD and PVF_REF cases if those bits are not set in the pv_flag.
PVF_WRITE will turn caching back on and remove the PV_MOD bit.

In pmap_nuke_pv(), the vm_page_flag_clear(pg, PG_WRITEABLE) has been moved
to the pmap_fix_cache().

We can be more agressive in attempting to turn caching back on by calling
pmap_fix_cache() at times that may be appropriate to turn cache on
(a kernel mapping has been removed, a write has been removed or a read
has been removed and we know the mapping does not have multiple write
mappings to a page).

In pmap_remove_pages() the cpu_idcache_wbinv_all() is moved to happen
before the page tables are NULLed because the caches are virtually
indexed and virtually tagged.

In pmap_remove_all(), the pmap_remove_write(m) is added before the
page tables are NULLed because the caches are virtually indexed and
virtually tagged. This also removes the need for the caches fixing routine
(whichever is being used pmap_vac_me_harder() or pmap_fix_cache()) to be
called on any of these mappings.

In pmap_remove(), I simplified the cache cleaning process and removed
extra TLB removals. Basically if more than PMAP_REMOVE_CLEAN_LIST_SIZE
are removed, then just flush the entire cache.
2008-01-31 00:05:40 +00:00
Ruslan Ermilov
007b1b7bae Add a wrapper function that bound checks writes to the dump device. 2008-01-28 19:04:07 +00:00
John Baldwin
304a4c6fb1 - Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), and
re_defrag() and use m_collapse() instead.
- Replace a reference to ath_defrag() in a comment in if_wpi.c with
  m_collapse().
2008-01-17 23:37:47 +00:00
Olivier Houchard
10457dbaf2 Unbreak build by adding the missing parameter to pmap_enter(). 2008-01-17 12:41:59 +00:00
Olivier Houchard
253d846886 Back when I committed the arm port, I've been asked to move
memcpy/memset/memcmp and friends from libkern/arm to arm/arm/support.S, and so
I did, but in the process, I didn't add the appropriate copyrights.
This is a major oversight from me, and I apology to the NetBSD people for it.

MFC After:	1 day
2008-01-12 21:11:43 +00:00
Olivier Houchard
b94ba2b9c4 Add a missing \n. 2008-01-07 00:36:09 +00:00
Alan Cox
eb2a051720 Add an access type parameter to pmap_enter(). It will be used to implement
superpage promotion.

Correct a style error in kmem_malloc(): pmap_enter()'s last parameter is
a Boolean.
2008-01-03 07:34:34 +00:00
Warner Losh
cd093614f3 Use correct function name in panic message 2008-01-03 06:44:12 +00:00
Warner Losh
409fe84319 Modernize comment about diagnostic. 2008-01-03 06:31:41 +00:00
Alan Cox
b8e7fc24fe Add configuration knobs for the superpage reservation system. Initially,
the reservation will only be enabled on amd64.
2007-12-27 16:45:39 +00:00
Robert Watson
3de213cc00 Add a new 'why' argument to kdb_enter(), and a set of constants to use
for that argument.  This will allow DDB to detect the broad category of
reason why the debugger has been entered, which it can use for the
purposes of deciding which DDB script to run.

Assign approximate why values to all current consumers of the
kdb_enter() interface.
2007-12-25 17:52:02 +00:00
Stanislav Sedov
05a824e9fa - Fix a typo in comments.
MFC after:	1 week
Approved by:	cognet
2007-12-23 23:31:27 +00:00
Warner Losh
1981bc3b8a Actually program the interrupt controller for priorities. As we
support more AT91 platforms, we'll need to move this into some
platform init routine.
2007-12-19 17:34:17 +00:00
Kevin Lo
5497f4c53e Use M_NOWAIT instead of M_WAITOK to cause malloc() to return NULL
Reviewed by: imp
2007-12-17 05:08:54 +00:00
Stanislav Sedov
1e6774a44e - Don't return 0xffff if PHY id isn't equal 0. This allows PHYs with
non-zero addresses to be used.

Approved by:	cognet
MFC after:	2 weeks
2007-12-16 12:57:12 +00:00
Olivier Houchard
c8ffd860a5 There's no need to call pmap_vac_me_harder() in pmap_protect(), as it
already happened in pmap_modify_pv().

Submitted by:	Mark Tinguely <tinguely AT casselton DOT net>
2007-12-11 20:35:44 +00:00
Joseph Koshy
0da7aa7a7d Add stubs to unbreak LINT. 2007-12-07 13:45:47 +00:00
Olivier Houchard
b358d3906a Fix style in previous commit.
Pointed out by:	njl
2007-12-07 10:42:11 +00:00
Olivier Houchard
91f2b6797a Erm, add a missing else, we do not want to increase the mapping counters for
both kernel and userland when we create a pv for pmap_kernel.

Reported by:	Mark Tinguely <tinguely AT casselton DOT net>
MFC After:	3 days
2007-12-06 23:17:24 +00:00
Robert Watson
3c90d1ea74 Break out stack(9) from ddb(4):
- Introduce per-architecture stack_machdep.c to hold stack_save(9).
- Introduce per-architecture machine/stack.h to capture any common
  definitions required between db_trace.c and stack_machdep.c.
- Add new kernel option "options STACK"; we will build in stack(9) if it is
  defined, or also if "options DDB" is defined to provide compatibility
  with existing users of stack(9).

Add new stack_save_td(9) function, which allows the capture of a stacktrace
of another thread rather than the current thread, which the existing
stack_save(9) was limited to.  It requires that the thread be neither
swapped out nor running, which is the responsibility of the consumer to
enforce.

Update stack(9) man page.

Build tested:	amd64, arm, i386, ia64, powerpc, sparc64, sun4v
Runtime tested:	amd64 (rwatson), arm (cognet), i386 (rwatson)
2007-12-02 20:40:35 +00:00
Olivier Houchard
18836eac48 Fix a potential bug in pmap :
We used to allocate the domains 0-14 for userland, and leave the domain 15
for the kernel. Now supersections requires the use of domain 0, so we
switched the kernel domain to 0, and use 1-15 for userland.
How it's done currently, the kernel domain could be allocated for a
userland process.
So switch back to the previous way we did things, set the first available
domain to 0, and just add 1 to get the real domain number in the struct pmap.

Reported by:	Mark Tinguely <tinguely AT casselton DOT net>
MFC After:	3 days
2007-12-02 15:26:30 +00:00
Olivier Houchard
35af41b0a6 Move the strongarm-specific files from conf/files.arm to sa11x0/files.sa11xO.
Submitted by:	Rafal Jaworowski <raj AT semihalf DOT com>
2007-12-02 13:12:21 +00:00
Olivier Houchard
f9af595fc3 Cleanup : make nexus standard, as it is mandatory anyway.
Garbage-collect unused nexus_io.c and nexus_io_asm.S

Submitted by:	Rafal Jaworowski <raj AT semihalf DOT com>
2007-12-02 13:10:42 +00:00
Olivier Houchard
b21a1da537 Close a race.
The RAS implementation would set the end address, then the start
address.  These were used by the kernel to restart a RAS sequence if
it was interrupted.  When the thread switching code ran, it would
check these values and adjust the PC and clear them if it did.

However, there's a small flaw in this scheme.  Thread T1, sets the end
address and gets preempted.  Thread T2 runs and also does a RAS
operation.  This resets end to zero.  Thread T1 now runs again and
sets start and then begins the RAS sequence, but is preempted before
the RAS sequence executes its last instruction.  The kernel code that
would ordinarily restart the RAS sequence doesn't because the PC isn't
between start and 0, so the PC isn't set to the start of the sequence.
So when T1 is resumed again, it is at the wrong location for RAS to
produce the correct results.  This causes the wrong results for the
atomic sequence.

The window for the first race is 3 instructions.  The window for the
second race is 5-10 instructions depending on the atomic operation.
This makes this failure fairly rare and hard to reproduce.

Mutexs are implemented in libthr using atomic operations.  When the
above race would occur, a lock could get stuck locked, causing many
downstream problems, as you might expect.

Also, make sure to reset the start and end address when doing a syscall, or
a malicious process could set them before doing a syscall.

Reviewed by: imp, ups (thanks guys)
Pointy hat to:	cognet
MFC After:	3 days
2007-12-02 12:49:28 +00:00
Olivier Houchard
43e23d1b4c Fixes for ARM9/ARM10 :
Call uma_sel_align() there at well.
Set CPU_CONTROL_VECRELOC if we're using the high vectors page.

Submitted by:	Rafal Jaworowski <raj AT semihalf DOT com>
MFC After:	1 week
2007-11-28 22:55:55 +00:00
Olivier Houchard
85d18774de Correct the logic : we can just invalidate the cache lines, and not
write-back them, only if PREWRITE is not set, and if the buffer is
cache-line aligned.

MFC After:	1 week
2007-11-28 22:21:17 +00:00
Olivier Houchard
9acb0e651b In atomic_fetchadd_32(), do not blindly increase the value of %3.
It should just contain the value we want to add, as if we're interrupted
between the add and the str, we will restart from the beginning. Just use
a register we can scratch instead.

MFC After:	1 week
2007-11-27 22:12:05 +00:00
John Baldwin
23d34db956 Remove the 'needbounce' variable from the _bus_dmamap_load_buffer()
routine.  It is not needed as the existing tests for segment coalescing
already handle bounced addresses and it prevents legal segment coalescing
in certain edge cases.

MFC after:	1 week
Reviewed by:	scottl
2007-11-27 17:28:12 +00:00
Alan Cox
59677d3c0e Prevent the leakage of wired pages in the following circumstances:
First, a file is mmap(2)ed and then mlock(2)ed.  Later, it is truncated.
Under "normal" circumstances, i.e., when the file is not mlock(2)ed, the
pages beyond the EOF are unmapped and freed.  However, when the file is
mlock(2)ed, the pages beyond the EOF are unmapped but not freed because
they have a non-zero wire count.  This can be a mistake.  Specifically,
it is a mistake if the sole reason why the pages are wired is because of
wired, managed mappings.  Previously, unmapping the pages destroys these
wired, managed mappings, but does not reduce the pages' wire count.
Consequently, when the file is unmapped, the pages are not unwired
because the wired mapping has been destroyed.  Moreover, when the vm
object is finally destroyed, the pages are leaked because they are still
wired.  The fix is to reduce the pages' wired count by the number of
wired, managed mappings destroyed.  To do this, I introduce a new pmap
function pmap_page_wired_mappings() that returns the number of managed
mappings to the given physical page that are wired, and I use this
function in vm_object_page_remove().

Reviewed by: tegge
MFC after: 6 weeks
2007-11-17 22:52:29 +00:00
Olivier Houchard
49ec6888e2 Add a kernel config file for the Hot-e HL200 (AT91RM92 based).
Many thanks to John Nicholls from Thinklinx for sending sample hardware.
2007-11-17 17:25:22 +00:00
Marcel Moolenaar
0c3967e7fe o Rename cpu_thread_setup() to cpu_thread_alloc() to better
communicate that it relates to (is called by) thread_alloc()
o  Add cpu_thread_free() which is called from thread_free()
   to counter-act cpu_thread_alloc().

i386:	Have cpu_thread_free() call cpu_thread_clean() to
	preserve behaviour.
ia64:	Have cpu_thread_free() call mtx_destroy() for the
	mutex initialized in cpu_thread_alloc().

PR: ia64/118024
2007-11-14 20:21:54 +00:00
Julian Elischer
431f890614 generally we are interested in what thread did something as
opposed to what process. Since threads by default have teh name of the
process unless over-written with more useful information, just print the
thread name instead.
2007-11-14 06:21:24 +00:00
Olivier Houchard
0559b904bc Add entries for the L2 cache-related functions for armv5.
Spotted out by: Rafal Jaworowski
2007-11-08 13:19:08 +00:00
Konstantin Belousov
89b57fcf01 Fix for the panic("vm_thread_new: kstack allocation failed") and
silent NULL pointer dereference in the i386 and sparc64 pmap_pinit()
when the kmem_alloc_nofault() failed to allocate address space. Both
functions now return error instead of panicing or dereferencing NULL.

As consequence, vmspace_exec() and vmspace_unshare() returns the errno
int. struct vmspace arg was added to vm_forkproc() to avoid dealing
with failed allocation when most of the fork1() job is already done.

The kernel stack for the thread is now set up in the thread_alloc(),
that itself may return NULL. Also, allocation of the first process
thread is performed in the fork1() to properly deal with stack
allocation failure. proc_linkup() is separated into proc_linkup()
called from fork1(), and proc_linkup0(), that is used to set up the
kernel process (was known as swapper).

In collaboration with:	Peter Holm
Reviewed by:	jhb
2007-11-05 11:36:16 +00:00
Olivier Houchard
64a2135deb Remove a staled comment, NPE-C should work fine.
Reviewed by:	sam
2007-11-04 21:54:52 +00:00
Kevin Lo
92e7748daf __CPU_XSCALE_PXA2XX -> CPU_XSCALE_PXA2X0 2007-11-01 10:01:15 +00:00
Kevin Lo
0c6faf446d Don't define get_cachetype() for CPU_ARM9E unless it's going to be used. 2007-10-31 07:27:31 +00:00
Warner Losh
855f957fc1 kill commented out line of code. 2007-10-29 21:01:50 +00:00
Olivier Houchard
ed0b604f1f Add an option to be able to override the value of the AT91 master clock
frequency. It'd be better to be able to calculate it at runtime, but we need
the information very early, to setup the uart.
2007-10-25 23:02:42 +00:00
Olivier Houchard
2b953358ed Move some KB920x-specific options into the KB920x file. 2007-10-25 22:57:19 +00:00
Olivier Houchard
9e753c174f Oooops, get the end of the memory right. 2007-10-25 22:43:17 +00:00
Olivier Houchard
cb3d8b2510 KERNBASE should really be KERNVIRTADDR there too.
MFC after:	1 week
2007-10-24 23:41:46 +00:00
Olivier Houchard
b7630a1145 In ate_get_mac(), try to get the mac address in the right order, at least
in the same order as it's set in ate_set_mac.
I remember a discussion about this on -arm, but apparently nothing was done.
Warner, is this wrong ?

X-MFC After:	proper review
2007-10-24 23:12:19 +00:00
Olivier Houchard
12e12ab1a8 Handle the case where PHYSADDR != KERNPHYSADDR (ie we do not load the kernel
at the beginning of the RAM).

MFC After:	1 week
2007-10-24 22:26:54 +00:00
Olivier Houchard
b2c9a0439a Correct a comment, this was not true anymore. 2007-10-24 22:24:32 +00:00
Warner Losh
5a4eb2d84b correct guard variable names. 2007-10-18 05:43:44 +00:00
Warner Losh
63b2597849 Merge support from p4 (from NetBSD) for arm9e and arm10, arm11 cores. Not
yet connected to the build, but reduces diffs to p4 repo.

Obtained from: NetBSD
2007-10-18 05:33:06 +00:00
Warner Losh
dfb7d4cdef Merge definitions for ARM9E, ARM10 and ARM11 processors from p4 (which
got them from NetBSD).
2007-10-18 05:06:58 +00:00
Olivier Houchard
f60a7dc355 Use the direct mapping, if available, for pmap_zero_page_xscale() as well. 2007-10-16 20:40:04 +00:00
Olivier Houchard
0f7432f516 Do not use __XSCALE__ to detect if pld/strd/ldrd is available, use
_ARM_ARCH_5E instead.

MFC After:	3 days
2007-10-13 12:05: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
Kevin Lo
976b010645 Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
Marius Strobl
55aaf894e8 Make the PCI code aware of PCI domains (aka PCI segments) so we can
support machines having multiple independently numbered PCI domains
and don't support reenumeration without ambiguity amongst the
devices as seen by the OS and represented by PCI location strings.
This includes introducing a function pci_find_dbsf(9) which works
like pci_find_bsf(9) but additionally takes a domain number argument
and limiting pci_find_bsf(9) to only search devices in domain 0 (the
only domain in single-domain systems). Bge(4) and ofw_pcibus(4) are
changed to use pci_find_dbsf(9) instead of pci_find_bsf(9) in order
to no longer report false positives when searching for siblings and
dupe devices in the same domain respectively.
Along with this change the sole host-PCI bridge driver converted to
actually make use of PCI domain support is uninorth(4), the others
continue to use domain 0 only for now and need to be converted as
appropriate later on.
Note that this means that the format of the location strings as used
by pciconf(8) has been changed and that consumers of <sys/pciio.h>
potentially need to be recompiled.

Suggested by:	jhb
Reviewed by:	grehan, jhb, marcel
Approved by:	re (kensmith), jhb (PCI maintainer hat)
2007-09-30 11:05:18 +00:00
Olivier Houchard
f530d4f06d Ok I hope I got it right this time.
After discussion with Sam, switch back to use firmware(9) instead of
having the firmware in hex format.
Put the binary firmware uuencoded into sys/contrib/dev/npe, and slap a
LICENSE file, as found on the Intel website.

Approved by:	re (blanket), mux (mentor)
MFC After:	1 week
2007-09-27 22:39:49 +00:00
Olivier Houchard
88af309a0b Now that Intel changed the license for the NPE firmware, import it directly
hexed into our tree, instead of requiring the user to download it.

Approved by:	re (blanket)
MFC after:	1 week
2007-09-27 21:18:34 +00:00
Olivier Houchard
857539e578 Fix a comment to reflect the truth.
Spotted out by:	Marius Nuennerich <marius.nuennerich AT gmx D0T de>
Approved by:	re (blanket)
2007-09-27 20:52:17 +00:00
Alan Cox
7bfda801a8 Change the management of cached pages (PQ_CACHE) in two fundamental
ways:

(1) Cached pages are no longer kept in the object's resident page
splay tree and memq.  Instead, they are kept in a separate per-object
splay tree of cached pages.  However, access to this new per-object
splay tree is synchronized by the _free_ page queues lock, not to be
confused with the heavily contended page queues lock.  Consequently, a
cached page can be reclaimed by vm_page_alloc(9) without acquiring the
object's lock or the page queues lock.

This solves a problem independently reported by tegge@ and Isilon.
Specifically, they observed the page daemon consuming a great deal of
CPU time because of pages bouncing back and forth between the cache
queue (PQ_CACHE) and the inactive queue (PQ_INACTIVE).  The source of
this problem turned out to be a deadlock avoidance strategy employed
when selecting a cached page to reclaim in vm_page_select_cache().
However, the root cause was really that reclaiming a cached page
required the acquisition of an object lock while the page queues lock
was already held.  Thus, this change addresses the problem at its
root, by eliminating the need to acquire the object's lock.

Moreover, keeping cached pages in the object's primary splay tree and
memq was, in effect, optimizing for the uncommon case.  Cached pages
are reclaimed far, far more often than they are reactivated.  Instead,
this change makes reclamation cheaper, especially in terms of
synchronization overhead, and reactivation more expensive, because
reactivated pages will have to be reentered into the object's primary
splay tree and memq.

(2) Cached pages are now stored alongside free pages in the physical
memory allocator's buddy queues, increasing the likelihood that large
allocations of contiguous physical memory (i.e., superpages) will
succeed.

Finally, as a result of this change long-standing restrictions on when
and where a cached page can be reclaimed and returned by
vm_page_alloc(9) are eliminated.  Specifically, calls to
vm_page_alloc(9) specifying VM_ALLOC_INTERRUPT can now reclaim and
return a formerly cached page.  Consequently, a call to malloc(9)
specifying M_NOWAIT is less likely to fail.

Discussed with: many over the course of the summer, including jeff@,
   Justin Husted @ Isilon, peter@, tegge@
Tested by: an earlier version by kris@
Approved by: re (kensmith)
2007-09-25 06:25:06 +00:00
Olivier Houchard
afecb69ae1 Make sure we do not call _arm_bzero() or _arm_memcpy() if the size is not at
least the minimum asked by the driver.

Approved by:	re (blanket)
2007-09-22 22:47:48 +00:00
Olivier Houchard
4c865ababe Add various macros for the ADMA unit.
Approved by:	re (blanket)
2007-09-22 22:25:24 +00:00
Olivier Houchard
16dcd342a9 Add a driver for the 7seg found on the CRB board, largely based on the
IQ31244 version.

Approved by:	re (blanket)
2007-09-22 16:25:43 +00:00
Olivier Houchard
75f66155bf Twist the RAS logic a bit to avoid branching.
MFC After:	1 week
Approved by:	re (blanket)
2007-09-22 14:23:52 +00:00
Olivier Houchard
ea8979747e Remove dead code.
Approved by:	re (blanket)
Beer from:	jadawin
2007-09-19 15:30:25 +00:00
Warner Losh
94ab036295 Kill bogus printf debugs.
Approved by: re@ (blanket)
2007-09-16 07:51:02 +00:00
Warner Losh
f672b4aee5 Kill overly verbose messages about setting bus width.
Approved by: re@ (blanket)
2007-09-16 07:48:58 +00:00
Alan Cox
6bce07ae73 It has been observed on the mailing lists that the different categories
of pages don't sum to anywhere near the total number of pages on amd64.
This is for the most part because uma_small_alloc() pages have never been
counted as wired pages, like their kmem_malloc() brethren.  They should
be.  This changes fixes that.

It is no longer necessary for the page queues lock to be held to free
pages allocated by uma_small_alloc().  I removed the acquisition and
release of the page queues lock from uma_small_free() on amd64 and ia64
weeks ago.  This patch updates the other architectures that have
uma_small_alloc() and uma_small_free().

Approved by: re (kensmith)
2007-09-15 18:47:02 +00:00
Olivier Houchard
6037400b5a It's probably time I learn C.
Fix a few while (!uart_getreg() & SR1_TNF) when
while (!(uart_getreg() & SR18TNF)) was really meant.
This driver should die anyway, it's awful, and uart_ns8250 should be fine
for the StrongArm 1110. I'll kill it later.

Submitted by:	Mikhael Skvorts
Approved by:	re (blanket)
2007-09-12 18:28:09 +00:00
Olivier Houchard
4168e66b1f In __bswap16_var(), make sure the 16 upper bits are cleared; while
optimizing, gcc4 doesn't always do so.

Reported by:	Nathan Whitehorn
Approved by:	re (blanket)
2007-09-09 11:58:38 +00:00
Olivier Houchard
33321c8166 There's no need to re-read PCIR_COMMAND once we set it.
Approved by:	re (blanket)
2007-09-04 18:45:27 +00:00
Olivier Houchard
d3973c98d5 Just wbinv if both PREREAD and PREWRITE are set.
In PREREAD, just invalidate the cache lines, and do not write back them, if
the buffer is properly aligned.

Approved by:	re (blanket)
2007-08-18 16:47:28 +00:00
Olivier Houchard
4739da977b Ooops, we need to define TD_LOCK here.
Approved by:	re (blanket)
Pointy hat to:	cognet
2007-08-08 09:27:52 +00:00
Olivier Houchard
f7b55b6053 Add cast to silent gcc warnings.
Approved by:	re (blanket)
2007-08-07 18:37:21 +00:00
Olivier Houchard
362a46e4f6 Use the third argument of cpu_switch(), as done for i386/amd63, as it is
required for ULE.

Approved by:	re (blanket)
2007-08-07 18:20:55 +00:00
Warner Losh
e8b7ad8c05 Add in all the USB devices and all the wireless goo. The KB9202 has
only USB 1.1 speeds available, but this shouldn't hurt.  Now that we have
working usb support for this board, this is a natural followup.

Approved by: re (kensmith)
2007-07-31 17:45:54 +00:00
Warner Losh
3f0fd37320 Make USB work on the KB9202{,A,B} boards. This has been in p4 for about
7 months.  You must have JP6 in the 1-2 position to supply power to the
USB devices, but I've used uftdi, uplcom and umass successfully.  If you
have it in 2-3, then nothing will show up.  Also, if you have the FQPA
packaging for the AT91RM9200 (like the KN9202 boards have), you will get
the following message

uhub0: device problem (IOERROR), disabling port 2

due to a hardware erratum.  It is safe to ignore as it is about pins that
aren't brought out on the FQPA package and aren't proeprly terminated either.
Alas, there's no register to read to tell the FQPA from the BGA versions.

Submitted by: Daan Vreeken
Approved by: re (kensmith)
2007-07-31 17:43:18 +00:00
Olivier Houchard
6308183c5d MFppc:
revision 1.66
date: 2007/07/31 06:23:26;  author: marcel;  state: Exp;  lines: +2 -2
Fix backward compatibility of the "old" (i.e. FreeBSD6) lseek
syscall. It was broken when a new lseek syscall was introduced.
The problem is that we need to swap the 32-bit td_retval values
for the __syscall indirect syscall when the actual syscall has
a 32-bit return value. Hence, we need to exclude lseek(2). And
this means the "old" lseek(2) as well -- which we didn't.

Based on a patch from: grehan@

Approved by:	re (blanket)
2007-07-31 17:09:05 +00:00
Olivier Houchard
122e1e5e24 CRB config file.
Approved by:	re (blanket)
2007-07-27 14:57:03 +00:00
Olivier Houchard
5f78cb4a35 XScale core 3 definitions.
Approved by:	re (blanket)
2007-07-27 14:54:27 +00:00
Olivier Houchard
0566a63ff3 Cleanup
Approved by:	re (blanket)
2007-07-27 14:53:42 +00:00
Olivier Houchard
55f9380c2c Do not define NIRQ, it is already defined in include/intr.h
Approved by:	re (blanket)
2007-07-27 14:53:06 +00:00
Olivier Houchard
b93e48d2f9 Share the timer and watchdog drivers with the i81342. It's the same,
except it uses different registers.

Approved by:	re (blanket)
2007-07-27 14:52:04 +00:00
Olivier Houchard
e26a6af3af Add initial IOP342 support.
Thanks to Intel for providing sample hardware.

Approved by:	re (blanket)
2007-07-27 14:50:57 +00:00
Olivier Houchard
62e70f1b69 Say if the L2 cache is enabled or disabled as well.
Approved by:	re (blanket)
2007-07-27 14:49:11 +00:00
Olivier Houchard
72d383c331 Handle supersections and L2 cache.
Approved by:	re (blanket)
2007-07-27 14:46:43 +00:00
Olivier Houchard
fcd373ffb8 Use supersection instead of standard sections to map the whole memory
when available.

Approved by:	re (blanket)
2007-07-27 14:46:15 +00:00
Olivier Houchard
e905513c06 Fix the cache mode description.
Approved by:	re (blanket)
2007-07-27 14:45:33 +00:00
Olivier Houchard
b4db6fd942 Properly handle supersections.
Make sure we cache entries in the L2 cache.

Approved by:	re (blanket)
2007-07-27 14:45:04 +00:00
Olivier Houchard
23f9626539 Bring in two bandaids to get the elf trampoline to work again, until I find
a proper solution.
- Add a dummy entry point which just calls the C entry points, and try to make
sure it's the first code in the binary.
- Copy a bit more than func_end to try to copy the whole load_kernel()
function. gcc4 puts code behind the func_end symbol.

Approved by:	re (blanket)
2007-07-27 14:42:25 +00:00
Olivier Houchard
425b5be335 Add a new set of functions to handle L2 cache. Make them no-op for every
CPU except Xscale core 3.

Approved by:	re (blanket)
2007-07-27 14:39:41 +00:00
Olivier Houchard
03631d9998 Import xscale core 3 cache management functions.
Approved by:	re (blanket)
2007-07-27 14:28:15 +00:00
Olivier Houchard
43a2baaf1c INTR_FILTER bits for arm
Approved by:	re (blanket)
2007-07-27 14:26:42 +00:00
Olivier Houchard
d076bcf203 The iop34x has 128 interrupts. 2007-06-16 15:03:33 +00:00
Olivier Houchard
10d8c18005 Introduce pmap_kenter_supersection(), which maps 16MB super-sections into
the kernel pmap.
Document a bit more the behavior of the xscale core 3.
2007-06-11 21:29:26 +00:00
Warner Losh
a27980ccad Fix a spacing nit. 2007-06-11 19:36:37 +00:00
Olivier Houchard
9f547eadb7 Initialize the dma tag's bounce_zone to NULL if we didn't allocate it. 2007-06-10 12:33:01 +00:00
Marcel Moolenaar
01bd17cc99 Add kdb_cpu_sync_icache(), intended to synchronize instruction
caches with data caches after writing to memory. This typically
is required to make breakpoints work on ia64 and powerpc. For
those architectures the function is implemented.
2007-06-09 21:55:17 +00:00
Olivier Houchard
d3cdd95ce0 There's no nobounce_dmamap on arm. 2007-06-07 21:51:09 +00:00
Jeff Roberson
4736604759 - PCPU_ADD is no longer spelled with LAZY_ in the middle.
Submitted by:	attilio
2007-06-06 23:23:47 +00:00
Jeff Roberson
1b1618fb12 - Change comments and asserts to reflect the removal of the global
scheduler lock.

Tested by:      kris, current@
Tested on:      i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc.
Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
2007-06-04 23:57:32 +00:00
Attilio Rao
6759608248 Rework the PCPU_* (MD) interface:
- Rename PCPU_LAZY_INC into PCPU_INC
- Add the PCPU_ADD interface which just does an add on the pcpu member
  given a specific value.

Note that for most architectures PCPU_INC and PCPU_ADD are not safe.
This is a point that needs some discussions/work in the next days.

Reviewed by: alc, bde
Approved by: jeff (mentor)
2007-06-04 21:38:48 +00:00
Marcel Moolenaar
e59febd747 Revert to the previous version where the return value of uart_getenv()
is being ignored. It's optional and the lack of environment variable
is not an error condition.
2007-06-04 17:53:42 +00:00
Alan Cox
9211deca08 Add the machine-specific definitions for configuring the new physical
memory allocator.

Approved by:	re
2007-06-04 08:02:22 +00:00
Attilio Rao
2feb50bf7d Revert VMCNT_* operations introduction.
Probabilly, a general approach is not the better solution here, so we should
solve the sched_lock protection problems separately.

Requested by: alc
Approved by: jeff (mentor)
2007-05-31 22:52:15 +00:00
Paolo Pisati
3401f2c1df In some particular cases (like in pccard and pccbb), the real device
handler is wrapped in a couple of functions - a filter wrapper and an
ithread wrapper. In this case (and just in this case), the filter
wrapper could ask the system to schedule the ithread and mask the
interrupt source if the wrapped handler is composed of just an ithread
handler: modify the "old" interrupt code to make it support
this situation, while the "new" interrupt code is already ok.

Discussed with: jhb
2007-05-31 19:25:35 +00:00
John Hay
aeefab2b98 Remove the hardcoded IXP425_UART?_VBASE values in the
uart_ixp425_probe() and uart_cpu_getdev(). Change
uart_cpu_getdev() to use hints to find the console.

Reviewed by:	marcel
2007-05-29 18:10:42 +00:00
Pyun YongHyeon
590f73f72e Honor maxsegsz of less than a page size in a DMA tag. Previously it
used to return PAGE_SIZE without respect to restrictions of a DMA tag.
This affected all of the busdma load functions that use
_bus_dmamap_loader_buffer() as their back-end.

Reviewed by:	scottl
2007-05-29 06:30:26 +00:00
Alan Cox
66ab556097 Eliminate some unused definitions that came from NetBSD. 2007-05-28 21:04:22 +00:00
John Hay
728c8470f1 We do not need to get the irq out of ivars in ixp425_setup_intr(). By
this time they have already been set. In fact trying to set it here too
breaks irqs for pci devices.
2007-05-28 18:54:08 +00:00
John Hay
e6c51bdace Optimize a bit more, both the Avila and Pronghorn Metro boards work with
GPIO_TYPE_EDG_RISING.

Reviewed by:	sam
2007-05-28 18:45:16 +00:00
Sam Leffler
56b5a9c2a7 Search for a proper ucode image to use by incrementing the minor
release number up to the max.  This should eliminate the need to
tweak the default imageid define for later releases that are found
on the Intel web site.

MFC after:	1 month
2007-05-24 16:31:22 +00:00
Sam Leffler
c1fd78f884 o add hints for avila boards; brings back i2c devices lost when iicbus
started using hints instead of wired down device enumeration
o add usb commented out; will enable when support works

MFC after:	1 month
2007-05-24 16:27:48 +00:00
Sam Leffler
640edef54d Move to hints for configuring numerous devices so we can eliminate various
quirky code: uarts, led, cf/ide, ixpqmgr, npe are now specified with hints.

May want to put some of these devices back in the code and just use hints
to override/specify configuration.

MFC after:	1 month
2007-05-24 16:25:49 +00:00
Sam Leffler
dbbeaafca4 Don't muck with the internal state of a uart during probe, all we
should setup is the class.  This corrects an issue where enabling
uart1 on the avila board caused uart0 to stop working during boot
(no msgs generated by rc scripts were displayed).

Reviewed by:	imp
MFC after:	3 weeks
2007-05-24 16:17:51 +00:00
Sam Leffler
9fcef51546 Fix interrupt setup; rev 1.3 switched the irq to GPIO_TYPE_ACT_LOW
but this does not work on avila boards; special case them to use
GPIO_TYPE_EDG_RISING.

MFC after:	3 weeks
Submitted by:	jhay
2007-05-24 16:15:20 +00:00
Olivier Houchard
9d480d9ede Remove duplicate includes.
Submitted by:   Cyril Nguyen Huu <cyril ci0 org>
2007-05-23 13:21:57 +00:00
Alexander Kabaev
23a29e45cd Allow FreeBSD's native ELF image activators to execute shared libraries the
same way it was enabled for Linux binares in linuxulator.

This allows binaries built with -pie. Many ports auto-detect -fPIE support
in GCC 4.2 and build binaries FreeBSD was unable to run.
2007-05-22 02:22:58 +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
3de2f9db98 Constify to please gcc 4.2. 2007-05-19 13:32:58 +00:00
Olivier Houchard
10c33eae44 Do not try to inline pmap_kremove(), as it's exported. 2007-05-19 13:21:41 +00:00
Olivier Houchard
a994b16d7d Do not try to inline bus_dmamap_sync_buf(), gcc 4.2 doesn't want to do so
because it uses alloca().
Initialize lastaddr in bus_dmamap_load_uio().
2007-05-19 13:17:31 +00:00
Olivier Houchard
fe85f6cee8 Switch the kernel's pmap domain from 15 to 0.
This should be a no-op, and this is needed for xscale core 3 supersections
support, as they are always part of the domain 0
2007-05-19 12:47:34 +00:00
Jeff Roberson
222d01951f - define and use VMCNT_{GET,SET,ADD,SUB,PTR} macros for manipulating
vmcnts.  This can be used to abstract away pcpu details but also changes
   to use atomics for all counters now.  This means sched lock is no longer
   responsible for protecting counts in the switch routines.

Contributed by:		Attilio Rao <attilio@FreeBSD.org>
2007-05-18 07:10:50 +00:00
Alan Cox
04a18977c8 Define every architecture as either VM_PHYSSEG_DENSE or
VM_PHYSSEG_SPARSE depending on whether the physical address space is
densely or sparsely populated with memory.  The effect of this
definition is to determine which of two implementations of
vm_page_array and PHYS_TO_VM_PAGE() is used.  The legacy
implementation is obtained by defining VM_PHYSSEG_DENSE, and a new
implementation that trades off time for space is obtained by defining
VM_PHYSSEG_SPARSE.  For now, all architectures except for ia64 and
sparc64 define VM_PHYSSEG_DENSE.  Defining VM_PHYSSEG_SPARSE on ia64
allows the entirety of my Itanium 2's memory to be used.  Previously,
only the first 1 GB could be used.  Defining VM_PHYSSEG_SPARSE on
sparc64 allows USIIIi-based systems to boot without crashing.

This change is a combination of Nathan Whitehorn's patch and my own
work in perforce.

Discussed with: kmacy, marius, Nathan Whitehorn
PR:		112194
2007-05-05 19:50:28 +00:00
Kevin Lo
3eeb00692a Remove sa1_cache_clean_addr. It isn't needed. 2007-05-03 09:51:12 +00:00
Marcel Moolenaar
f8100ce2a7 Don't expose the uart_ops structure directly, but instead have
it obtained through the uart_class structure. This allows us
to declare the uart_class structure as weak and as such allows
us to reference it even when it's not compiled-in.
It also allows is to get the uart_ops structure by name, which
makes it possible to implement the dt tag handling in uart_getenv().
The side-effect of all this is that we're using the uart_class
structure more consistently which means that we now also have
access to the size of the bus space block needed by the hardware
when we map the bus space, eliminating any hardcoding.
2007-04-02 22:00:22 +00:00
Nick Hibma
f29fa1dfa4 Revisit the watchdogs: Resetting the error to EINVAL after failing to set the
watchdog might hide the succesful arming of an earlier one. Accept that on
failing to arm any watchdog (because of non-supported timeouts) EOPNOTSUPP is
returned instead of the more appropriate EINVAL.

MFC after:	3 days
2007-03-27 21:03:37 +00:00
Kevin Lo
45c4f0cbc3 Don't map mini-data cache page since ARM920T doesn't have it. 2007-03-27 06:29:19 +00:00
Warner Losh
657c256c31 Default to booting off the SD card. It is more useful, and a full
FreeBSD/arm installworld install is only 170MB.  The smallest SD card
I could find at the store today was 512MB (and it was only $10 after
rebate), with a 2GB card for as low as $25.00...

Now that the IIC stuff has been sorted out, include that as well.
Include hints for the icee 16kb 16-bit i2c device.  It should include
info about the temperature sensor as well, but that driver isn't quite
ready.

Add bpf for dhclient happiness.

MFC After: 1 week
2007-03-23 23:47:59 +00:00
Warner Losh
bac394d579 MFp4: A bunch of patches from myself and Tisco to improve the
robustness of IIC transactions when parts aren't present.  This also
removes a bunch of debug.  This also moves this driver to 7-1
addressing rather than 6-0 addressing, which is more inline with all
the other iic drivers in the tree.  I've tested this for about a
million years on the systems at work.
2007-03-23 22:57:24 +00:00
Kevin Lo
75f30232c5 Fix a comment 2007-03-21 07:49:56 +00:00
Kevin Lo
4eaa43e6f4 Remove __P 2007-03-21 03:28:16 +00:00
John Hay
142f4ed4b1 Map the second CS of the compact flash too. This allow us access to
the alternate status and the control registers. Remove the local
version of ata_reset.

Add support for the ADI Pronghorn Metro boards. They use CS3 and CS4
instead of Avila's CS1 and CS2.
2007-03-14 19:03:07 +00:00
John Hay
b4078e515f Map the second CS of the compact flash too. This allow us access to
the alternate status and the control registers. Remove the local
version of ata_reset.

Add support for the ADI Pronghorn Metro boards. They use CS3 and CS4
instead of Avila's CS1 and CS2.

OKed by: sam, cognet
2007-03-14 18:05:04 +00:00
Alan Cox
c640357f04 Push down the implementation of PCPU_LAZY_INC() into the machine-dependent
header file.  Reimplement PCPU_LAZY_INC() on amd64 and i386 making it
atomic with respect to interrupts.

Reviewed by: bde, jhb
2007-03-11 05:54:29 +00:00
Paolo Pisati
15eab674d8 Wrap ixppcib_setup_intr() at 80. 2007-03-06 10:58:22 +00:00
Paolo Pisati
9ca5d390d4 Wrap a BUS_SETUP_INTR() line at 80. 2007-03-06 10:56:54 +00:00
Paolo Pisati
856e1ae84c o substitute INTR_FAST with FILTER in a panic message.
o wrap a BUS_SETUP_INTR() line at 80.
2007-03-06 10:55:57 +00:00
Kevin Lo
4cd84059be Reverse this change. malloc() with M_WAITOK never fails.
Noted by: cognet, brian and thompsa
2007-03-06 01:15:28 +00:00
Kevin Lo
2f0275579d Check for malloc return value 2007-03-05 06:33:08 +00:00
Paolo Pisati
b07b4f1229 Update bus_setup_intr().
Pointed by: Krassimir Slavchev
2007-03-01 09:10:55 +00:00
John Baldwin
552e9b06bb Use tsleep() rather than msleep() with a NULL mtx. 2007-02-27 17:15:39 +00:00
Paolo Pisati
2e35649225 Correct return code (int) for at91_rtc_intr() prototype.
Approved by: cognet
2007-02-27 13:39:34 +00:00
Kevin Lo
82003b276a Remove unused header file <machine/katelib.h> 2007-02-26 05:17:47 +00:00
Olivier Houchard
0dcd646d88 Define FLASHADDR and LOADERRAMADDR for the Avila, so that we can boot a
kernel from the onboard flash.
2007-02-26 02:04:24 +00:00
Olivier Houchard
f96b290333 Erm we can't change the value of arm_memcpy if we're running from flash.
Instead, make memcpy() check if we're running from flash, and avoid
using arm_memcpy if we're doing so.
2007-02-26 02:03:48 +00:00
Olivier Houchard
902222e77c Update for the new prototype of bus_setup_intr(). 2007-02-25 22:17:54 +00:00
Paolo Pisati
23b5f6dc07 Fix attach of at91_pio() after bus_setup_intr() modification.
Reported and tested by: Krassimir Slavchev
2007-02-25 14:34:59 +00:00
Paolo Pisati
ef544f6312 o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@
2007-02-23 12:19:07 +00:00
Olivier Houchard
f59ae8e84a Add two new options, FLASHADDR, which defines the address the flash is
mapped at, and LOADERRAMADDR, the address at which the loader maps the ram at
at the time the kernel is booted.
They are used to detect if the kernel is booted from the onboard flash.
Define those for the IQ31244
2007-02-19 01:03:08 +00:00
Olivier Houchard
db599c2f20 Teach the kernel and the ELF trampoline how to boot from onboard flash. 2007-02-19 00:57:27 +00:00
Olivier Houchard
0d9fc1e6e1 There's no such thing as a GENERIC kernel on arm.
Spotted out by:	csjp
MFC After:	3 days
2007-02-19 00:37:25 +00:00
Luigi Rizzo
33d5497079 Cleanup and document the implementation of firmware(9) based on
a version that i posted earlier on the -current mailing list,
and subsequent feedback received.

The core of the change is just in sys/firmware.h and kern/subr_firmware.c,
while other files are just adaptation of the clients to the ABI change
(const-ification of some parameters and hiding of internal info,
so this is fully compatible at the binary level).

In detail:
- reduce the amount of information exported to clients in struct firmware,
  and constify the pointer;

- internally, document and simplify the implementation of the various
  functions, and make sure error conditions are dealt with properly.

The diffs are large, but the code is really straightforward now (i hope).

Note also that there is a subtle issue with the implementation of
firmware_register(): currently, as in the previous version, we just
store a reference to the 'imagename' argument, but we should rather
copy it because there is no guarantee that this is a static string.
I realised this while testing this code, but i prefer to fix it in
a later commit -- there is no regression with respect to the past.

Note, too, that the version in RELENG_6 has various bugs including
missing locks around the module release calls, mishandling of modules
loaded by /boot/loader, and so on, so an MFC is absolutely necessary
there.  I was just postponing it until this cleanup to avoid doing
things twice.

MFC after: 1 week
2007-02-15 17:21:31 +00:00
Kevin Lo
65a92876a4 Add KTR tracing 2007-02-14 04:41:28 +00:00
Kevin Lo
9c21f7691e style(9) cleanup. 2007-02-14 01:25:41 +00:00
Kevin Lo
a894419d37 In sendsig:
- Add sigacts locking.
- Add a mutex to struct sigacts that protects all the members of the struct.
- Create and log events via the CTRx macros.

Reviewed by: cognet
2007-02-14 01:08:42 +00:00
Olivier Houchard
4cc9ecf6cb Make sure the address is valid before mapping it.
MFC after:	1 week
2007-02-13 15:35:57 +00:00
Kevin Lo
3d9e8ab862 Fix typo: MacPPC -> ARM 2007-02-13 07:19:26 +00:00
Olivier Houchard
7d24f6f049 Use uma_set_align(). 2007-02-11 22:24:54 +00:00
Max Laier
a1529123d9 Fix small altq related copy and paste error. 2007-02-10 15:43:58 +00:00
Warner Losh
984a9ada81 Add sanity check to make sure that the MAC address isn't all 0's. Bad
boot loaders can do this, and this leads to all kinds of ill effects
downstream.  Also, minor formatting nits.
2007-02-08 21:42:10 +00:00
Marcel Moolenaar
1d3aed33e8 Evolve the ctlreq interface added to geom_gpt into a generic
partitioning class that supports multiple schemes. Current
schemes supported are APM (Apple Partition Map) and GPT.
Change all GEOM_APPLE anf GEOM_GPT options into GEOM_PART_APM
and GEOM_PART_GPT (resp).

The ctlreq interface supports verbs to create and destroy
partitioning schemes on a disk; to add, delete and modify
partitions; and to commit or undo changes made.
2007-02-07 18:55:31 +00:00
Warner Losh
21389c94d9 at91_twi depends on the iicbus module to satisfy its symbols when
loaded, so make that explicit.  Works for the monolithic kernel case,
won't work for the kldload case.
2007-02-06 12:07:14 +00:00
Kevin Lo
e4d87be479 <sys/sx.h> is unneeded. 2007-02-05 10:33:39 +00:00
Kevin Lo
1f35d9bfbd ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again.
Approved by: imp, cognet
2007-02-03 07:46:26 +00:00
Kevin Lo
8c605560c4 Remove a bogus i = 0
Approved by: cognet
2007-02-02 05:14:21 +00:00
Kevin Lo
25777ce331 Use our own timer that piggybacks on npe_tick() callout instead of
if_watchdog/if_timer interface.

Approved by: sam, cognet
2007-01-30 01:18:29 +00:00
Kevin Lo
27864bcad8 Fix comments.
Approved by: cognet
2007-01-26 01:37:32 +00:00
Marius Strobl
97202af2dc - Add a uart_rxready() and corresponding device-specific implementations
that can be used to check whether receive data is ready, i.e. whether
  the subsequent call of uart_poll() should return a char, and unlike
  uart_poll() doesn't actually receive data.
- Remove the device-specific implementations of uart_poll() and implement
  uart_poll() in terms of uart_getc() and the newly added uart_rxready()
  in order to minimize code duplication.
- In sunkbd(4) take advantage of uart_rxready() and use it to implement
  the polled mode part of sunkbd_check() so we don't need to buffer a
  potentially read char in the softc.
- Fix some mis-indentation in sunkbd_read_char().

Discussed with:	marcel
2007-01-18 22:01:19 +00:00
Olivier Houchard
ebfaa05056 Create bus dma tags for both the PCI bus and the IXP425 root bus. Set the
PCI bus' one as the default one, and explicitely use the other one for
non-PCI devices.
This is needed because the PCI bus can only address 64MB of RAM, while some
IXP425 boards have 128MB or more, and most of the PCI drivers do not bother
providing the parent dma tag.
2007-01-17 00:58:25 +00:00
Olivier Houchard
47010239a8 - Add bounce pages for arm, largely based on the i386 implementation.
- Add a default parent dma tag, similar to what has been done for sparc64.
- Before invalidating the dcache in POSTREAD, save the bits which are in the
same cachelines than our buffers, but not part of it, and restore them after
the invalidation.
2007-01-17 00:53:05 +00:00
Bernd Walter
03d0aa10bc Hints are handled differently on -current
Don't include hints.at91rm9200 for now
2007-01-05 10:30:51 +00:00
Bernd Walter
dde6da66c5 MFp4: Use the next possible value for hz instead of defaulting to 128
Update tick value after modifying hz.
2007-01-05 02:52:06 +00:00
Bernd Walter
69b40f4db3 MFp4: Add missing atomic functions
Based on a patch by: des
2007-01-05 02:50:27 +00:00
Bernd Walter
ecfa9e8ded MFp4: add BWCT kernel configuration 2007-01-05 02:08:35 +00:00
Bernd Walter
2e54a4ac40 MFp4: Make at91_rtc optional to allow other RTC choices 2007-01-05 02:06:53 +00:00
Bernd Walter
05a3e0db5c MFp4: Read access require PDC to be setup first otherwise we might get
overrun errors.
	Write access however need cmd first, so keep the existing order
	for them.
2007-01-05 01:18:32 +00:00
Bernd Walter
f291c40a40 MFp4: BWCT boards are using an 16MHz xtal 2007-01-05 01:14:14 +00:00
Bernd Walter
bd55b92b0e MFp4: Add VLAN_MTU support 2007-01-05 01:07:59 +00:00
Bernd Walter
3bb40db608 MFp4: fix a race in transmit buffer handling 2007-01-05 01:01:14 +00:00
Warner Losh
e79c6a301d MFp4: Fix bit name for SPI SR register 2007-01-01 00:50:25 +00:00
Warner Losh
5434a91804 MFp4: Remove watchdog timeout that appears to be unused. 2007-01-01 00:48:25 +00:00
Warner Losh
c36172be39 Merge from FreeBSD-tsf-6 by way of p4:
correct values for PIO registers

	submitted by: patrick schweiger
2007-01-01 00:46:54 +00:00
Nick Hibma
9079fff550 Align the interfaces for the various watchdogs and make the interface
behave as expected.

Also:
- Return an error if WD_PASSIVE is passed in to the ioctl as only
  WD_ACTIVE is implemented at the moment. See sys/watchdog.h for an
  explanation of the difference between WD_ACTIVE and WD_PASSIVE.
- Remove the I_HAVE_TOTALLY_LOST_MY_SENSE_OF_HUMOR define. If you've
  lost your sense of humor, than don't add a define.

Specific changes:

i80321_wdog.c
  Don't roll your own passive watchdog tickle as this would defeat the
  purpose of an active (userland) watchdog tickle.

ichwd.c / ipmi.c:
  WD_ACTIVE means active patting of the watchdog by a userland process,
  not whether the watchdog is active. See sys/watchdog.h.

kern_clock.c:
  (software watchdog) Remove a check for WD_ACTIVE as this does not make
  sense here. This reverts r1.181.
2006-12-15 21:44:49 +00:00
Sam Leffler
81319550dd Handle a missing NPE firmware file better; if it's missing print a
(somewhat) meaningful message and terminate the build.  It'd be
nice to print a proper URL from which to fetch the file but that
seems problematic.  Leave a suggested starting point in this file
(TBD: add it to the man page).

Submitted by:	ru
2006-12-07 00:49:33 +00:00
Olivier Houchard
ae89920ab9 Unbreak build for Skyeye: do not attempt to do any DMA, as Skyeye doesn't
emulate it.

Reported by:	ru
2006-12-07 00:24:15 +00:00
Julian Elischer
ad1e7d285a Threading cleanup.. part 2 of several.
Make part of John Birrell's KSE patch permanent..
Specifically, remove:
Any reference of the ksegrp structure. This feature was
never fully utilised and made things overly complicated.
All code in the scheduler that tried to make threaded programs
fair to unthreaded programs.  Libpthread processes will already
do this to some extent and libthr processes already disable it.

Also:
Since this makes such a big change to the scheduler(s), take the opportunity
to rename some structures and elements that had to be moved anyhow.
This makes the code a lot more readable.

The ULE scheduler compiles again but I have no idea if it works.

The 4bsd scheduler still reqires a little cleaning and some functions that now do
ALMOST nothing will go away, but I thought I'd do that as a separate commit.

Tested by David Xu, and Dan Eischen using libthr and libpthread.
2006-12-06 06:34:57 +00:00
Olivier Houchard
8cd2513ee1 Do not forget to call pmap_free_l2_bucket() in pmap_remove_pages().
This can fix the pmap-related panics reported on arm.

MFC After:	3 days
2006-12-04 12:55:00 +00:00
Olivier Houchard
7f7ba6ec05 Provide stream operations. 2006-12-02 13:37:29 +00:00
Olivier Houchard
5b3e7496e6 We can have no PV entry here if the previous mapping was unmanaged, and the new
one is unmanaged too, so update the KASSERT to reflect this.
2006-12-01 12:29:55 +00:00
Olivier Houchard
92c930f4ec In pmap_ts_referenced(), don't attempt to do anything if the page is
fictitious, and just return 0.
2006-11-30 23:35:34 +00:00
Olivier Houchard
73dcd92598 First bits of Xscale core 3 support (the VM bits are far from being optimal
yet).
2006-11-30 23:34:07 +00:00
Olivier Houchard
2feb83cec2 Introduce CPU_XSCALE_CORE3, as XScale Core 3 is significally different than
regular Xscale (it has no mini data cache, has armv6-style 16MB
supersections, and can address 36bits).
Define it for i81342.
2006-11-30 23:30:40 +00:00
Kevin Lo
561d953686 Better i2c bit definitions.
Approved by: cognet
2006-11-30 06:30:01 +00:00
John Birrell
e0b651251d Turn console printf buffering into a kernel option and only on
by default for sun4v where it is absolutely required.

This change moves the buffer from struct pcpu to the stack to avoid
using the critical section which created a LOR in a couple of cases
due to interaction with the tty code and kqueue. The LOR can't be
fixed with the critical section and the pcpu buffer can't be used
without the critical section.

Putting the buffer on the stack was my initial solution, but it was
pointed out that the stress on the stack might cause problems
depending on the call path. We don't have a way of creating tests
for those possible cases, so it's best to leave this as an option
for the time being. In time we may get enough data to enable this
option more generally.
2006-11-30 04:17:05 +00:00
Warner Losh
435620f10d MFp4:
formatting nit
2006-11-29 08:17:40 +00:00
Warner Losh
e8c8e11c08 Make this work a lot better:
Remove a lot of older cruft not needed.
	Improve ISR support, but it is still unused since polling is faster
	Properly initalize the speed register to get 90kb/s, not 400b/s.
	Try to catch NACK
	Allow 0 length read transfers to generate start/top pairs.
2006-11-29 08:15:59 +00:00
Warner Losh
ab45d28ce3 MFp4:
correct data counts so that we clock enough data for the spi
	transaction.  This allows complete spi transactions to happen.
2006-11-29 07:57:02 +00:00
Kevin Lo
f1b6520619 Bring in status led support for /dev/led/gpioled on Avila.
Approved by: cognet
2006-11-22 12:57:17 +00:00
Warner Losh
ff7447dae1 MFp4: Make it work :-)
o Don't delay when checking the done bits.  There's no gain other
	  than a small performance hit.
	o calculate the clock divisors better (things are still way slow,
	  so maybe there's more here?)
	o don't always fail reset.  Always succeed instead.
	o fix inverted logic around at91_twi_wait() return value
	o remove debug code
	o remove unneeded, unworking junk
2006-11-22 06:51:59 +00:00
Kevin Lo
681efe0834 Match bus space unmap prototype.
Approved by: cognet
2006-11-20 13:21:02 +00:00
Warner Losh
111bcda150 MFp4: Tweak descriptions in preparation for porting to other members of
the AT91 arm9 family.
2006-11-20 06:27:15 +00:00
Sam Leffler
d4593bb04f config for Gateworks Avila board booting with NFS-mounted root on npe0
Reviewed by:	cognet, imp
MFC after:	1 month
2006-11-19 23:58:12 +00:00
Sam Leffler
e67f80fd20 Gateworks Avila board support:
o ixp425 support
o NPE network driver (requires Intel microcode)
o h/w qmgr support
o True IDE compact flash over expansion bus
o pci (ath and hifn795x parts tested)
o xscale watchdog timer
o ds1672 RTC on i2c bus
o ad7418 voltage + temp monitoring on i2c bus
o uart

Work done together with cognet, kevlo, and jmg.  Parts of
the ixp425 support obtaine/derived from netbsd.

Reviewed by:	cognet, imp
MFC after:	1 month
2006-11-19 23:55:23 +00:00
Sam Leffler
faad47108d change bus space unmap protoype
Reviewed by:	cognet, imp
MFC After:	1 month
2006-11-19 23:47:51 +00:00
Sam Leffler
588a2322a9 correct bus space unmap prototype
Reviewed by:	cognet, imp
MFC after:	1 month
2006-11-19 23:46:50 +00:00
Sam Leffler
7fb399a7e5 elaborate on stepping names; add intel terminology to help
people cross-referencing intel docs

Reviewed by:	imp, cognet
MFC after:	1 month
2006-11-19 23:45:33 +00:00
Olivier Houchard
1ea7de37f9 Erm we really want to mask all interrupts in the range, just not the first
one.

Submitted by:	ru
2006-11-17 11:56:56 +00:00
Kevin Lo
f43f0196a9 Compile -- remove an unused global variable avail_end.
Approved by: cognet
2006-11-17 00:53:39 +00:00
Ruslan Ermilov
26af9ac7d0 Fix a comment. 2006-11-13 06:26:57 +00:00
Alan Cox
44b8bd66f9 Make pmap_enter() responsible for setting PG_WRITEABLE instead
of its caller.  (As a beneficial side-effect, a high-contention
acquisition of the page queues lock in vm_fault() is eliminated.)
2006-11-12 21:48:34 +00:00
Alan Cox
cc0d48ffb6 Eliminate unused global variables. 2006-11-11 20:57:52 +00:00
Alan Cox
e288d71672 MFamd64/ia64/i386/sun4v
Use cnt.v_page_count, the actual count of available physical pages,
  instead of vm_page_array_size to compute the maximum number of pv
  entries.
2006-11-08 06:31:28 +00:00
Olivier Houchard
c162ce855c Increate cnt.v_intr on interrupt. 2006-11-08 01:32:24 +00:00
Olivier Houchard
676b1fbdbf Identify the xscale 81342. 2006-11-07 22:36:57 +00:00
Olivier Houchard
08b91759f3 In the ARM_USE_SMALL_ALLOC case, vm_page_t may have an address < KERNBASE,
so adjust the KASSERT to reflect this.
2006-11-07 22:35:30 +00:00
Olivier Houchard
2c7b82c9dd Add atomic_cmpset_acq_32. 2006-11-07 11:53:44 +00:00
Warner Losh
8cd5dc08c3 MFp4:
o Fix the packet statistics
	o Make sure we set the FD bit when in full duplex
	o Improve TX side efficency by eliminating a data copy for
	  unfragmented mbufs (the hardware can't do s/g).
	o Minor busdma pedantry
	o better comments in some places, more XXX in others
	o Minor style nits.

This solves a problem I was seeing where I'd get no ethernet when not
booting with a NFS root.  Well, unless I unplugged the cable and
plugged it back in first so I'd get the same up down up messages I get
for NFS root...

Thanks to sam and scottl for suggestions on making this driver more
efficient through better use of approrpiate APIs.
2006-11-03 07:39:37 +00:00
Olivier Houchard
da834c5711 Do not include both <sys/types.h> and <sys/param.h>, it is a style bug as
sys/types.h is included in sys/param.h, so instead just move the
#include <sys/param.h> before the headers that need it.

Spotted out by:	bde
2006-11-01 12:41:43 +00:00
John Birrell
3d068827c2 Add a cnputs() function to write a string to the console with
a lock to prevent interspersed strings written from different CPUs
at the same time.

To avoid putting a buffer on the stack or having to malloc one,
space is incorporated in the per-cpu structure. The buffer
size if 128 bytes; chosen because it's the next power of 2 size
up from 80 characters.

String writes to the console are buffered up the end of the line
or until the buffer fills. Then the buffer is flushed to all
console devices.

Existing low level console output via cnputc() is unaffected by
this change. ithread calls to log() are also unaffected to avoid
blocking those threads.

A minor change to the behaviour in a panic situation is that
console output will still be buffered, but won't be written to
a tty as before. This should prevent interspersed panic output
as a number of CPUs panic before we end up single threaded
running ddb.

Reviewed by:	scottl, jhb
MFC after:	2 weeks
2006-11-01 04:54:51 +00:00
Olivier Houchard
c3248b4002 Include <sys/types.h>, to get definition for uint32_t.
Submitted by:	David Sharp
2006-10-30 23:23:00 +00:00
John Birrell
3750d1ecad Remove the KSE option now that it's in DEFAULTS on these arches/machines.
The 'nooption' kernel config entry has to be used to turn KSE off now.
This isn't my preferred way of dealing with this, but I'll defer to
scottl's experience with the io/mem kernel option change and the grief
experienced over that.

Submitted by:	scottl@
2006-10-26 22:11:35 +00:00
John Birrell
8460a577a4 Make KSE a kernel option, turned on by default in all GENERIC
kernel configs except sun4v (which doesn't process signals properly
with KSE).

Reviewed by:	davidxu@
2006-10-26 21:42:22 +00:00
Olivier Houchard
4e52d86822 Let allow to teardown multiple irqs as well. 2006-10-25 21:11:46 +00:00
Olivier Houchard
0a7b049096 Setup multiple interrupts if needed. 2006-10-25 21:00:08 +00:00
Warner Losh
bc8fe52e6d MFp4: Move the parameters that are basically dictated by the AT91
organization to that file.
2006-10-25 08:00:11 +00:00
Warner Losh
1b104c589a MFp4: Status register bits 2006-10-25 07:58:18 +00:00
Olivier Houchard
d370f1f482 Ooops, dump_avail[i] can be 0 if the RAM starts at 0x00000000, so check that
dump_avail[i + 1] is == 0 as a stop condition instead.
MFC after: 3 days
2006-10-24 23:27:52 +00:00
Kevin Lo
24ef8c83ee style(9) cleanup.
Approved by: cognet
2006-10-21 04:25:00 +00:00
Olivier Houchard
06e28eec94 Ok I am an idiot. On 32 bits big-endian systems, it is needed to handle the
syscalls using __syscall but only actually returning 32bits, such as mmap(),
specially : they set the return value in td->td_retval[0], but the userland
functions will expect this in r1, and not in r0 as it is normally done, as it
is the LSB. So add a special case for all these syscalls (all except lseek,
which truly returns 64bits).

Many thanks to Peter Grehan for his patience while explaining me the issue.
2006-10-21 00:46:56 +00:00