Commit Graph

1841 Commits

Author SHA1 Message Date
kib
63efc821c3 Add pmap function pmap_copy_pages(), which copies the content of the
pages around, taking array of vm_page_t both for source and
destination.  Starting offsets and total transfer size are specified.

The function implements optimal algorithm for copying using the
platform-specific optimizations.  For instance, on the architectures
were the direct map is available, no transient mappings are created,
for i386 the per-cpu ephemeral page frame is used.  The code was
typically borrowed from the pmap_copy_page() for the same
architecture.

Only i386/amd64, powerpc aim and arm/arm-v6 implementations were
tested at the time of commit. High-level code, not committed yet to
the tree, ensures that the use of the function is only allowed after
explicit enablement.

For sparc64, the existing code has known issues and a stab is added
instead, to allow the kernel linking.

Sponsored by:	The FreeBSD Foundation
Tested by:	pho (i386, amd64), scottl (amd64), ian (arm and arm-v6)
MFC after:	2 weeks
2013-03-14 20:18:12 +00:00
glebius
37a43650ed Functions m_getm2() and m_get2() have different order of arguments,
and that can drive someone crazy. While m_get2() is young and not
documented yet, change its order of arguments to match m_getm2().

Sorry for churn, but better now than later.
2013-03-12 13:42:47 +00:00
glebius
8be88fc42e Use m_get2() to get an mbuf of appropriate size.
Reviewed by:	marius
Sponsored by:	Nginx, Inc.
2013-03-12 10:05:36 +00:00
cognet
bc04f839be Don't use an empty struct. 2013-03-11 10:56:46 +00:00
andrew
df298b8642 Fix a typo where db_printf was spelt printf. 2013-03-10 02:44:06 +00:00
andrew
8ddf10d5e6 Update how we read the stack pointer to work on both GCC and clang. 2013-03-10 02:40:50 +00:00
andrew
ca62d86bb1 Tell the unwinder we can't unwind swi_entry. This fixes an infinite loop
when the kernel attempts to unwind through this function.

The .fnstart and .fnend in this function should be moved to macros but we
are currently missing an END macro on ARM.
2013-03-10 02:38:35 +00:00
andrew
5e403de75e __FreeBSD_ARCH_armv6__ is undefined on clang. We can use __ARM_ARCH in
it's place. This makes 'uname -p' correctly output 'armv6' on a kernel
built with clang.
2013-03-09 23:55:23 +00:00
attilio
7fd2627275 MFC 2013-03-09 01:39:42 +00:00
attilio
bf1dc90446 MFC 2013-03-08 00:03:07 +00:00
andrew
1e16d8b6f0 Fix stack alignment in the kernel to be on an 8 byte boundary as required
by AAPCS.
2013-03-06 06:19:56 +00:00
gonzo
161f82b0bd - Reset DMA channel if error occured
- Initialize info field in bcm_dma_reset

Submitted by:	Daisuke Aoyama <aoyama@peach.ne.jp>
2013-03-05 20:00:11 +00:00
cognet
e52f997818 If we're using a PIPT L2 cache, only merge 2 segments if both the virtual
and the physical addreses are contiguous.

Submitted by:	Thomas Skibo <ThomasSkibo@sbcglobal.net>
2013-03-04 10:41:54 +00:00
attilio
e98f58faf6 MFC 2013-03-02 14:48:41 +00:00
andrew
a94abfa9f5 Move some virtual memory constants to the top of the file where they are on
other architectures [1].

While here:
 - Remove an unused and commented out include.
 - Add a comment describing the file that other copies have.
 - Fix the style of the defines and add a comment on what each one is.

Suggested by:	[1] alc
2013-03-02 05:02:29 +00:00
andrew
6a195ffa93 Build the Raspberry Pi dtb file when building the kernel so we can copy it
to the boot partition for U-Boot.
2013-03-02 03:23:14 +00:00
andrew
6bc019724d Ensure the stack is correctly aligned before calling the first C function. 2013-03-02 02:19:04 +00:00
andrew
0542e230f8 Increase the maximum text size on ARM to 64MiB. Without this clang would be
sent a SIGABRT when it is loaded as it is too large. This is the smallest
power of two MiB value that allows us to execute clang.

While here wrap it in an #ifndef to be consistent with the other
architectures.

Submitted by:	Daisuke Aoyama <aoyama at peach.ne.jp>
2013-03-01 21:59:23 +00:00
alc
9eba1eca85 Eliminate a redundant #include: machine/pmap.h is already included
through vm/pmap.h.
2013-03-01 19:02:41 +00:00
alc
9ecef62d73 Copy the definition of VM_MAX_AUTOTUNE_MAXUSERS from i386. (See r242847.)
Tested by:	andrew
2013-03-01 08:30:31 +00:00
ganbold
65c312a935 Enable uart driver for A10.
Approved by: gonzo@
2013-03-01 01:47:11 +00:00
gonzo
3349e30b76 Add platform DMA support to SDHCI driver for BCM2835
Submitted by:	Daisuke Aoyama <aoyama at peach.ne.jp>
Reviewed by:	ian@
2013-02-28 19:51:30 +00:00
gonzo
80b147459e Add driver for BCM2835's DMA engine
This is a version of code submitted by Daisuke Aoyama <aoyama at peach.ne.jp>
with some architectural changes.
2013-02-28 19:48:19 +00:00
mav
6cf7cc6e4d MFcalloutng:
Switch eventtimers(9) from using struct bintime to sbintime_t.
Even before this not a single driver really supported full dynamic range of
struct bintime even in theory, not speaking about practical inexpediency.
This change legitimates the status quo and cleans up the code.
2013-02-28 13:46:03 +00:00
attilio
98a0da7498 Complete r247297:
Remove unused inclusions of vm/vm_pager.h and vm/vnode_pager.h.

Sponsored by:	EMC / Isilon storage division
2013-02-28 00:18:56 +00:00
attilio
9c0acdc691 Revert some introduction of rwlock.h and remove unused
vm/vm_pager.h vm/vnode_pager.h.

Sponsored by:	EMC / Isilon storage division
2013-02-28 00:14:59 +00:00
attilio
52c57fbbdb MFC 2013-02-27 18:17:34 +00:00
gonzo
5f76bacc85 Fix typo 2013-02-27 08:34:32 +00:00
gonzo
b39d0df4c9 - Initialize GPIO_OE register based on pinmux configuration
Although AM335x TRM states that GPIO_OE register is not used and just
reflects pads configuration in practice it does control pin behavior
and shoiuld be set in addition to pinmux setup
2013-02-27 08:32:34 +00:00
attilio
74f58faa15 MFC 2013-02-26 23:52:23 +00:00
attilio
cc89d0bd92 Merge from vmc-playground branch:
Replace the sub-optimal uma_zone_set_obj() primitive with more modern
uma_zone_reserve_kva().  The new primitive reserves before hand
the necessary KVA space to cater the zone allocations and allocates pages
with ALLOC_NOOBJ.  More specifically:
- uma_zone_reserve_kva() does not need an object to cater the backend
  allocator.
- uma_zone_reserve_kva() can cater M_WAITOK requests, in order to
  serve zones which need to do uma_prealloc() too.
- When possible, uma_zone_reserve_kva() uses directly the direct-mapping
  by uma_small_alloc() rather than relying on the KVA / offset
  combination.

The removal of the object attribute allows 2 further changes:
1) _vm_object_allocate() becomes static within vm_object.c
2) VM_OBJECT_LOCK_INIT() is removed.  This function is replaced by
   direct calls to mtx_init() as there is no need to export it anymore
   and the calls aren't either homogeneous anymore: there are now small
   differences between arguments passed to mtx_init().

Sponsored by:	EMC / Isilon storage division
Reviewed by:	alc (which also offered almost all the comments)
Tested by:	pho, jhb, davide
2013-02-26 23:35:27 +00:00
attilio
820ab571ec MFC 2013-02-26 21:09:35 +00:00
cognet
032f2b4696 Export vfp_init() prototype, for use in the MP code. 2013-02-26 20:01:05 +00:00
cognet
f7d7c01cb9 Fix SMP build. 2013-02-26 19:59:52 +00:00
cognet
6376afdd72 Don't forget to init the VFP stuff for all cores. 2013-02-26 19:58:49 +00:00
attilio
afe5ce0c13 MFC 2013-02-26 17:33:18 +00:00
alc
1292edf08d Be more conservative in auto-sizing and capping the kmem submap. In
fact, use the same values here that we use on 32-bit x86 and MIPS.  Some
machines were reported to have problems with the more aggressive values.

Reported and tested by:	andrew
2013-02-26 08:17:34 +00:00
alc
9f434bef50 Eliminate a redundant #include: machine/pmap.h is already included
through vm/pmap.h.
2013-02-26 07:41:34 +00:00
kientzle
96d3918246 RPi users might want to touch the boot partition, which is always FAT
formatted on this board, so compile-in MSDOSFS.

Comment out the compiled-in FDT and explain why.
2013-02-26 04:59:02 +00:00
attilio
756a9b3e47 MFC 2013-02-26 01:05:25 +00:00
attilio
cb47f0509b Merge from vmobj-rwlock branch:
Remove unused inclusion of vm/vm_pager.h and vm/vnode_pager.h.

Sponsored by:	EMC / Isilon storage division
Tested by:	pho
Reviewed by:	alc
2013-02-26 01:00:11 +00:00
gonzo
97adaace52 Fix off-by-one error in sanity checks 2013-02-25 09:33:48 +00:00
gonzo
3d9e2fd8b2 - Fix off-by-one error when returning max pin number
- Fix GPIOGET for output pins. Requesting state for
    output pin is valid operation, get the state from
    TI_GPIO_DATAOUTX register
2013-02-25 08:04:47 +00:00
attilio
2ad8e10333 MFC 2013-02-24 17:20:53 +00:00
gonzo
2ef08f9a2e Add macroses to properly map IO peripherals memory window from
ARM physical memory address space to VideoCore address space
2013-02-23 22:46:26 +00:00
mav
4af4a9dc68 Add basic and not very reliable protection against going to sleep with
thread scheduled by interrupt fired after we entered critical section.
None of cpu_sleep() implementations on ARM check sched_runnable() now, so
put the first line of defence here.  This mostly fixes unexpectedly long
sleeps in synthetic tests of calloutng code and probably other situations.
2013-02-23 18:32:42 +00:00
attilio
905e648d42 Hide the details for the assertion for VM_OBJECT_LOCK operations.
Rename current VM_OBJECT_LOCK_ASSERT(foo, RA_WLOCKED) into
VM_OBJECT_ASSERT_WLOCKED(foo)

Sponsored by:	EMC / Isilon storage division
Requested by:	alc
2013-02-21 21:54:53 +00:00
attilio
81a3802a87 Remove supposedly unused vm_pager.h.
Sponsored by:	EMC / Isilon storage division
2013-02-21 20:42:51 +00:00
attilio
8746bf6a5f MFC 2013-02-21 15:06:19 +00:00
attilio
066bbc97b6 Fix other architectures and ZFS.
Sponsored by:	EMC / Isilon storage division
2013-02-21 15:02:36 +00:00