Merge remote-tracking branch 'origin' into spi/next
Pull in Linus' tree to pick up changes required for the langwell gpio fixes
This commit is contained in:
commit
2dd2299767
@ -328,8 +328,6 @@ sysrq.txt
|
||||
- info on the magic SysRq key.
|
||||
telephony/
|
||||
- directory with info on telephony (e.g. voice over IP) support.
|
||||
time_interpolators.txt
|
||||
- info on time interpolators.
|
||||
uml/
|
||||
- directory with information about User Mode Linux.
|
||||
unicode.txt
|
||||
@ -346,8 +344,6 @@ vm/
|
||||
- directory with info on the Linux vm code.
|
||||
volatile-considered-harmful.txt
|
||||
- Why the "volatile" type class should not be used
|
||||
voyager.txt
|
||||
- guide to running Linux on the Voyager architecture.
|
||||
w1/
|
||||
- directory with documents regarding the 1-wire (w1) subsystem.
|
||||
watchdog/
|
||||
|
75
Documentation/ABI/stable/sysfs-firmware-efi-vars
Normal file
75
Documentation/ABI/stable/sysfs-firmware-efi-vars
Normal file
@ -0,0 +1,75 @@
|
||||
What: /sys/firmware/efi/vars
|
||||
Date: April 2004
|
||||
Contact: Matt Domsch <Matt_Domsch@dell.com>
|
||||
Description:
|
||||
This directory exposes interfaces for interactive with
|
||||
EFI variables. For more information on EFI variables,
|
||||
see 'Variable Services' in the UEFI specification
|
||||
(section 7.2 in specification version 2.3 Errata D).
|
||||
|
||||
In summary, EFI variables are named, and are classified
|
||||
into separate namespaces through the use of a vendor
|
||||
GUID. They also have an arbitrary binary value
|
||||
associated with them.
|
||||
|
||||
The efivars module enumerates these variables and
|
||||
creates a separate directory for each one found. Each
|
||||
directory has a name of the form "<key>-<vendor guid>"
|
||||
and contains the following files:
|
||||
|
||||
attributes: A read-only text file enumerating the
|
||||
EFI variable flags. Potential values
|
||||
include:
|
||||
|
||||
EFI_VARIABLE_NON_VOLATILE
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS
|
||||
EFI_VARIABLE_RUNTIME_ACCESS
|
||||
EFI_VARIABLE_HARDWARE_ERROR_RECORD
|
||||
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
|
||||
|
||||
See the EFI documentation for an
|
||||
explanation of each of these variables.
|
||||
|
||||
data: A read-only binary file that can be read
|
||||
to attain the value of the EFI variable
|
||||
|
||||
guid: The vendor GUID of the variable. This
|
||||
should always match the GUID in the
|
||||
variable's name.
|
||||
|
||||
raw_var: A binary file that can be read to obtain
|
||||
a structure that contains everything
|
||||
there is to know about the variable.
|
||||
For structure definition see "struct
|
||||
efi_variable" in the kernel sources.
|
||||
|
||||
This file can also be written to in
|
||||
order to update the value of a variable.
|
||||
For this to work however, all fields of
|
||||
the "struct efi_variable" passed must
|
||||
match byte for byte with the structure
|
||||
read out of the file, save for the value
|
||||
portion.
|
||||
|
||||
**Note** the efi_variable structure
|
||||
read/written with this file contains a
|
||||
'long' type that may change widths
|
||||
depending on your underlying
|
||||
architecture.
|
||||
|
||||
size: As ASCII representation of the size of
|
||||
the variable's value.
|
||||
|
||||
|
||||
In addition, two other magic binary files are provided
|
||||
in the top-level directory and are used for adding and
|
||||
removing variables:
|
||||
|
||||
new_var: Takes a "struct efi_variable" and
|
||||
instructs the EFI firmware to create a
|
||||
new variable.
|
||||
|
||||
del_var: Takes a "struct efi_variable" and
|
||||
instructs the EFI firmware to remove any
|
||||
variable that has a matching vendor GUID
|
||||
and variable key name.
|
35
Documentation/ABI/testing/pstore
Normal file
35
Documentation/ABI/testing/pstore
Normal file
@ -0,0 +1,35 @@
|
||||
Where: /dev/pstore/...
|
||||
Date: January 2011
|
||||
Kernel Version: 2.6.38
|
||||
Contact: tony.luck@intel.com
|
||||
Description: Generic interface to platform dependent persistent storage.
|
||||
|
||||
Platforms that provide a mechanism to preserve some data
|
||||
across system reboots can register with this driver to
|
||||
provide a generic interface to show records captured in
|
||||
the dying moments. In the case of a panic the last part
|
||||
of the console log is captured, but other interesting
|
||||
data can also be saved.
|
||||
|
||||
# mount -t pstore - /dev/pstore
|
||||
|
||||
$ ls -l /dev/pstore
|
||||
total 0
|
||||
-r--r--r-- 1 root root 7896 Nov 30 15:38 dmesg-erst-1
|
||||
|
||||
Different users of this interface will result in different
|
||||
filename prefixes. Currently two are defined:
|
||||
|
||||
"dmesg" - saved console log
|
||||
"mce" - architecture dependent data from fatal h/w error
|
||||
|
||||
Once the information in a file has been read, removing
|
||||
the file will signal to the underlying persistent storage
|
||||
device that it can reclaim the space for later re-use.
|
||||
|
||||
$ rm /dev/pstore/dmesg-erst-1
|
||||
|
||||
The expectation is that all files in /dev/pstore
|
||||
will be saved elsewhere and erased from persistent store
|
||||
soon after boot to free up space ready for the next
|
||||
catastrophe.
|
@ -29,9 +29,8 @@ Description:
|
||||
"disabled" to it.
|
||||
|
||||
For the devices that are not capable of generating system wakeup
|
||||
events this file contains "\n". In that cases the user space
|
||||
cannot modify the contents of this file and the device cannot be
|
||||
enabled to wake up the system.
|
||||
events this file is not present. In that case the device cannot
|
||||
be enabled to wake up the system from sleep states.
|
||||
|
||||
What: /sys/devices/.../power/control
|
||||
Date: January 2009
|
||||
@ -85,7 +84,7 @@ Description:
|
||||
The /sys/devices/.../wakeup_count attribute contains the number
|
||||
of signaled wakeup events associated with the device. This
|
||||
attribute is read-only. If the device is not enabled to wake up
|
||||
the system from sleep states, this attribute is empty.
|
||||
the system from sleep states, this attribute is not present.
|
||||
|
||||
What: /sys/devices/.../power/wakeup_active_count
|
||||
Date: September 2010
|
||||
@ -95,7 +94,7 @@ Description:
|
||||
number of times the processing of wakeup events associated with
|
||||
the device was completed (at the kernel level). This attribute
|
||||
is read-only. If the device is not enabled to wake up the
|
||||
system from sleep states, this attribute is empty.
|
||||
system from sleep states, this attribute is not present.
|
||||
|
||||
What: /sys/devices/.../power/wakeup_hit_count
|
||||
Date: September 2010
|
||||
@ -105,7 +104,8 @@ Description:
|
||||
number of times the processing of a wakeup event associated with
|
||||
the device might prevent the system from entering a sleep state.
|
||||
This attribute is read-only. If the device is not enabled to
|
||||
wake up the system from sleep states, this attribute is empty.
|
||||
wake up the system from sleep states, this attribute is not
|
||||
present.
|
||||
|
||||
What: /sys/devices/.../power/wakeup_active
|
||||
Date: September 2010
|
||||
@ -115,7 +115,7 @@ Description:
|
||||
or 0, depending on whether or not a wakeup event associated with
|
||||
the device is being processed (1). This attribute is read-only.
|
||||
If the device is not enabled to wake up the system from sleep
|
||||
states, this attribute is empty.
|
||||
states, this attribute is not present.
|
||||
|
||||
What: /sys/devices/.../power/wakeup_total_time_ms
|
||||
Date: September 2010
|
||||
@ -125,7 +125,7 @@ Description:
|
||||
the total time of processing wakeup events associated with the
|
||||
device, in milliseconds. This attribute is read-only. If the
|
||||
device is not enabled to wake up the system from sleep states,
|
||||
this attribute is empty.
|
||||
this attribute is not present.
|
||||
|
||||
What: /sys/devices/.../power/wakeup_max_time_ms
|
||||
Date: September 2010
|
||||
@ -135,7 +135,7 @@ Description:
|
||||
the maximum time of processing a single wakeup event associated
|
||||
with the device, in milliseconds. This attribute is read-only.
|
||||
If the device is not enabled to wake up the system from sleep
|
||||
states, this attribute is empty.
|
||||
states, this attribute is not present.
|
||||
|
||||
What: /sys/devices/.../power/wakeup_last_time_ms
|
||||
Date: September 2010
|
||||
@ -146,7 +146,7 @@ Description:
|
||||
signaling the last wakeup event associated with the device, in
|
||||
milliseconds. This attribute is read-only. If the device is
|
||||
not enabled to wake up the system from sleep states, this
|
||||
attribute is empty.
|
||||
attribute is not present.
|
||||
|
||||
What: /sys/devices/.../power/autosuspend_delay_ms
|
||||
Date: September 2010
|
||||
|
110
Documentation/ABI/testing/sysfs-firmware-dmi
Normal file
110
Documentation/ABI/testing/sysfs-firmware-dmi
Normal file
@ -0,0 +1,110 @@
|
||||
What: /sys/firmware/dmi/
|
||||
Date: February 2011
|
||||
Contact: Mike Waychison <mikew@google.com>
|
||||
Description:
|
||||
Many machines' firmware (x86 and ia64) export DMI /
|
||||
SMBIOS tables to the operating system. Getting at this
|
||||
information is often valuable to userland, especially in
|
||||
cases where there are OEM extensions used.
|
||||
|
||||
The kernel itself does not rely on the majority of the
|
||||
information in these tables being correct. It equally
|
||||
cannot ensure that the data as exported to userland is
|
||||
without error either.
|
||||
|
||||
DMI is structured as a large table of entries, where
|
||||
each entry has a common header indicating the type and
|
||||
length of the entry, as well as 'handle' that is
|
||||
supposed to be unique amongst all entries.
|
||||
|
||||
Some entries are required by the specification, but many
|
||||
others are optional. In general though, users should
|
||||
never expect to find a specific entry type on their
|
||||
system unless they know for certain what their firmware
|
||||
is doing. Machine to machine will vary.
|
||||
|
||||
Multiple entries of the same type are allowed. In order
|
||||
to handle these duplicate entry types, each entry is
|
||||
assigned by the operating system an 'instance', which is
|
||||
derived from an entry type's ordinal position. That is
|
||||
to say, if there are 'N' multiple entries with the same type
|
||||
'T' in the DMI tables (adjacent or spread apart, it
|
||||
doesn't matter), they will be represented in sysfs as
|
||||
entries "T-0" through "T-(N-1)":
|
||||
|
||||
Example entry directories:
|
||||
|
||||
/sys/firmware/dmi/entries/17-0
|
||||
/sys/firmware/dmi/entries/17-1
|
||||
/sys/firmware/dmi/entries/17-2
|
||||
/sys/firmware/dmi/entries/17-3
|
||||
...
|
||||
|
||||
Instance numbers are used in lieu of the firmware
|
||||
assigned entry handles as the kernel itself makes no
|
||||
guarantees that handles as exported are unique, and
|
||||
there are likely firmware images that get this wrong in
|
||||
the wild.
|
||||
|
||||
Each DMI entry in sysfs has the common header values
|
||||
exported as attributes:
|
||||
|
||||
handle : The 16bit 'handle' that is assigned to this
|
||||
entry by the firmware. This handle may be
|
||||
referred to by other entries.
|
||||
length : The length of the entry, as presented in the
|
||||
entry itself. Note that this is _not the
|
||||
total count of bytes associated with the
|
||||
entry_. This value represents the length of
|
||||
the "formatted" portion of the entry. This
|
||||
"formatted" region is sometimes followed by
|
||||
the "unformatted" region composed of nul
|
||||
terminated strings, with termination signalled
|
||||
by a two nul characters in series.
|
||||
raw : The raw bytes of the entry. This includes the
|
||||
"formatted" portion of the entry, the
|
||||
"unformatted" strings portion of the entry,
|
||||
and the two terminating nul characters.
|
||||
type : The type of the entry. This value is the same
|
||||
as found in the directory name. It indicates
|
||||
how the rest of the entry should be
|
||||
interpreted.
|
||||
instance: The instance ordinal of the entry for the
|
||||
given type. This value is the same as found
|
||||
in the parent directory name.
|
||||
position: The position of the entry within the entirety
|
||||
of the entirety.
|
||||
|
||||
=== Entry Specialization ===
|
||||
|
||||
Some entry types may have other information available in
|
||||
sysfs.
|
||||
|
||||
--- Type 15 - System Event Log ---
|
||||
|
||||
This entry allows the firmware to export a log of
|
||||
events the system has taken. This information is
|
||||
typically backed by nvram, but the implementation
|
||||
details are abstracted by this table. This entries data
|
||||
is exported in the directory:
|
||||
|
||||
/sys/firmware/dmi/entries/15-0/system_event_log
|
||||
|
||||
and has the following attributes (documented in the
|
||||
SMBIOS / DMI specification under "System Event Log (Type 15)":
|
||||
|
||||
area_length
|
||||
header_start_offset
|
||||
data_start_offset
|
||||
access_method
|
||||
status
|
||||
change_token
|
||||
access_method_address
|
||||
header_format
|
||||
per_log_type_descriptor_length
|
||||
type_descriptors_supported_count
|
||||
|
||||
As well, the kernel exports the binary attribute:
|
||||
|
||||
raw_event_log : The raw binary bits of the event log
|
||||
as described by the DMI entry.
|
7
Documentation/ABI/testing/sysfs-fs-pstore
Normal file
7
Documentation/ABI/testing/sysfs-fs-pstore
Normal file
@ -0,0 +1,7 @@
|
||||
What: /sys/fs/pstore/kmsg_bytes
|
||||
Date: January 2011
|
||||
Kernel Version: 2.6.38
|
||||
Contact: "Tony Luck" <tony.luck@intel.com>
|
||||
Description:
|
||||
Controls amount of console log that will be saved
|
||||
to persistent store on oops/panic.
|
48
Documentation/ABI/testing/sysfs-platform-kim
Normal file
48
Documentation/ABI/testing/sysfs-platform-kim
Normal file
@ -0,0 +1,48 @@
|
||||
What: /sys/devices/platform/kim/dev_name
|
||||
Date: January 2010
|
||||
KernelVersion: 2.6.38
|
||||
Contact: "Pavan Savoy" <pavan_savoy@ti.com>
|
||||
Description:
|
||||
Name of the UART device at which the WL128x chip
|
||||
is connected. example: "/dev/ttyS0".
|
||||
The device name flows down to architecture specific board
|
||||
initialization file from the SFI/ATAGS bootloader
|
||||
firmware. The name exposed is read from the user-space
|
||||
dameon and opens the device when install is requested.
|
||||
|
||||
What: /sys/devices/platform/kim/baud_rate
|
||||
Date: January 2010
|
||||
KernelVersion: 2.6.38
|
||||
Contact: "Pavan Savoy" <pavan_savoy@ti.com>
|
||||
Description:
|
||||
The maximum reliable baud-rate the host can support.
|
||||
Different platforms tend to have different high-speed
|
||||
UART configurations, so the baud-rate needs to be set
|
||||
locally and also sent across to the WL128x via a HCI-VS
|
||||
command. The entry is read and made use by the user-space
|
||||
daemon when the ldisc install is requested.
|
||||
|
||||
What: /sys/devices/platform/kim/flow_cntrl
|
||||
Date: January 2010
|
||||
KernelVersion: 2.6.38
|
||||
Contact: "Pavan Savoy" <pavan_savoy@ti.com>
|
||||
Description:
|
||||
The WL128x makes use of flow control mechanism, and this
|
||||
entry most often should be 1, the host's UART is required
|
||||
to have the capability of flow-control, or else this
|
||||
entry can be made use of for exceptions.
|
||||
|
||||
What: /sys/devices/platform/kim/install
|
||||
Date: January 2010
|
||||
KernelVersion: 2.6.38
|
||||
Contact: "Pavan Savoy" <pavan_savoy@ti.com>
|
||||
Description:
|
||||
When one of the protocols Bluetooth, FM or GPS wants to make
|
||||
use of the shared UART transport, it registers to the shared
|
||||
transport driver, which will signal the user-space for opening,
|
||||
configuring baud and install line discipline via this sysfs
|
||||
entry. This entry would be polled upon by the user-space
|
||||
daemon managing the UART, and is notified about the change
|
||||
by the sysfs_notify. The value would be '1' when UART needs
|
||||
to be opened/ldisc installed, and would be '0' when UART
|
||||
is no more required and needs to be closed.
|
@ -659,7 +659,7 @@ There are a number of driver model diagnostic macros in <linux/device.h>
|
||||
which you should use to make sure messages are matched to the right device
|
||||
and driver, and are tagged with the right level: dev_err(), dev_warn(),
|
||||
dev_info(), and so forth. For messages that aren't associated with a
|
||||
particular device, <linux/kernel.h> defines pr_debug() and pr_info().
|
||||
particular device, <linux/printk.h> defines pr_debug() and pr_info().
|
||||
|
||||
Coming up with good debugging messages can be quite a challenge; and once
|
||||
you have them, they can be a huge help for remote troubleshooting. Such
|
||||
@ -819,6 +819,3 @@ language C, URL: http://www.open-std.org/JTC1/SC22/WG14/
|
||||
Kernel CodingStyle, by greg@kroah.com at OLS 2002:
|
||||
http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/
|
||||
|
||||
--
|
||||
Last updated on 2007-July-13.
|
||||
|
||||
|
@ -849,6 +849,37 @@ All: lockdep-checked RCU-protected pointer access
|
||||
See the comment headers in the source code (or the docbook generated
|
||||
from them) for more information.
|
||||
|
||||
However, given that there are no fewer than four families of RCU APIs
|
||||
in the Linux kernel, how do you choose which one to use? The following
|
||||
list can be helpful:
|
||||
|
||||
a. Will readers need to block? If so, you need SRCU.
|
||||
|
||||
b. What about the -rt patchset? If readers would need to block
|
||||
in an non-rt kernel, you need SRCU. If readers would block
|
||||
in a -rt kernel, but not in a non-rt kernel, SRCU is not
|
||||
necessary.
|
||||
|
||||
c. Do you need to treat NMI handlers, hardirq handlers,
|
||||
and code segments with preemption disabled (whether
|
||||
via preempt_disable(), local_irq_save(), local_bh_disable(),
|
||||
or some other mechanism) as if they were explicit RCU readers?
|
||||
If so, you need RCU-sched.
|
||||
|
||||
d. Do you need RCU grace periods to complete even in the face
|
||||
of softirq monopolization of one or more of the CPUs? For
|
||||
example, is your code subject to network-based denial-of-service
|
||||
attacks? If so, you need RCU-bh.
|
||||
|
||||
e. Is your workload too update-intensive for normal use of
|
||||
RCU, but inappropriate for other synchronization mechanisms?
|
||||
If so, consider SLAB_DESTROY_BY_RCU. But please be careful!
|
||||
|
||||
f. Otherwise, use RCU.
|
||||
|
||||
Of course, this all assumes that you have determined that RCU is in fact
|
||||
the right tool for your job.
|
||||
|
||||
|
||||
8. ANSWERS TO QUICK QUIZZES
|
||||
|
||||
|
8
Documentation/arm/SH-Mobile/Makefile
Normal file
8
Documentation/arm/SH-Mobile/Makefile
Normal file
@ -0,0 +1,8 @@
|
||||
BIN := vrl4
|
||||
|
||||
.PHONY: all
|
||||
all: $(BIN)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f *.o $(BIN)
|
169
Documentation/arm/SH-Mobile/vrl4.c
Normal file
169
Documentation/arm/SH-Mobile/vrl4.c
Normal file
@ -0,0 +1,169 @@
|
||||
/*
|
||||
* vrl4 format generator
|
||||
*
|
||||
* Copyright (C) 2010 Simon Horman
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* usage: vrl4 < zImage > out
|
||||
* dd if=out of=/dev/sdx bs=512 seek=1 # Write the image to sector 1
|
||||
*
|
||||
* Reads a zImage from stdin and writes a vrl4 image to stdout.
|
||||
* In practice this means writing a padded vrl4 header to stdout followed
|
||||
* by the zImage.
|
||||
*
|
||||
* The padding places the zImage at ALIGN bytes into the output.
|
||||
* The vrl4 uses ALIGN + START_BASE as the start_address.
|
||||
* This is where the mask ROM will jump to after verifying the header.
|
||||
*
|
||||
* The header sets copy_size to min(sizeof(zImage), MAX_BOOT_PROG_LEN) + ALIGN.
|
||||
* That is, the mask ROM will load the padded header (ALIGN bytes)
|
||||
* And then MAX_BOOT_PROG_LEN bytes of the image, or the entire image,
|
||||
* whichever is smaller.
|
||||
*
|
||||
* The zImage is not modified in any way.
|
||||
*/
|
||||
|
||||
#define _BSD_SOURCE
|
||||
#include <endian.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
struct hdr {
|
||||
uint32_t magic1;
|
||||
uint32_t reserved1;
|
||||
uint32_t magic2;
|
||||
uint32_t reserved2;
|
||||
uint16_t copy_size;
|
||||
uint16_t boot_options;
|
||||
uint32_t reserved3;
|
||||
uint32_t start_address;
|
||||
uint32_t reserved4;
|
||||
uint32_t reserved5;
|
||||
char reserved6[308];
|
||||
};
|
||||
|
||||
#define DECLARE_HDR(h) \
|
||||
struct hdr (h) = { \
|
||||
.magic1 = htole32(0xea000000), \
|
||||
.reserved1 = htole32(0x56), \
|
||||
.magic2 = htole32(0xe59ff008), \
|
||||
.reserved3 = htole16(0x1) }
|
||||
|
||||
/* Align to 512 bytes, the MMCIF sector size */
|
||||
#define ALIGN_BITS 9
|
||||
#define ALIGN (1 << ALIGN_BITS)
|
||||
|
||||
#define START_BASE 0xe55b0000
|
||||
|
||||
/*
|
||||
* With an alignment of 512 the header uses the first sector.
|
||||
* There is a 128 sector (64kbyte) limit on the data loaded by the mask ROM.
|
||||
* So there are 127 sectors left for the boot programme. But in practice
|
||||
* Only a small portion of a zImage is needed, 16 sectors should be more
|
||||
* than enough.
|
||||
*
|
||||
* Note that this sets how much of the zImage is copied by the mask ROM.
|
||||
* The entire zImage is present after the header and is loaded
|
||||
* by the code in the boot program (which is the first portion of the zImage).
|
||||
*/
|
||||
#define MAX_BOOT_PROG_LEN (16 * 512)
|
||||
|
||||
#define ROUND_UP(x) ((x + ALIGN - 1) & ~(ALIGN - 1))
|
||||
|
||||
ssize_t do_read(int fd, void *buf, size_t count)
|
||||
{
|
||||
size_t offset = 0;
|
||||
ssize_t l;
|
||||
|
||||
while (offset < count) {
|
||||
l = read(fd, buf + offset, count - offset);
|
||||
if (!l)
|
||||
break;
|
||||
if (l < 0) {
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK)
|
||||
continue;
|
||||
perror("read");
|
||||
return -1;
|
||||
}
|
||||
offset += l;
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
ssize_t do_write(int fd, const void *buf, size_t count)
|
||||
{
|
||||
size_t offset = 0;
|
||||
ssize_t l;
|
||||
|
||||
while (offset < count) {
|
||||
l = write(fd, buf + offset, count - offset);
|
||||
if (l < 0) {
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK)
|
||||
continue;
|
||||
perror("write");
|
||||
return -1;
|
||||
}
|
||||
offset += l;
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
ssize_t write_zero(int fd, size_t len)
|
||||
{
|
||||
size_t i = len;
|
||||
|
||||
while (i--) {
|
||||
const char x = 0;
|
||||
if (do_write(fd, &x, 1) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
DECLARE_HDR(hdr);
|
||||
char boot_program[MAX_BOOT_PROG_LEN];
|
||||
size_t aligned_hdr_len, alligned_prog_len;
|
||||
ssize_t prog_len;
|
||||
|
||||
prog_len = do_read(0, boot_program, sizeof(boot_program));
|
||||
if (prog_len <= 0)
|
||||
return -1;
|
||||
|
||||
aligned_hdr_len = ROUND_UP(sizeof(hdr));
|
||||
hdr.start_address = htole32(START_BASE + aligned_hdr_len);
|
||||
alligned_prog_len = ROUND_UP(prog_len);
|
||||
hdr.copy_size = htole16(aligned_hdr_len + alligned_prog_len);
|
||||
|
||||
if (do_write(1, &hdr, sizeof(hdr)) < 0)
|
||||
return -1;
|
||||
if (write_zero(1, aligned_hdr_len - sizeof(hdr)) < 0)
|
||||
return -1;
|
||||
|
||||
if (do_write(1, boot_program, prog_len) < 0)
|
||||
return 1;
|
||||
|
||||
/* Write out the rest of the kernel */
|
||||
while (1) {
|
||||
prog_len = do_read(0, boot_program, sizeof(boot_program));
|
||||
if (prog_len < 0)
|
||||
return 1;
|
||||
if (prog_len == 0)
|
||||
break;
|
||||
if (do_write(1, boot_program, prog_len) < 0)
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
29
Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt
Normal file
29
Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt
Normal file
@ -0,0 +1,29 @@
|
||||
ROM-able zImage boot from MMC
|
||||
-----------------------------
|
||||
|
||||
An ROM-able zImage compiled with ZBOOT_ROM_MMCIF may be written to MMC and
|
||||
SuperH Mobile ARM will to boot directly from the MMCIF hardware block.
|
||||
|
||||
This is achieved by the mask ROM loading the first portion of the image into
|
||||
MERAM and then jumping to it. This portion contains loader code which
|
||||
copies the entire image to SDRAM and jumps to it. From there the zImage
|
||||
boot code proceeds as normal, uncompressing the image into its final
|
||||
location and then jumping to it.
|
||||
|
||||
This code has been tested on an AP4EB board using the developer 1A eMMC
|
||||
boot mode which is configured using the following jumper settings.
|
||||
The board used for testing required a patched mask ROM in order for
|
||||
this mode to function.
|
||||
|
||||
8 7 6 5 4 3 2 1
|
||||
x|x|x|x|x| |x|
|
||||
S4 -+-+-+-+-+-+-+-
|
||||
| | | | |x| |x on
|
||||
|
||||
The zImage must be written to the MMC card at sector 1 (512 bytes) in
|
||||
vrl4 format. A utility vrl4 is supplied to accomplish this.
|
||||
|
||||
e.g.
|
||||
vrl4 < zImage | dd of=/dev/sdX bs=512 seek=1
|
||||
|
||||
A dual-voltage MMC 4.0 card was used for testing.
|
@ -1,61 +0,0 @@
|
||||
README on the ADC/Touchscreen Controller
|
||||
========================================
|
||||
|
||||
The LH79524 and LH7A404 include a built-in Analog to Digital
|
||||
controller (ADC) that is used to process input from a touchscreen.
|
||||
The driver only implements a four-wire touch panel protocol.
|
||||
|
||||
The touchscreen driver is maintenance free except for the pen-down or
|
||||
touch threshold. Some resistive displays and board combinations may
|
||||
require tuning of this threshold. The driver exposes some of its
|
||||
internal state in the sys filesystem. If the kernel is configured
|
||||
with it, CONFIG_SYSFS, and sysfs is mounted at /sys, there will be a
|
||||
directory
|
||||
|
||||
/sys/devices/platform/adc-lh7.0
|
||||
|
||||
containing these files.
|
||||
|
||||
-r--r--r-- 1 root root 4096 Jan 1 00:00 samples
|
||||
-rw-r--r-- 1 root root 4096 Jan 1 00:00 threshold
|
||||
-r--r--r-- 1 root root 4096 Jan 1 00:00 threshold_range
|
||||
|
||||
The threshold is the current touch threshold. It defaults to 750 on
|
||||
most targets.
|
||||
|
||||
# cat threshold
|
||||
750
|
||||
|
||||
The threshold_range contains the range of valid values for the
|
||||
threshold. Values outside of this range will be silently ignored.
|
||||
|
||||
# cat threshold_range
|
||||
0 1023
|
||||
|
||||
To change the threshold, write a value to the threshold file.
|
||||
|
||||
# echo 500 > threshold
|
||||
# cat threshold
|
||||
500
|
||||
|
||||
The samples file contains the most recently sampled values from the
|
||||
ADC. There are 12. Below are typical of the last sampled values when
|
||||
the pen has been released. The first two and last two samples are for
|
||||
detecting whether or not the pen is down. The third through sixth are
|
||||
X coordinate samples. The seventh through tenth are Y coordinate
|
||||
samples.
|
||||
|
||||
# cat samples
|
||||
1023 1023 0 0 0 0 530 529 530 529 1023 1023
|
||||
|
||||
To determine a reasonable threshold, press on the touch panel with an
|
||||
appropriate stylus and read the values from samples.
|
||||
|
||||
# cat samples
|
||||
1023 676 92 103 101 102 855 919 922 922 1023 679
|
||||
|
||||
The first and eleventh samples are discarded. Thus, the important
|
||||
values are the second and twelfth which are used to determine if the
|
||||
pen is down. When both are below the threshold, the driver registers
|
||||
that the pen is down. When either is above the threshold, it
|
||||
registers then pen is up.
|
@ -1,32 +0,0 @@
|
||||
README on the Compact Flash for Card Engines
|
||||
============================================
|
||||
|
||||
There are three challenges in supporting the CF interface of the Card
|
||||
Engines. First, every IO operation must be followed with IO to
|
||||
another memory region. Second, the slot is wired for one-to-one
|
||||
address mapping *and* it is wired for 16 bit access only. Second, the
|
||||
interrupt request line from the CF device isn't wired.
|
||||
|
||||
The IOBARRIER issue is covered in README.IOBARRIER. This isn't an
|
||||
onerous problem. Enough said here.
|
||||
|
||||
The addressing issue is solved in the
|
||||
arch/arm/mach-lh7a40x/ide-lpd7a40x.c file with some awkward
|
||||
work-arounds. We implement a special SELECT_DRIVE routine that is
|
||||
called before the IDE driver performs its own SELECT_DRIVE. Our code
|
||||
recognizes that the SELECT register cannot be modified without also
|
||||
writing a command. It send an IDLE_IMMEDIATE command on selecting a
|
||||
drive. The function also prevents drive select to the slave drive
|
||||
since there can be only one. The awkward part is that the IDE driver,
|
||||
even though we have a select procedure, also attempts to change the
|
||||
drive by writing directly the SELECT register. This attempt is
|
||||
explicitly blocked by the OUTB function--not pretty, but effective.
|
||||
|
||||
The lack of interrupts is a more serious problem. Even though the CF
|
||||
card is fast when compared to a normal IDE device, we don't know that
|
||||
the CF is really flash. A user could use one of the very small hard
|
||||
drives being shipped with a CF interface. The IDE code includes a
|
||||
check for interfaces that lack an IRQ. In these cases, submitting a
|
||||
command to the IDE controller is followed by a call to poll for
|
||||
completion. If the device isn't immediately ready, it schedules a
|
||||
timer to poll again later.
|
@ -1,45 +0,0 @@
|
||||
README on the IOBARRIER for CardEngine IO
|
||||
=========================================
|
||||
|
||||
Due to an unfortunate oversight when the Card Engines were designed,
|
||||
the signals that control access to some peripherals, most notably the
|
||||
SMC91C9111 ethernet controller, are not properly handled.
|
||||
|
||||
The symptom is that some back to back IO with the peripheral returns
|
||||
unreliable data. With the SMC chip, you'll see errors about the bank
|
||||
register being 'screwed'.
|
||||
|
||||
The cause is that the AEN signal to the SMC chip does not transition
|
||||
for every memory access. It is driven through the CPLD from the CS7
|
||||
line of the CPU's static memory controller which is optimized to
|
||||
eliminate unnecessary transitions. Yet, the SMC requires a transition
|
||||
for every write access. The Sharp website has more information about
|
||||
the effect this power-conserving feature has on peripheral
|
||||
interfacing.
|
||||
|
||||
The solution is to follow every write access to the SMC chip with an
|
||||
access to another memory region that will force the CPU to release the
|
||||
chip select line. It is important to guarantee that this access
|
||||
forces the CPU off-chip. We map a page of SDRAM as if it were an
|
||||
uncacheable IO device and read from it after every SMC IO write
|
||||
operation.
|
||||
|
||||
SMC IO
|
||||
BARRIER IO
|
||||
|
||||
Only this sequence is important. It does not matter that there is no
|
||||
BARRIER IO before the access to the SMC chip because the AEN latch
|
||||
only needs occurs after the SMC IO write cycle. The routines that
|
||||
implement this work-around make an additional concession which is to
|
||||
disable interrupts during the IO sequence. Other hardware devices
|
||||
(the LogicPD CPLD) have registers in the same physical memory
|
||||
region as the SMC chip. An interrupt might allow an access to one of
|
||||
those registers while SMC IO is being performed.
|
||||
|
||||
You might be tempted to think that we have to access another device
|
||||
attached to the static memory controller, but the empirical evidence
|
||||
indicates that this is not so. Mapping 0x00000000 (flash) and
|
||||
0xc0000000 (SDRAM) appear to have the same effect. Using SDRAM seems
|
||||
to be faster. Choosing to access an undecoded memory region is not
|
||||
desirable as there is no way to know how that chip select will be used
|
||||
in the future.
|
@ -1,8 +0,0 @@
|
||||
README on Implementing Linux for Sharp's KEV7a400
|
||||
=================================================
|
||||
|
||||
This product has been discontinued by Sharp. For the time being, the
|
||||
partially implemented code remains in the kernel. At some point in
|
||||
the future, either the code will be finished or it will be removed
|
||||
completely. This depends primarily on how many of the development
|
||||
boards are in the field.
|
@ -1,59 +0,0 @@
|
||||
README on the LCD Panels
|
||||
========================
|
||||
|
||||
Configuration options for several LCD panels, available from Logic PD,
|
||||
are included in the kernel source. This README will help you
|
||||
understand the configuration data and give you some guidance for
|
||||
adding support for other panels if you wish.
|
||||
|
||||
|
||||
lcd-panels.h
|
||||
------------
|
||||
|
||||
There is no way, at present, to detect which panel is attached to the
|
||||
system at runtime. Thus the kernel configuration is static. The file
|
||||
arch/arm/mach-ld7a40x/lcd-panels.h (or similar) defines all of the
|
||||
panel specific parameters.
|
||||
|
||||
It should be possible for this data to be shared among several device
|
||||
families. The current layout may be insufficiently general, but it is
|
||||
amenable to improvement.
|
||||
|
||||
|
||||
PIXEL_CLOCK
|
||||
-----------
|
||||
|
||||
The panel data sheets will give a range of acceptable pixel clocks.
|
||||
The fundamental LCDCLK input frequency is divided down by a PCD
|
||||
constant in field '.tim2'. It may happen that it is impossible to set
|
||||
the pixel clock within this range. A clock which is too slow will
|
||||
tend to flicker. For the highest quality image, set the clock as high
|
||||
as possible.
|
||||
|
||||
|
||||
MARGINS
|
||||
-------
|
||||
|
||||
These values may be difficult to glean from the panel data sheet. In
|
||||
the case of the Sharp panels, the upper margin is explicitly called
|
||||
out as a specific number of lines from the top of the frame. The
|
||||
other values may not matter as much as the panels tend to
|
||||
automatically center the image.
|
||||
|
||||
|
||||
Sync Sense
|
||||
----------
|
||||
|
||||
The sense of the hsync and vsync pulses may be called out in the data
|
||||
sheet. On one panel, the sense of these pulses determine the height
|
||||
of the visible region on the panel. Most of the Sharp panels use
|
||||
negative sense sync pulses set by the TIM2_IHS and TIM2_IVS bits in
|
||||
'.tim2'.
|
||||
|
||||
|
||||
Pel Layout
|
||||
----------
|
||||
|
||||
The Sharp color TFT panels are all configured for 16 bit direct color
|
||||
modes. The amba-lcd driver sets the pel mode to 565 for 5 bits of
|
||||
each red and blue and 6 bits of green.
|
@ -1,15 +0,0 @@
|
||||
README on Implementing Linux for the Logic PD LPD7A400-10
|
||||
=========================================================
|
||||
|
||||
- CPLD memory mapping
|
||||
|
||||
The board designers chose to use high address lines for controlling
|
||||
access to the CPLD registers. It turns out to be a big waste
|
||||
because we're using an MMU and must map IO space into virtual
|
||||
memory. The result is that we have to make a mapping for every
|
||||
register.
|
||||
|
||||
- Serial Console
|
||||
|
||||
It may be OK not to use the serial console option if the user passes
|
||||
the console device name to the kernel. This deserves some exploration.
|
@ -1,16 +0,0 @@
|
||||
README on Implementing Linux for the Logic PD LPD7A40X-10
|
||||
=========================================================
|
||||
|
||||
- CPLD memory mapping
|
||||
|
||||
The board designers chose to use high address lines for controlling
|
||||
access to the CPLD registers. It turns out to be a big waste
|
||||
because we're using an MMU and must map IO space into virtual
|
||||
memory. The result is that we have to make a mapping for every
|
||||
register.
|
||||
|
||||
- Serial Console
|
||||
|
||||
It may be OK not to use the serial console option if the user passes
|
||||
the console device name to the kernel. This deserves some exploration.
|
||||
|
@ -1,51 +0,0 @@
|
||||
README on the SDRAM Controller for the LH7a40X
|
||||
==============================================
|
||||
|
||||
The standard configuration for the SDRAM controller generates a sparse
|
||||
memory array. The precise layout is determined by the SDRAM chips. A
|
||||
default kernel configuration assembles the discontiguous memory
|
||||
regions into separate memory nodes via the NUMA (Non-Uniform Memory
|
||||
Architecture) facilities. In this default configuration, the kernel
|
||||
is forgiving about the precise layout. As long as it is given an
|
||||
accurate picture of available memory by the bootloader the kernel will
|
||||
execute correctly.
|
||||
|
||||
The SDRC supports a mode where some of the chip select lines are
|
||||
swapped in order to make SDRAM look like a synchronous ROM. Setting
|
||||
this bit means that the RAM will present as a contiguous array. Some
|
||||
programmers prefer this to the discontiguous layout. Be aware that
|
||||
may be a penalty for this feature where some some configurations of
|
||||
memory are significantly reduced; i.e. 64MiB of RAM appears as only 32
|
||||
MiB.
|
||||
|
||||
There are a couple of configuration options to override the default
|
||||
behavior. When the SROMLL bit is set and memory appears as a
|
||||
contiguous array, there is no reason to support NUMA.
|
||||
CONFIG_LH7A40X_CONTIGMEM disables NUMA support. When physical memory
|
||||
is discontiguous, the memory tables are organized such that there are
|
||||
two banks per nodes with a small gap between them. This layout wastes
|
||||
some kernel memory for page tables representing non-existent memory.
|
||||
CONFIG_LH7A40X_ONE_BANK_PER_NODE optimizes the node tables such that
|
||||
there are no gaps. These options control the low level organization
|
||||
of the memory management tables in ways that may prevent the kernel
|
||||
from booting or may cause the kernel to allocated excessively large
|
||||
page tables. Be warned. Only change these options if you know what
|
||||
you are doing. The default behavior is a reasonable compromise that
|
||||
will suit all users.
|
||||
|
||||
--
|
||||
|
||||
A typical 32MiB system with the default configuration options will
|
||||
find physical memory managed as follows.
|
||||
|
||||
node 0: 0xc0000000 4MiB
|
||||
0xc1000000 4MiB
|
||||
node 1: 0xc4000000 4MiB
|
||||
0xc5000000 4MiB
|
||||
node 2: 0xc8000000 4MiB
|
||||
0xc9000000 4MiB
|
||||
node 3: 0xcc000000 4MiB
|
||||
0xcd000000 4MiB
|
||||
|
||||
Setting CONFIG_LH7A40X_ONE_BANK_PER_NODE will put each bank into a
|
||||
separate node.
|
@ -1,80 +0,0 @@
|
||||
README on the Vectored Interrupt Controller of the LH7A404
|
||||
==========================================================
|
||||
|
||||
The 404 revision of the LH7A40X series comes with two vectored
|
||||
interrupts controllers. While the kernel does use some of the
|
||||
features of these devices, it is far from the purpose for which they
|
||||
were designed.
|
||||
|
||||
When this README was written, the implementation of the VICs was in
|
||||
flux. It is possible that some details, especially with priorities,
|
||||
will change.
|
||||
|
||||
The VIC support code is inspired by routines written by Sharp.
|
||||
|
||||
|
||||
Priority Control
|
||||
----------------
|
||||
|
||||
The significant reason for using the VIC's vectoring is to control
|
||||
interrupt priorities. There are two tables in
|
||||
arch/arm/mach-lh7a40x/irq-lh7a404.c that look something like this.
|
||||
|
||||
static unsigned char irq_pri_vic1[] = { IRQ_GPIO3INTR, };
|
||||
static unsigned char irq_pri_vic2[] = {
|
||||
IRQ_T3UI, IRQ_GPIO7INTR,
|
||||
IRQ_UART1INTR, IRQ_UART2INTR, IRQ_UART3INTR, };
|
||||
|
||||
The initialization code reads these tables and inserts a vector
|
||||
address and enable for each indicated IRQ. Vectored interrupts have
|
||||
higher priority than non-vectored interrupts. So, on VIC1,
|
||||
IRQ_GPIO3INTR will be served before any other non-FIQ interrupt. Due
|
||||
to the way that the vectoring works, IRQ_T3UI is the next highest
|
||||
priority followed by the other vectored interrupts on VIC2. After
|
||||
that, the non-vectored interrupts are scanned in VIC1 then in VIC2.
|
||||
|
||||
|
||||
ISR
|
||||
---
|
||||
|
||||
The interrupt service routine macro get_irqnr() in
|
||||
arch/arm/kernel/entry-armv.S scans the VICs for the next active
|
||||
interrupt. The vectoring makes this code somewhat larger than it was
|
||||
before using vectoring (refer to the LH7A400 implementation). In the
|
||||
case where an interrupt is vectored, the implementation will tend to
|
||||
be faster than the non-vectored version. However, the worst-case path
|
||||
is longer.
|
||||
|
||||
It is worth noting that at present, there is no need to read
|
||||
VIC2_VECTADDR because the register appears to be shared between the
|
||||
controllers. The code is written such that if this changes, it ought
|
||||
to still work properly.
|
||||
|
||||
|
||||
Vector Addresses
|
||||
----------------
|
||||
|
||||
The proper use of the vectoring hardware would jump to the ISR
|
||||
specified by the vectoring address. Linux isn't structured to take
|
||||
advantage of this feature, though it might be possible to change
|
||||
things to support it.
|
||||
|
||||
In this implementation, the vectoring address is used to speed the
|
||||
search for the active IRQ. The address is coded such that the lowest
|
||||
6 bits store the IRQ number for vectored interrupts. These numbers
|
||||
correspond to the bits in the interrupt status registers. IRQ zero is
|
||||
the lowest interrupt bit in VIC1. IRQ 32 is the lowest interrupt bit
|
||||
in VIC2. Because zero is a valid IRQ number and because we cannot
|
||||
detect whether or not there is a valid vectoring address if that
|
||||
address is zero, the eigth bit (0x100) is set for vectored interrupts.
|
||||
The address for IRQ 0x18 (VIC2) is 0x118. Only the ninth bit is set
|
||||
for the default handler on VIC1 and only the tenth bit is set for the
|
||||
default handler on VIC2.
|
||||
|
||||
In other words.
|
||||
|
||||
0x000 - no active interrupt
|
||||
0x1ii - vectored interrupt 0xii
|
||||
0x2xx - unvectored interrupt on VIC1 (xx is don't care)
|
||||
0x4xx - unvectored interrupt on VIC2 (xx is don't care)
|
||||
|
@ -349,6 +349,10 @@ To mount a cgroup hierarchy with all available subsystems, type:
|
||||
The "xxx" is not interpreted by the cgroup code, but will appear in
|
||||
/proc/mounts so may be any useful identifying string that you like.
|
||||
|
||||
Note: Some subsystems do not work without some user input first. For instance,
|
||||
if cpusets are enabled the user will have to populate the cpus and mems files
|
||||
for each new cgroup created before that group can be used.
|
||||
|
||||
To mount a cgroup hierarchy with just the cpuset and memory
|
||||
subsystems, type:
|
||||
# mount -t cgroup -o cpuset,memory hier1 /dev/cgroup
|
||||
@ -426,6 +430,14 @@ You can attach the current shell task by echoing 0:
|
||||
|
||||
# echo 0 > tasks
|
||||
|
||||
Note: Since every task is always a member of exactly one cgroup in each
|
||||
mounted hierarchy, to remove a task from its current cgroup you must
|
||||
move it into a new cgroup (possibly the root cgroup) by writing to the
|
||||
new cgroup's tasks file.
|
||||
|
||||
Note: If the ns cgroup is active, moving a process to another cgroup can
|
||||
fail.
|
||||
|
||||
2.3 Mounting hierarchies by name
|
||||
--------------------------------
|
||||
|
||||
|
10
Documentation/devicetree/00-INDEX
Normal file
10
Documentation/devicetree/00-INDEX
Normal file
@ -0,0 +1,10 @@
|
||||
Documentation for device trees, a data structure by which bootloaders pass
|
||||
hardware layout to Linux in a device-independent manner, simplifying hardware
|
||||
probing. This subsystem is maintained by Grant Likely
|
||||
<grant.likely@secretlab.ca> and has a mailing list at
|
||||
https://lists.ozlabs.org/listinfo/devicetree-discuss
|
||||
|
||||
00-INDEX
|
||||
- this file
|
||||
booting-without-of.txt
|
||||
- Booting Linux without Open Firmware, describes history and format of device trees.
|
93
Documentation/devicetree/bindings/i2c/ce4100-i2c.txt
Normal file
93
Documentation/devicetree/bindings/i2c/ce4100-i2c.txt
Normal file
@ -0,0 +1,93 @@
|
||||
CE4100 I2C
|
||||
----------
|
||||
|
||||
CE4100 has one PCI device which is described as the I2C-Controller. This
|
||||
PCI device has three PCI-bars, each bar contains a complete I2C
|
||||
controller. So we have a total of three independent I2C-Controllers
|
||||
which share only an interrupt line.
|
||||
The driver is probed via the PCI-ID and is gathering the information of
|
||||
attached devices from the devices tree.
|
||||
Grant Likely recommended to use the ranges property to map the PCI-Bar
|
||||
number to its physical address and to use this to find the child nodes
|
||||
of the specific I2C controller. This were his exact words:
|
||||
|
||||
Here's where the magic happens. Each entry in
|
||||
ranges describes how the parent pci address space
|
||||
(middle group of 3) is translated to the local
|
||||
address space (first group of 2) and the size of
|
||||
each range (last cell). In this particular case,
|
||||
the first cell of the local address is chosen to be
|
||||
1:1 mapped to the BARs, and the second is the
|
||||
offset from be base of the BAR (which would be
|
||||
non-zero if you had 2 or more devices mapped off
|
||||
the same BAR)
|
||||
|
||||
ranges allows the address mapping to be described
|
||||
in a way that the OS can interpret without
|
||||
requiring custom device driver code.
|
||||
|
||||
This is an example which is used on FalconFalls:
|
||||
------------------------------------------------
|
||||
i2c-controller@b,2 {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <1>;
|
||||
compatible = "pci8086,2e68.2",
|
||||
"pci8086,2e68",
|
||||
"pciclass,ff0000",
|
||||
"pciclass,ff00";
|
||||
|
||||
reg = <0x15a00 0x0 0x0 0x0 0x0>;
|
||||
interrupts = <16 1>;
|
||||
|
||||
/* as described by Grant, the first number in the group of
|
||||
* three is the bar number followed by the 64bit bar address
|
||||
* followed by size of the mapping. The bar address
|
||||
* requires also a valid translation in parents ranges
|
||||
* property.
|
||||
*/
|
||||
ranges = <0 0 0x02000000 0 0xdffe0500 0x100
|
||||
1 0 0x02000000 0 0xdffe0600 0x100
|
||||
2 0 0x02000000 0 0xdffe0700 0x100>;
|
||||
|
||||
i2c@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "intel,ce4100-i2c-controller";
|
||||
|
||||
/* The first number in the reg property is the
|
||||
* number of the bar
|
||||
*/
|
||||
reg = <0 0 0x100>;
|
||||
|
||||
/* This I2C controller has no devices */
|
||||
};
|
||||
|
||||
i2c@1 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "intel,ce4100-i2c-controller";
|
||||
reg = <1 0 0x100>;
|
||||
|
||||
/* This I2C controller has one gpio controller */
|
||||
gpio@26 {
|
||||
#gpio-cells = <2>;
|
||||
compatible = "ti,pcf8575";
|
||||
reg = <0x26>;
|
||||
gpio-controller;
|
||||
};
|
||||
};
|
||||
|
||||
i2c@2 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "intel,ce4100-i2c-controller";
|
||||
reg = <2 0 0x100>;
|
||||
|
||||
gpio@26 {
|
||||
#gpio-cells = <2>;
|
||||
compatible = "ti,pcf8575";
|
||||
reg = <0x26>;
|
||||
gpio-controller;
|
||||
};
|
||||
};
|
||||
};
|
28
Documentation/devicetree/bindings/rtc/rtc-cmos.txt
Normal file
28
Documentation/devicetree/bindings/rtc/rtc-cmos.txt
Normal file
@ -0,0 +1,28 @@
|
||||
Motorola mc146818 compatible RTC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Required properties:
|
||||
- compatible : "motorola,mc146818"
|
||||
- reg : should contain registers location and length.
|
||||
|
||||
Optional properties:
|
||||
- interrupts : should contain interrupt.
|
||||
- interrupt-parent : interrupt source phandle.
|
||||
- ctrl-reg : Contains the initial value of the control register also
|
||||
called "Register B".
|
||||
- freq-reg : Contains the initial value of the frequency register also
|
||||
called "Regsiter A".
|
||||
|
||||
"Register A" and "B" are usually initialized by the firmware (BIOS for
|
||||
instance). If this is not done, it can be performed by the driver.
|
||||
|
||||
ISA Example:
|
||||
|
||||
rtc@70 {
|
||||
compatible = "motorola,mc146818";
|
||||
interrupts = <8 3>;
|
||||
interrupt-parent = <&ioapic1>;
|
||||
ctrl-reg = <2>;
|
||||
freq-reg = <0x26>;
|
||||
reg = <1 0x70 2>;
|
||||
};
|
@ -0,0 +1,4 @@
|
||||
Altera JTAG UART
|
||||
|
||||
Required properties:
|
||||
- compatible : should be "ALTR,juart-1.0"
|
7
Documentation/devicetree/bindings/serial/altera_uart.txt
Normal file
7
Documentation/devicetree/bindings/serial/altera_uart.txt
Normal file
@ -0,0 +1,7 @@
|
||||
Altera UART
|
||||
|
||||
Required properties:
|
||||
- compatible : should be "ALTR,uart-1.0"
|
||||
|
||||
Optional properties:
|
||||
- clock-frequency : frequency of the clock input to the UART
|
4
Documentation/devicetree/bindings/serio/altera_ps2.txt
Normal file
4
Documentation/devicetree/bindings/serio/altera_ps2.txt
Normal file
@ -0,0 +1,4 @@
|
||||
Altera UP PS/2 controller
|
||||
|
||||
Required properties:
|
||||
- compatible : should be "ALTR,ps2-1.0".
|
38
Documentation/devicetree/bindings/x86/ce4100.txt
Normal file
38
Documentation/devicetree/bindings/x86/ce4100.txt
Normal file
@ -0,0 +1,38 @@
|
||||
CE4100 Device Tree Bindings
|
||||
---------------------------
|
||||
|
||||
The CE4100 SoC uses for in core peripherals the following compatible
|
||||
format: <vendor>,<chip>-<device>.
|
||||
Many of the "generic" devices like HPET or IO APIC have the ce4100
|
||||
name in their compatible property because they first appeared in this
|
||||
SoC.
|
||||
|
||||
The CPU node
|
||||
------------
|
||||
cpu@0 {
|
||||
device_type = "cpu";
|
||||
compatible = "intel,ce4100";
|
||||
reg = <0>;
|
||||
lapic = <&lapic0>;
|
||||
};
|
||||
|
||||
The reg property describes the CPU number. The lapic property points to
|
||||
the local APIC timer.
|
||||
|
||||
The SoC node
|
||||
------------
|
||||
|
||||
This node describes the in-core peripherals. Required property:
|
||||
compatible = "intel,ce4100-cp";
|
||||
|
||||
The PCI node
|
||||
------------
|
||||
This node describes the PCI bus on the SoC. Its property should be
|
||||
compatible = "intel,ce4100-pci", "pci";
|
||||
|
||||
If the OS is using the IO-APIC for interrupt routing then the reported
|
||||
interrupt numbers for devices is no longer true. In order to obtain the
|
||||
correct interrupt number, the child node which represents the device has
|
||||
to contain the interrupt property. Besides the interrupt property it has
|
||||
to contain at least the reg property containing the PCI bus address and
|
||||
compatible property according to "PCI Bus Binding Revision 2.1".
|
26
Documentation/devicetree/bindings/x86/interrupt.txt
Normal file
26
Documentation/devicetree/bindings/x86/interrupt.txt
Normal file
@ -0,0 +1,26 @@
|
||||
Interrupt chips
|
||||
---------------
|
||||
|
||||
* Intel I/O Advanced Programmable Interrupt Controller (IO APIC)
|
||||
|
||||
Required properties:
|
||||
--------------------
|
||||
compatible = "intel,ce4100-ioapic";
|
||||
#interrupt-cells = <2>;
|
||||
|
||||
Device's interrupt property:
|
||||
|
||||
interrupts = <P S>;
|
||||
|
||||
The first number (P) represents the interrupt pin which is wired to the
|
||||
IO APIC. The second number (S) represents the sense of interrupt which
|
||||
should be configured and can be one of:
|
||||
0 - Edge Rising
|
||||
1 - Level Low
|
||||
2 - Level High
|
||||
3 - Edge Falling
|
||||
|
||||
* Local APIC
|
||||
Required property:
|
||||
|
||||
compatible = "intel,ce4100-lapic";
|
6
Documentation/devicetree/bindings/x86/timer.txt
Normal file
6
Documentation/devicetree/bindings/x86/timer.txt
Normal file
@ -0,0 +1,6 @@
|
||||
Timers
|
||||
------
|
||||
|
||||
* High Precision Event Timer (HPET)
|
||||
Required property:
|
||||
compatible = "intel,ce4100-hpet";
|
@ -13,6 +13,7 @@ Table of Contents
|
||||
|
||||
I - Introduction
|
||||
1) Entry point for arch/powerpc
|
||||
2) Entry point for arch/x86
|
||||
|
||||
II - The DT block format
|
||||
1) Header
|
||||
@ -225,6 +226,25 @@ it with special cases.
|
||||
cannot support both configurations with Book E and configurations
|
||||
with classic Powerpc architectures.
|
||||
|
||||
2) Entry point for arch/x86
|
||||
-------------------------------
|
||||
|
||||
There is one single 32bit entry point to the kernel at code32_start,
|
||||
the decompressor (the real mode entry point goes to the same 32bit
|
||||
entry point once it switched into protected mode). That entry point
|
||||
supports one calling convention which is documented in
|
||||
Documentation/x86/boot.txt
|
||||
The physical pointer to the device-tree block (defined in chapter II)
|
||||
is passed via setup_data which requires at least boot protocol 2.09.
|
||||
The type filed is defined as
|
||||
|
||||
#define SETUP_DTB 2
|
||||
|
||||
This device-tree is used as an extension to the "boot page". As such it
|
||||
does not parse / consider data which is already covered by the boot
|
||||
page. This includes memory size, reserved ranges, command line arguments
|
||||
or initrd address. It simply holds information which can not be retrieved
|
||||
otherwise like interrupt routing or a list of devices behind an I2C bus.
|
||||
|
||||
II - The DT block format
|
||||
========================
|
||||
|
@ -205,12 +205,20 @@ of the characters:
|
||||
|
||||
The flags are:
|
||||
|
||||
f
|
||||
Include the function name in the printed message
|
||||
l
|
||||
Include line number in the printed message
|
||||
m
|
||||
Include module name in the printed message
|
||||
p
|
||||
Causes a printk() message to be emitted to dmesg
|
||||
t
|
||||
Include thread ID in messages not generated from interrupt context
|
||||
|
||||
Note the regexp ^[-+=][scp]+$ matches a flags specification.
|
||||
Note the regexp ^[-+=][flmpt]+$ matches a flags specification.
|
||||
Note also that there is no convenient syntax to remove all
|
||||
the flags at once, you need to use "-psc".
|
||||
the flags at once, you need to use "-flmpt".
|
||||
|
||||
|
||||
Debug messages during boot process
|
||||
|
@ -35,6 +35,17 @@ Who: Luis R. Rodriguez <lrodriguez@atheros.com>
|
||||
|
||||
---------------------------
|
||||
|
||||
What: AR9170USB
|
||||
When: 2.6.40
|
||||
|
||||
Why: This driver is deprecated and the firmware is no longer
|
||||
maintained. The replacement driver "carl9170" has been
|
||||
around for a while, so the devices are still supported.
|
||||
|
||||
Who: Christian Lamparter <chunkeey@googlemail.com>
|
||||
|
||||
---------------------------
|
||||
|
||||
What: IRQF_SAMPLE_RANDOM
|
||||
Check: IRQF_SAMPLE_RANDOM
|
||||
When: July 2009
|
||||
@ -604,6 +615,13 @@ Who: Jean Delvare <khali@linux-fr.org>
|
||||
|
||||
----------------------------
|
||||
|
||||
What: xt_connlimit rev 0
|
||||
When: 2012
|
||||
Who: Jan Engelhardt <jengelh@medozas.de>
|
||||
Files: net/netfilter/xt_connlimit.c
|
||||
|
||||
----------------------------
|
||||
|
||||
What: noswapaccount kernel command line parameter
|
||||
When: 2.6.40
|
||||
Why: The original implementation of memsw feature enabled by
|
||||
@ -619,3 +637,11 @@ Why: The original implementation of memsw feature enabled by
|
||||
Who: Michal Hocko <mhocko@suse.cz>
|
||||
|
||||
----------------------------
|
||||
|
||||
What: ipt_addrtype match include file
|
||||
When: 2012
|
||||
Why: superseded by xt_addrtype
|
||||
Who: Florian Westphal <fw@strlen.de>
|
||||
Files: include/linux/netfilter_ipv4/ipt_addrtype.h
|
||||
|
||||
----------------------------
|
||||
|
@ -166,13 +166,11 @@ prototypes:
|
||||
void (*kill_sb) (struct super_block *);
|
||||
locking rules:
|
||||
may block
|
||||
get_sb yes
|
||||
mount yes
|
||||
kill_sb yes
|
||||
|
||||
->get_sb() returns error or 0 with locked superblock attached to the vfsmount
|
||||
(exclusive on ->s_umount).
|
||||
->mount() returns ERR_PTR or the root dentry.
|
||||
->mount() returns ERR_PTR or the root dentry; its superblock should be locked
|
||||
on return.
|
||||
->kill_sb() takes a write-locked superblock, does all shutdown work on it,
|
||||
unlocks and drops the reference.
|
||||
|
||||
|
@ -394,3 +394,10 @@ file) you must return -EOPNOTSUPP if FALLOC_FL_PUNCH_HOLE is set in mode.
|
||||
Currently you can only have FALLOC_FL_PUNCH_HOLE with FALLOC_FL_KEEP_SIZE set,
|
||||
so the i_size should not change when hole punching, even when puching the end of
|
||||
a file off.
|
||||
|
||||
--
|
||||
[mandatory]
|
||||
->get_sb() is gone. Switch to use of ->mount(). Typically it's just
|
||||
a matter of switching from calling get_sb_... to mount_... and changing the
|
||||
function type. If you were doing it manually, just switch from setting ->mnt_root
|
||||
to some pointer to returning that pointer. On errors return ERR_PTR(...).
|
||||
|
@ -39,10 +39,12 @@ userspace. Top-level directories in sysfs represent the common
|
||||
ancestors of object hierarchies; i.e. the subsystems the objects
|
||||
belong to.
|
||||
|
||||
Sysfs internally stores the kobject that owns the directory in the
|
||||
->d_fsdata pointer of the directory's dentry. This allows sysfs to do
|
||||
reference counting directly on the kobject when the file is opened and
|
||||
closed.
|
||||
Sysfs internally stores a pointer to the kobject that implements a
|
||||
directory in the sysfs_dirent object associated with the directory. In
|
||||
the past this kobject pointer has been used by sysfs to do reference
|
||||
counting directly on the kobject whenever the file is opened or closed.
|
||||
With the current sysfs implementation the kobject reference count is
|
||||
only modified directly by the function sysfs_schedule_callback().
|
||||
|
||||
|
||||
Attributes
|
||||
@ -208,9 +210,9 @@ Other notes:
|
||||
is 4096.
|
||||
|
||||
- show() methods should return the number of bytes printed into the
|
||||
buffer. This is the return value of snprintf().
|
||||
buffer. This is the return value of scnprintf().
|
||||
|
||||
- show() should always use snprintf().
|
||||
- show() should always use scnprintf().
|
||||
|
||||
- store() should return the number of bytes used from the buffer. If the
|
||||
entire buffer has been used, just return the count argument.
|
||||
@ -229,7 +231,7 @@ A very simple (and naive) implementation of a device attribute is:
|
||||
static ssize_t show_name(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", dev->name);
|
||||
return scnprintf(buf, PAGE_SIZE, "%s\n", dev->name);
|
||||
}
|
||||
|
||||
static ssize_t store_name(struct device *dev, struct device_attribute *attr,
|
||||
|
@ -95,10 +95,11 @@ functions:
|
||||
extern int unregister_filesystem(struct file_system_type *);
|
||||
|
||||
The passed struct file_system_type describes your filesystem. When a
|
||||
request is made to mount a device onto a directory in your filespace,
|
||||
the VFS will call the appropriate get_sb() method for the specific
|
||||
filesystem. The dentry for the mount point will then be updated to
|
||||
point to the root inode for the new filesystem.
|
||||
request is made to mount a filesystem onto a directory in your namespace,
|
||||
the VFS will call the appropriate mount() method for the specific
|
||||
filesystem. New vfsmount refering to the tree returned by ->mount()
|
||||
will be attached to the mountpoint, so that when pathname resolution
|
||||
reaches the mountpoint it will jump into the root of that vfsmount.
|
||||
|
||||
You can see all filesystems that are registered to the kernel in the
|
||||
file /proc/filesystems.
|
||||
@ -107,14 +108,14 @@ file /proc/filesystems.
|
||||
struct file_system_type
|
||||
-----------------------
|
||||
|
||||
This describes the filesystem. As of kernel 2.6.22, the following
|
||||
This describes the filesystem. As of kernel 2.6.39, the following
|
||||
members are defined:
|
||||
|
||||
struct file_system_type {
|
||||
const char *name;
|
||||
int fs_flags;
|
||||
int (*get_sb) (struct file_system_type *, int,
|
||||
const char *, void *, struct vfsmount *);
|
||||
struct dentry (*mount) (struct file_system_type *, int,
|
||||
const char *, void *);
|
||||
void (*kill_sb) (struct super_block *);
|
||||
struct module *owner;
|
||||
struct file_system_type * next;
|
||||
@ -128,11 +129,11 @@ struct file_system_type {
|
||||
|
||||
fs_flags: various flags (i.e. FS_REQUIRES_DEV, FS_NO_DCACHE, etc.)
|
||||
|
||||
get_sb: the method to call when a new instance of this
|
||||
mount: the method to call when a new instance of this
|
||||
filesystem should be mounted
|
||||
|
||||
kill_sb: the method to call when an instance of this filesystem
|
||||
should be unmounted
|
||||
should be shut down
|
||||
|
||||
owner: for internal VFS use: you should initialize this to THIS_MODULE in
|
||||
most cases.
|
||||
@ -141,7 +142,7 @@ struct file_system_type {
|
||||
|
||||
s_lock_key, s_umount_key: lockdep-specific
|
||||
|
||||
The get_sb() method has the following arguments:
|
||||
The mount() method has the following arguments:
|
||||
|
||||
struct file_system_type *fs_type: describes the filesystem, partly initialized
|
||||
by the specific filesystem code
|
||||
@ -153,32 +154,39 @@ The get_sb() method has the following arguments:
|
||||
void *data: arbitrary mount options, usually comes as an ASCII
|
||||
string (see "Mount Options" section)
|
||||
|
||||
struct vfsmount *mnt: a vfs-internal representation of a mount point
|
||||
The mount() method must return the root dentry of the tree requested by
|
||||
caller. An active reference to its superblock must be grabbed and the
|
||||
superblock must be locked. On failure it should return ERR_PTR(error).
|
||||
|
||||
The get_sb() method must determine if the block device specified
|
||||
in the dev_name and fs_type contains a filesystem of the type the method
|
||||
supports. If it succeeds in opening the named block device, it initializes a
|
||||
struct super_block descriptor for the filesystem contained by the block device.
|
||||
On failure it returns an error.
|
||||
The arguments match those of mount(2) and their interpretation
|
||||
depends on filesystem type. E.g. for block filesystems, dev_name is
|
||||
interpreted as block device name, that device is opened and if it
|
||||
contains a suitable filesystem image the method creates and initializes
|
||||
struct super_block accordingly, returning its root dentry to caller.
|
||||
|
||||
->mount() may choose to return a subtree of existing filesystem - it
|
||||
doesn't have to create a new one. The main result from the caller's
|
||||
point of view is a reference to dentry at the root of (sub)tree to
|
||||
be attached; creation of new superblock is a common side effect.
|
||||
|
||||
The most interesting member of the superblock structure that the
|
||||
get_sb() method fills in is the "s_op" field. This is a pointer to
|
||||
mount() method fills in is the "s_op" field. This is a pointer to
|
||||
a "struct super_operations" which describes the next level of the
|
||||
filesystem implementation.
|
||||
|
||||
Usually, a filesystem uses one of the generic get_sb() implementations
|
||||
and provides a fill_super() method instead. The generic methods are:
|
||||
Usually, a filesystem uses one of the generic mount() implementations
|
||||
and provides a fill_super() callback instead. The generic variants are:
|
||||
|
||||
get_sb_bdev: mount a filesystem residing on a block device
|
||||
mount_bdev: mount a filesystem residing on a block device
|
||||
|
||||
get_sb_nodev: mount a filesystem that is not backed by a device
|
||||
mount_nodev: mount a filesystem that is not backed by a device
|
||||
|
||||
get_sb_single: mount a filesystem which shares the instance between
|
||||
mount_single: mount a filesystem which shares the instance between
|
||||
all mounts
|
||||
|
||||
A fill_super() method implementation has the following arguments:
|
||||
A fill_super() callback implementation has the following arguments:
|
||||
|
||||
struct super_block *sb: the superblock structure. The method fill_super()
|
||||
struct super_block *sb: the superblock structure. The callback
|
||||
must initialize this properly.
|
||||
|
||||
void *data: arbitrary mount options, usually comes as an ASCII
|
||||
|
@ -2444,6 +2444,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
<deci-seconds>: poll all this frequency
|
||||
0: no polling (default)
|
||||
|
||||
threadirqs [KNL]
|
||||
Force threading of all interrupt handlers except those
|
||||
marked explicitely IRQF_NO_THREAD.
|
||||
|
||||
topology= [S390]
|
||||
Format: {off | on}
|
||||
Specify if the kernel should make use of the cpu
|
||||
|
@ -127,14 +127,15 @@ This is because process A's keyrings can't simply be attached to
|
||||
of them, and (b) it requires the same UID/GID/Groups all the way through.
|
||||
|
||||
|
||||
======================
|
||||
NEGATIVE INSTANTIATION
|
||||
======================
|
||||
====================================
|
||||
NEGATIVE INSTANTIATION AND REJECTION
|
||||
====================================
|
||||
|
||||
Rather than instantiating a key, it is possible for the possessor of an
|
||||
authorisation key to negatively instantiate a key that's under construction.
|
||||
This is a short duration placeholder that causes any attempt at re-requesting
|
||||
the key whilst it exists to fail with error ENOKEY.
|
||||
the key whilst it exists to fail with error ENOKEY if negated or the specified
|
||||
error if rejected.
|
||||
|
||||
This is provided to prevent excessive repeated spawning of /sbin/request-key
|
||||
processes for a key that will never be obtainable.
|
||||
|
@ -637,6 +637,9 @@ The keyctl syscall functions are:
|
||||
long keyctl(KEYCTL_INSTANTIATE, key_serial_t key,
|
||||
const void *payload, size_t plen,
|
||||
key_serial_t keyring);
|
||||
long keyctl(KEYCTL_INSTANTIATE_IOV, key_serial_t key,
|
||||
const struct iovec *payload_iov, unsigned ioc,
|
||||
key_serial_t keyring);
|
||||
|
||||
If the kernel calls back to userspace to complete the instantiation of a
|
||||
key, userspace should use this call to supply data for the key before the
|
||||
@ -652,11 +655,16 @@ The keyctl syscall functions are:
|
||||
|
||||
The payload and plen arguments describe the payload data as for add_key().
|
||||
|
||||
The payload_iov and ioc arguments describe the payload data in an iovec
|
||||
array instead of a single buffer.
|
||||
|
||||
|
||||
(*) Negatively instantiate a partially constructed key.
|
||||
|
||||
long keyctl(KEYCTL_NEGATE, key_serial_t key,
|
||||
unsigned timeout, key_serial_t keyring);
|
||||
long keyctl(KEYCTL_REJECT, key_serial_t key,
|
||||
unsigned timeout, unsigned error, key_serial_t keyring);
|
||||
|
||||
If the kernel calls back to userspace to complete the instantiation of a
|
||||
key, userspace should use this call mark the key as negative before the
|
||||
@ -669,6 +677,10 @@ The keyctl syscall functions are:
|
||||
that keyring, however all the constraints applying in KEYCTL_LINK apply in
|
||||
this case too.
|
||||
|
||||
If the key is rejected, future searches for it will return the specified
|
||||
error code until the rejected key expires. Negating the key is the same
|
||||
as rejecting the key with ENOKEY as the error code.
|
||||
|
||||
|
||||
(*) Set the default request-key destination keyring.
|
||||
|
||||
@ -1062,6 +1074,13 @@ The structure has a number of fields, some of which are mandatory:
|
||||
viable.
|
||||
|
||||
|
||||
(*) int (*vet_description)(const char *description);
|
||||
|
||||
This optional method is called to vet a key description. If the key type
|
||||
doesn't approve of the key description, it may return an error, otherwise
|
||||
it should return 0.
|
||||
|
||||
|
||||
(*) int (*instantiate)(struct key *key, const void *data, size_t datalen);
|
||||
|
||||
This method is called to attach a payload to a key during construction.
|
||||
@ -1231,10 +1250,11 @@ hand the request off to (perhaps a path held in placed in another key by, for
|
||||
example, the KDE desktop manager).
|
||||
|
||||
The program (or whatever it calls) should finish construction of the key by
|
||||
calling KEYCTL_INSTANTIATE, which also permits it to cache the key in one of
|
||||
the keyrings (probably the session ring) before returning. Alternatively, the
|
||||
key can be marked as negative with KEYCTL_NEGATE; this also permits the key to
|
||||
be cached in one of the keyrings.
|
||||
calling KEYCTL_INSTANTIATE or KEYCTL_INSTANTIATE_IOV, which also permits it to
|
||||
cache the key in one of the keyrings (probably the session ring) before
|
||||
returning. Alternatively, the key can be marked as negative with KEYCTL_NEGATE
|
||||
or KEYCTL_REJECT; this also permits the key to be cached in one of the
|
||||
keyrings.
|
||||
|
||||
If it returns with the key remaining in the unconstructed state, the key will
|
||||
be marked as being negative, it will be added to the session keyring, and an
|
||||
|
@ -156,7 +156,7 @@ static struct my_data *get_entry()
|
||||
struct my_data *entry = NULL;
|
||||
mutex_lock(&mutex);
|
||||
if (!list_empty(&q)) {
|
||||
entry = container_of(q.next, struct my_q_entry, link);
|
||||
entry = container_of(q.next, struct my_data, link);
|
||||
kref_get(&entry->refcount);
|
||||
}
|
||||
mutex_unlock(&mutex);
|
||||
|
@ -21,6 +21,7 @@ Contents:
|
||||
- SMP barrier pairing.
|
||||
- Examples of memory barrier sequences.
|
||||
- Read memory barriers vs load speculation.
|
||||
- Transitivity
|
||||
|
||||
(*) Explicit kernel barriers.
|
||||
|
||||
@ -959,6 +960,63 @@ the speculation will be cancelled and the value reloaded:
|
||||
retrieved : : +-------+
|
||||
|
||||
|
||||
TRANSITIVITY
|
||||
------------
|
||||
|
||||
Transitivity is a deeply intuitive notion about ordering that is not
|
||||
always provided by real computer systems. The following example
|
||||
demonstrates transitivity (also called "cumulativity"):
|
||||
|
||||
CPU 1 CPU 2 CPU 3
|
||||
======================= ======================= =======================
|
||||
{ X = 0, Y = 0 }
|
||||
STORE X=1 LOAD X STORE Y=1
|
||||
<general barrier> <general barrier>
|
||||
LOAD Y LOAD X
|
||||
|
||||
Suppose that CPU 2's load from X returns 1 and its load from Y returns 0.
|
||||
This indicates that CPU 2's load from X in some sense follows CPU 1's
|
||||
store to X and that CPU 2's load from Y in some sense preceded CPU 3's
|
||||
store to Y. The question is then "Can CPU 3's load from X return 0?"
|
||||
|
||||
Because CPU 2's load from X in some sense came after CPU 1's store, it
|
||||
is natural to expect that CPU 3's load from X must therefore return 1.
|
||||
This expectation is an example of transitivity: if a load executing on
|
||||
CPU A follows a load from the same variable executing on CPU B, then
|
||||
CPU A's load must either return the same value that CPU B's load did,
|
||||
or must return some later value.
|
||||
|
||||
In the Linux kernel, use of general memory barriers guarantees
|
||||
transitivity. Therefore, in the above example, if CPU 2's load from X
|
||||
returns 1 and its load from Y returns 0, then CPU 3's load from X must
|
||||
also return 1.
|
||||
|
||||
However, transitivity is -not- guaranteed for read or write barriers.
|
||||
For example, suppose that CPU 2's general barrier in the above example
|
||||
is changed to a read barrier as shown below:
|
||||
|
||||
CPU 1 CPU 2 CPU 3
|
||||
======================= ======================= =======================
|
||||
{ X = 0, Y = 0 }
|
||||
STORE X=1 LOAD X STORE Y=1
|
||||
<read barrier> <general barrier>
|
||||
LOAD Y LOAD X
|
||||
|
||||
This substitution destroys transitivity: in this example, it is perfectly
|
||||
legal for CPU 2's load from X to return 1, its load from Y to return 0,
|
||||
and CPU 3's load from X to return 0.
|
||||
|
||||
The key point is that although CPU 2's read barrier orders its pair
|
||||
of loads, it does not guarantee to order CPU 1's store. Therefore, if
|
||||
this example runs on a system where CPUs 1 and 2 share a store buffer
|
||||
or a level of cache, CPU 2 might have early access to CPU 1's writes.
|
||||
General barriers are therefore required to ensure that all CPUs agree
|
||||
on the combined order of CPU 1's and CPU 2's accesses.
|
||||
|
||||
To reiterate, if your code requires transitivity, use general barriers
|
||||
throughout.
|
||||
|
||||
|
||||
========================
|
||||
EXPLICIT KERNEL BARRIERS
|
||||
========================
|
||||
|
@ -126,36 +126,51 @@ config options.
|
||||
--------------------------------
|
||||
4 sysfs files for memory hotplug
|
||||
--------------------------------
|
||||
All sections have their device information under /sys/devices/system/memory as
|
||||
All sections have their device information in sysfs. Each section is part of
|
||||
a memory block under /sys/devices/system/memory as
|
||||
|
||||
/sys/devices/system/memory/memoryXXX
|
||||
(XXX is section id.)
|
||||
(XXX is the section id.)
|
||||
|
||||
Now, XXX is defined as start_address_of_section / section_size.
|
||||
Now, XXX is defined as (start_address_of_section / section_size) of the first
|
||||
section contained in the memory block. The files 'phys_index' and
|
||||
'end_phys_index' under each directory report the beginning and end section id's
|
||||
for the memory block covered by the sysfs directory. It is expected that all
|
||||
memory sections in this range are present and no memory holes exist in the
|
||||
range. Currently there is no way to determine if there is a memory hole, but
|
||||
the existence of one should not affect the hotplug capabilities of the memory
|
||||
block.
|
||||
|
||||
For example, assume 1GiB section size. A device for a memory starting at
|
||||
0x100000000 is /sys/device/system/memory/memory4
|
||||
(0x100000000 / 1Gib = 4)
|
||||
This device covers address range [0x100000000 ... 0x140000000)
|
||||
|
||||
Under each section, you can see 4 files.
|
||||
Under each section, you can see 4 or 5 files, the end_phys_index file being
|
||||
a recent addition and not present on older kernels.
|
||||
|
||||
/sys/devices/system/memory/memoryXXX/phys_index
|
||||
/sys/devices/system/memory/memoryXXX/start_phys_index
|
||||
/sys/devices/system/memory/memoryXXX/end_phys_index
|
||||
/sys/devices/system/memory/memoryXXX/phys_device
|
||||
/sys/devices/system/memory/memoryXXX/state
|
||||
/sys/devices/system/memory/memoryXXX/removable
|
||||
|
||||
'phys_index' : read-only and contains section id, same as XXX.
|
||||
'state' : read-write
|
||||
at read: contains online/offline state of memory.
|
||||
at write: user can specify "online", "offline" command
|
||||
'phys_device': read-only: designed to show the name of physical memory device.
|
||||
This is not well implemented now.
|
||||
'removable' : read-only: contains an integer value indicating
|
||||
whether the memory section is removable or not
|
||||
removable. A value of 1 indicates that the memory
|
||||
section is removable and a value of 0 indicates that
|
||||
it is not removable.
|
||||
'phys_index' : read-only and contains section id of the first section
|
||||
in the memory block, same as XXX.
|
||||
'end_phys_index' : read-only and contains section id of the last section
|
||||
in the memory block.
|
||||
'state' : read-write
|
||||
at read: contains online/offline state of memory.
|
||||
at write: user can specify "online", "offline" command
|
||||
which will be performed on al sections in the block.
|
||||
'phys_device' : read-only: designed to show the name of physical memory
|
||||
device. This is not well implemented now.
|
||||
'removable' : read-only: contains an integer value indicating
|
||||
whether the memory block is removable or not
|
||||
removable. A value of 1 indicates that the memory
|
||||
block is removable and a value of 0 indicates that
|
||||
it is not removable. A memory block is removable only if
|
||||
every section in the block is removable.
|
||||
|
||||
NOTE:
|
||||
These directories/files appear after physical memory hotplug phase.
|
||||
|
@ -1,4 +1,4 @@
|
||||
[state: 21-11-2010]
|
||||
[state: 27-01-2011]
|
||||
|
||||
BATMAN-ADV
|
||||
----------
|
||||
@ -67,15 +67,16 @@ All mesh wide settings can be found in batman's own interface
|
||||
folder:
|
||||
|
||||
# ls /sys/class/net/bat0/mesh/
|
||||
# aggregated_ogms bonding fragmentation orig_interval
|
||||
# vis_mode
|
||||
# aggregated_ogms gw_bandwidth hop_penalty
|
||||
# bonding gw_mode orig_interval
|
||||
# fragmentation gw_sel_class vis_mode
|
||||
|
||||
|
||||
There is a special folder for debugging informations:
|
||||
|
||||
# ls /sys/kernel/debug/batman_adv/bat0/
|
||||
# originators socket transtable_global transtable_local
|
||||
# vis_data
|
||||
# gateways socket transtable_global vis_data
|
||||
# originators softif_neigh transtable_local
|
||||
|
||||
|
||||
Some of the files contain all sort of status information regard-
|
||||
@ -230,9 +231,8 @@ CONTACT
|
||||
Please send us comments, experiences, questions, anything :)
|
||||
|
||||
IRC: #batman on irc.freenode.org
|
||||
Mailing-list: b.a.t.m.a.n@b.a.t.m.a.n@lists.open-mesh.org
|
||||
(optional subscription at
|
||||
https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n)
|
||||
Mailing-list: b.a.t.m.a.n@open-mesh.org (optional subscription
|
||||
at https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n)
|
||||
|
||||
You can also contact the Authors:
|
||||
|
||||
|
@ -2558,18 +2558,15 @@ enslaved.
|
||||
16. Resources and Links
|
||||
=======================
|
||||
|
||||
The latest version of the bonding driver can be found in the latest
|
||||
The latest version of the bonding driver can be found in the latest
|
||||
version of the linux kernel, found on http://kernel.org
|
||||
|
||||
The latest version of this document can be found in either the latest
|
||||
kernel source (named Documentation/networking/bonding.txt), or on the
|
||||
bonding sourceforge site:
|
||||
The latest version of this document can be found in the latest kernel
|
||||
source (named Documentation/networking/bonding.txt).
|
||||
|
||||
http://www.sourceforge.net/projects/bonding
|
||||
|
||||
Discussions regarding the bonding driver take place primarily on the
|
||||
bonding-devel mailing list, hosted at sourceforge.net. If you have
|
||||
questions or problems, post them to the list. The list address is:
|
||||
Discussions regarding the usage of the bonding driver take place on the
|
||||
bonding-devel mailing list, hosted at sourceforge.net. If you have questions or
|
||||
problems, post them to the list. The list address is:
|
||||
|
||||
bonding-devel@lists.sourceforge.net
|
||||
|
||||
@ -2578,6 +2575,17 @@ be found at:
|
||||
|
||||
https://lists.sourceforge.net/lists/listinfo/bonding-devel
|
||||
|
||||
Discussions regarding the developpement of the bonding driver take place
|
||||
on the main Linux network mailing list, hosted at vger.kernel.org. The list
|
||||
address is:
|
||||
|
||||
netdev@vger.kernel.org
|
||||
|
||||
The administrative interface (to subscribe or unsubscribe) can
|
||||
be found at:
|
||||
|
||||
http://vger.kernel.org/vger-lists.html#netdev
|
||||
|
||||
Donald Becker's Ethernet Drivers and diag programs may be found at :
|
||||
- http://web.archive.org/web/*/http://www.scyld.com/network/
|
||||
|
||||
|
@ -280,6 +280,17 @@ tcp_max_orphans - INTEGER
|
||||
more aggressively. Let me to remind again: each orphan eats
|
||||
up to ~64K of unswappable memory.
|
||||
|
||||
tcp_max_ssthresh - INTEGER
|
||||
Limited Slow-Start for TCP with large congestion windows (cwnd) defined in
|
||||
RFC3742. Limited slow-start is a mechanism to limit growth of the cwnd
|
||||
on the region where cwnd is larger than tcp_max_ssthresh. TCP increases cwnd
|
||||
by at most tcp_max_ssthresh segments, and by at least tcp_max_ssthresh/2
|
||||
segments per RTT when the cwnd is above tcp_max_ssthresh.
|
||||
If TCP connection increased cwnd to thousands (or tens of thousands) segments,
|
||||
and thousands of packets were being dropped during slow-start, you can set
|
||||
tcp_max_ssthresh to improve performance for new TCP connection.
|
||||
Default: 0 (off)
|
||||
|
||||
tcp_max_syn_backlog - INTEGER
|
||||
Maximal number of remembered connection requests, which are
|
||||
still did not receive an acknowledgment from connecting client.
|
||||
|
@ -154,9 +154,28 @@ connections, one per accept()'d socket.
|
||||
write(cfd, msg, msglen);
|
||||
}
|
||||
|
||||
Connections are established between two endpoints by a "third party"
|
||||
application. This means that both endpoints are passive; so connect()
|
||||
is not possible.
|
||||
Connections are traditionally established between two endpoints by a
|
||||
"third party" application. This means that both endpoints are passive.
|
||||
|
||||
|
||||
As of Linux kernel version 2.6.39, it is also possible to connect
|
||||
two endpoints directly, using connect() on the active side. This is
|
||||
intended to support the newer Nokia Wireless Modem API, as found in
|
||||
e.g. the Nokia Slim Modem in the ST-Ericsson U8500 platform:
|
||||
|
||||
struct sockaddr_spn spn;
|
||||
int fd;
|
||||
|
||||
fd = socket(PF_PHONET, SOCK_SEQPACKET, PN_PROTO_PIPE);
|
||||
memset(&spn, 0, sizeof(spn));
|
||||
spn.spn_family = AF_PHONET;
|
||||
spn.spn_obj = ...;
|
||||
spn.spn_dev = ...;
|
||||
spn.spn_resource = 0xD9;
|
||||
connect(fd, (struct sockaddr *)&spn, sizeof(spn));
|
||||
/* normal I/O here ... */
|
||||
close(fd);
|
||||
|
||||
|
||||
WARNING:
|
||||
When polling a connected pipe socket for writability, there is an
|
||||
@ -181,45 +200,9 @@ The pipe protocol provides two socket options at the SOL_PNPIPE level:
|
||||
interface index of the network interface created by PNPIPE_ENCAP,
|
||||
or zero if encapsulation is off.
|
||||
|
||||
|
||||
Phonet Pipe-controller Implementation
|
||||
-------------------------------------
|
||||
|
||||
Phonet Pipe-controller is enabled by selecting the CONFIG_PHONET_PIPECTRLR Kconfig
|
||||
option. It is useful when communicating with those Nokia Modems which do not
|
||||
implement Pipe controller in them e.g. Nokia Slim Modem used in ST-Ericsson
|
||||
U8500 platform.
|
||||
|
||||
The implementation is based on the Data Connection Establishment Sequence
|
||||
depicted in 'Nokia Wireless Modem API - Wireless_modem_user_guide.pdf'
|
||||
document.
|
||||
|
||||
It allows a phonet sequenced socket (host-pep) to initiate a Pipe connection
|
||||
between itself and a remote pipe-end point (e.g. modem).
|
||||
|
||||
The implementation adds socket options at SOL_PNPIPE level:
|
||||
|
||||
PNPIPE_PIPE_HANDLE
|
||||
It accepts an integer argument for setting value of pipe handle.
|
||||
|
||||
PNPIPE_ENABLE accepts one integer value (int). If set to zero, the pipe
|
||||
is disabled. If the value is non-zero, the pipe is enabled. If the pipe
|
||||
is not (yet) connected, ENOTCONN is error is returned.
|
||||
|
||||
The implementation also adds socket 'connect'. On calling the 'connect', pipe
|
||||
will be created between the source socket and the destination, and the pipe
|
||||
state will be set to PIPE_DISABLED.
|
||||
|
||||
After a pipe has been created and enabled successfully, the Pipe data can be
|
||||
exchanged between the host-pep and remote-pep (modem).
|
||||
|
||||
User-space would typically follow below sequence with Pipe controller:-
|
||||
-socket
|
||||
-bind
|
||||
-setsockopt for PNPIPE_PIPE_HANDLE
|
||||
-connect
|
||||
-setsockopt for PNPIPE_ENCAP_IP
|
||||
-setsockopt for PNPIPE_ENABLE
|
||||
PNPIPE_HANDLE is a read-only integer value. It contains the underlying
|
||||
identifier ("pipe handle") of the pipe. This is only defined for
|
||||
socket descriptors that are already connected or being connected.
|
||||
|
||||
|
||||
Authors
|
||||
|
@ -1,6 +1,6 @@
|
||||
Device Power Management
|
||||
|
||||
Copyright (c) 2010 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
|
||||
Copyright (c) 2010-2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
|
||||
Copyright (c) 2010 Alan Stern <stern@rowland.harvard.edu>
|
||||
|
||||
|
||||
@ -159,18 +159,18 @@ matter, and the kernel is responsible for keeping track of it. By contrast,
|
||||
whether or not a wakeup-capable device should issue wakeup events is a policy
|
||||
decision, and it is managed by user space through a sysfs attribute: the
|
||||
power/wakeup file. User space can write the strings "enabled" or "disabled" to
|
||||
set or clear the should_wakeup flag, respectively. Reads from the file will
|
||||
return the corresponding string if can_wakeup is true, but if can_wakeup is
|
||||
false then reads will return an empty string, to indicate that the device
|
||||
doesn't support wakeup events. (But even though the file appears empty, writes
|
||||
will still affect the should_wakeup flag.)
|
||||
set or clear the "should_wakeup" flag, respectively. This file is only present
|
||||
for wakeup-capable devices (i.e. devices whose "can_wakeup" flags are set)
|
||||
and is created (or removed) by device_set_wakeup_capable(). Reads from the
|
||||
file will return the corresponding string.
|
||||
|
||||
The device_may_wakeup() routine returns true only if both flags are set.
|
||||
Drivers should check this routine when putting devices in a low-power state
|
||||
during a system sleep transition, to see whether or not to enable the devices'
|
||||
wakeup mechanisms. However for runtime power management, wakeup events should
|
||||
be enabled whenever the device and driver both support them, regardless of the
|
||||
should_wakeup flag.
|
||||
This information is used by subsystems, like the PCI bus type code, to see
|
||||
whether or not to enable the devices' wakeup mechanisms. If device wakeup
|
||||
mechanisms are enabled or disabled directly by drivers, they also should use
|
||||
device_may_wakeup() to decide what to do during a system sleep transition.
|
||||
However for runtime power management, wakeup events should be enabled whenever
|
||||
the device and driver both support them, regardless of the should_wakeup flag.
|
||||
|
||||
|
||||
/sys/devices/.../power/control files
|
||||
@ -249,23 +249,18 @@ various phases always run after tasks have been frozen and before they are
|
||||
unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have
|
||||
been disabled (except for those marked with the IRQ_WAKEUP flag).
|
||||
|
||||
Most phases use bus, type, and class callbacks (that is, methods defined in
|
||||
dev->bus->pm, dev->type->pm, and dev->class->pm). The prepare and complete
|
||||
phases are exceptions; they use only bus callbacks. When multiple callbacks
|
||||
are used in a phase, they are invoked in the order: <class, type, bus> during
|
||||
power-down transitions and in the opposite order during power-up transitions.
|
||||
For example, during the suspend phase the PM core invokes
|
||||
|
||||
dev->class->pm.suspend(dev);
|
||||
dev->type->pm.suspend(dev);
|
||||
dev->bus->pm.suspend(dev);
|
||||
|
||||
before moving on to the next device, whereas during the resume phase the core
|
||||
invokes
|
||||
|
||||
dev->bus->pm.resume(dev);
|
||||
dev->type->pm.resume(dev);
|
||||
dev->class->pm.resume(dev);
|
||||
All phases use bus, type, or class callbacks (that is, methods defined in
|
||||
dev->bus->pm, dev->type->pm, or dev->class->pm). These callbacks are mutually
|
||||
exclusive, so if the device type provides a struct dev_pm_ops object pointed to
|
||||
by its pm field (i.e. both dev->type and dev->type->pm are defined), the
|
||||
callbacks included in that object (i.e. dev->type->pm) will be used. Otherwise,
|
||||
if the class provides a struct dev_pm_ops object pointed to by its pm field
|
||||
(i.e. both dev->class and dev->class->pm are defined), the PM core will use the
|
||||
callbacks from that object (i.e. dev->class->pm). Finally, if the pm fields of
|
||||
both the device type and class objects are NULL (or those objects do not exist),
|
||||
the callbacks provided by the bus (that is, the callbacks from dev->bus->pm)
|
||||
will be used (this allows device types to override callbacks provided by bus
|
||||
types or classes if necessary).
|
||||
|
||||
These callbacks may in turn invoke device- or driver-specific methods stored in
|
||||
dev->driver->pm, but they don't have to.
|
||||
@ -507,6 +502,49 @@ routines. Nevertheless, different callback pointers are used in case there is a
|
||||
situation where it actually matters.
|
||||
|
||||
|
||||
Device Power Domains
|
||||
--------------------
|
||||
Sometimes devices share reference clocks or other power resources. In those
|
||||
cases it generally is not possible to put devices into low-power states
|
||||
individually. Instead, a set of devices sharing a power resource can be put
|
||||
into a low-power state together at the same time by turning off the shared
|
||||
power resource. Of course, they also need to be put into the full-power state
|
||||
together, by turning the shared power resource on. A set of devices with this
|
||||
property is often referred to as a power domain.
|
||||
|
||||
Support for power domains is provided through the pwr_domain field of struct
|
||||
device. This field is a pointer to an object of type struct dev_power_domain,
|
||||
defined in include/linux/pm.h, providing a set of power management callbacks
|
||||
analogous to the subsystem-level and device driver callbacks that are executed
|
||||
for the given device during all power transitions, in addition to the respective
|
||||
subsystem-level callbacks. Specifically, the power domain "suspend" callbacks
|
||||
(i.e. ->runtime_suspend(), ->suspend(), ->freeze(), ->poweroff(), etc.) are
|
||||
executed after the analogous subsystem-level callbacks, while the power domain
|
||||
"resume" callbacks (i.e. ->runtime_resume(), ->resume(), ->thaw(), ->restore,
|
||||
etc.) are executed before the analogous subsystem-level callbacks. Error codes
|
||||
returned by the "suspend" and "resume" power domain callbacks are ignored.
|
||||
|
||||
Power domain ->runtime_idle() callback is executed before the subsystem-level
|
||||
->runtime_idle() callback and the result returned by it is not ignored. Namely,
|
||||
if it returns error code, the subsystem-level ->runtime_idle() callback will not
|
||||
be called and the helper function rpm_idle() executing it will return error
|
||||
code. This mechanism is intended to help platforms where saving device state
|
||||
is a time consuming operation and should only be carried out if all devices
|
||||
in the power domain are idle, before turning off the shared power resource(s).
|
||||
Namely, the power domain ->runtime_idle() callback may return error code until
|
||||
the pm_runtime_idle() helper (or its asychronous version) has been called for
|
||||
all devices in the power domain (it is recommended that the returned error code
|
||||
be -EBUSY in those cases), preventing the subsystem-level ->runtime_idle()
|
||||
callback from being run prematurely.
|
||||
|
||||
The support for device power domains is only relevant to platforms needing to
|
||||
use the same subsystem-level (e.g. platform bus type) and device driver power
|
||||
management callbacks in many different power domain configurations and wanting
|
||||
to avoid incorporating the support for power domains into the subsystem-level
|
||||
callbacks. The other platforms need not implement it or take it into account
|
||||
in any way.
|
||||
|
||||
|
||||
System Devices
|
||||
--------------
|
||||
System devices (sysdevs) follow a slightly different API, which can be found in
|
||||
|
@ -1,6 +1,6 @@
|
||||
Run-time Power Management Framework for I/O Devices
|
||||
|
||||
(C) 2009 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
|
||||
(C) 2009-2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
|
||||
(C) 2010 Alan Stern <stern@rowland.harvard.edu>
|
||||
|
||||
1. Introduction
|
||||
@ -44,11 +44,12 @@ struct dev_pm_ops {
|
||||
};
|
||||
|
||||
The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks are
|
||||
executed by the PM core for either the bus type, or device type (if the bus
|
||||
type's callback is not defined), or device class (if the bus type's and device
|
||||
type's callbacks are not defined) of given device. The bus type, device type
|
||||
and device class callbacks are referred to as subsystem-level callbacks in what
|
||||
follows.
|
||||
executed by the PM core for either the device type, or the class (if the device
|
||||
type's struct dev_pm_ops object does not exist), or the bus type (if the
|
||||
device type's and class' struct dev_pm_ops objects do not exist) of the given
|
||||
device (this allows device types to override callbacks provided by bus types or
|
||||
classes if necessary). The bus type, device type and class callbacks are
|
||||
referred to as subsystem-level callbacks in what follows.
|
||||
|
||||
By default, the callbacks are always invoked in process context with interrupts
|
||||
enabled. However, subsystems can use the pm_runtime_irq_safe() helper function
|
||||
|
@ -62,12 +62,12 @@ setup via another operating system for it to use. Despite the
|
||||
inconvenience, this method requires minimal work by the kernel, since
|
||||
the firmware will also handle restoring memory contents on resume.
|
||||
|
||||
For suspend-to-disk, a mechanism called swsusp called 'swsusp' (Swap
|
||||
Suspend) is used to write memory contents to free swap space.
|
||||
swsusp has some restrictive requirements, but should work in most
|
||||
cases. Some, albeit outdated, documentation can be found in
|
||||
Documentation/power/swsusp.txt. Alternatively, userspace can do most
|
||||
of the actual suspend to disk work, see userland-swsusp.txt.
|
||||
For suspend-to-disk, a mechanism called 'swsusp' (Swap Suspend) is used
|
||||
to write memory contents to free swap space. swsusp has some restrictive
|
||||
requirements, but should work in most cases. Some, albeit outdated,
|
||||
documentation can be found in Documentation/power/swsusp.txt.
|
||||
Alternatively, userspace can do most of the actual suspend to disk work,
|
||||
see userland-swsusp.txt.
|
||||
|
||||
Once memory state is written to disk, the system may either enter a
|
||||
low-power state (like ACPI S4), or it may simply power down. Powering
|
||||
|
@ -5,8 +5,6 @@ please mail me.
|
||||
|
||||
00-INDEX
|
||||
- this file
|
||||
booting-without-of.txt
|
||||
- Booting the Linux/ppc kernel without Open Firmware
|
||||
cpu_features.txt
|
||||
- info on how we support a variety of CPUs with minimal compile-time
|
||||
options.
|
||||
@ -16,8 +14,6 @@ hvcs.txt
|
||||
- IBM "Hypervisor Virtual Console Server" Installation Guide
|
||||
mpc52xx.txt
|
||||
- Linux 2.6.x on MPC52xx family
|
||||
mpc52xx-device-tree-bindings.txt
|
||||
- MPC5200 Device Tree Bindings
|
||||
sound.txt
|
||||
- info on sound support under Linux/PPC
|
||||
zImage_layout.txt
|
||||
|
@ -178,38 +178,29 @@ RTC class framework, but can't be supported by the older driver.
|
||||
setting the longer alarm time and enabling its IRQ using a single
|
||||
request (using the same model as EFI firmware).
|
||||
|
||||
* RTC_UIE_ON, RTC_UIE_OFF ... if the RTC offers IRQs, it probably
|
||||
also offers update IRQs whenever the "seconds" counter changes.
|
||||
If needed, the RTC framework can emulate this mechanism.
|
||||
* RTC_UIE_ON, RTC_UIE_OFF ... if the RTC offers IRQs, the RTC framework
|
||||
will emulate this mechanism.
|
||||
|
||||
* RTC_PIE_ON, RTC_PIE_OFF, RTC_IRQP_SET, RTC_IRQP_READ ... another
|
||||
feature often accessible with an IRQ line is a periodic IRQ, issued
|
||||
at settable frequencies (usually 2^N Hz).
|
||||
* RTC_PIE_ON, RTC_PIE_OFF, RTC_IRQP_SET, RTC_IRQP_READ ... these icotls
|
||||
are emulated via a kernel hrtimer.
|
||||
|
||||
In many cases, the RTC alarm can be a system wake event, used to force
|
||||
Linux out of a low power sleep state (or hibernation) back to a fully
|
||||
operational state. For example, a system could enter a deep power saving
|
||||
state until it's time to execute some scheduled tasks.
|
||||
|
||||
Note that many of these ioctls need not actually be implemented by your
|
||||
driver. The common rtc-dev interface handles many of these nicely if your
|
||||
driver returns ENOIOCTLCMD. Some common examples:
|
||||
Note that many of these ioctls are handled by the common rtc-dev interface.
|
||||
Some common examples:
|
||||
|
||||
* RTC_RD_TIME, RTC_SET_TIME: the read_time/set_time functions will be
|
||||
called with appropriate values.
|
||||
|
||||
* RTC_ALM_SET, RTC_ALM_READ, RTC_WKALM_SET, RTC_WKALM_RD: the
|
||||
set_alarm/read_alarm functions will be called.
|
||||
* RTC_ALM_SET, RTC_ALM_READ, RTC_WKALM_SET, RTC_WKALM_RD: gets or sets
|
||||
the alarm rtc_timer. May call the set_alarm driver function.
|
||||
|
||||
* RTC_IRQP_SET, RTC_IRQP_READ: the irq_set_freq function will be called
|
||||
to set the frequency while the framework will handle the read for you
|
||||
since the frequency is stored in the irq_freq member of the rtc_device
|
||||
structure. Your driver needs to initialize the irq_freq member during
|
||||
init. Make sure you check the requested frequency is in range of your
|
||||
hardware in the irq_set_freq function. If it isn't, return -EINVAL. If
|
||||
you cannot actually change the frequency, do not define irq_set_freq.
|
||||
* RTC_IRQP_SET, RTC_IRQP_READ: These are emulated by the generic code.
|
||||
|
||||
* RTC_PIE_ON, RTC_PIE_OFF: the irq_set_state function will be called.
|
||||
* RTC_PIE_ON, RTC_PIE_OFF: These are also emulated by the generic code.
|
||||
|
||||
If all else fails, check out the rtc-test.c driver!
|
||||
|
||||
|
89
Documentation/serial/n_gsm.txt
Normal file
89
Documentation/serial/n_gsm.txt
Normal file
@ -0,0 +1,89 @@
|
||||
n_gsm.c GSM 0710 tty multiplexor HOWTO
|
||||
===================================================
|
||||
|
||||
This line discipline implements the GSM 07.10 multiplexing protocol
|
||||
detailed in the following 3GPP document :
|
||||
http://www.3gpp.org/ftp/Specs/archive/07_series/07.10/0710-720.zip
|
||||
|
||||
This document give some hints on how to use this driver with GPRS and 3G
|
||||
modems connected to a physical serial port.
|
||||
|
||||
How to use it
|
||||
-------------
|
||||
1- initialize the modem in 0710 mux mode (usually AT+CMUX= command) through
|
||||
its serial port. Depending on the modem used, you can pass more or less
|
||||
parameters to this command,
|
||||
2- switch the serial line to using the n_gsm line discipline by using
|
||||
TIOCSETD ioctl,
|
||||
3- configure the mux using GSMIOC_GETCONF / GSMIOC_SETCONF ioctl,
|
||||
|
||||
Major parts of the initialization program :
|
||||
(a good starting point is util-linux-ng/sys-utils/ldattach.c)
|
||||
#include <linux/gsmmux.h>
|
||||
#define N_GSM0710 21 /* GSM 0710 Mux */
|
||||
#define DEFAULT_SPEED B115200
|
||||
#define SERIAL_PORT /dev/ttyS0
|
||||
|
||||
int ldisc = N_GSM0710;
|
||||
struct gsm_config c;
|
||||
struct termios configuration;
|
||||
|
||||
/* open the serial port connected to the modem */
|
||||
fd = open(SERIAL_PORT, O_RDWR | O_NOCTTY | O_NDELAY);
|
||||
|
||||
/* configure the serial port : speed, flow control ... */
|
||||
|
||||
/* send the AT commands to switch the modem to CMUX mode
|
||||
and check that it's succesful (should return OK) */
|
||||
write(fd, "AT+CMUX=0\r", 10);
|
||||
|
||||
/* experience showed that some modems need some time before
|
||||
being able to answer to the first MUX packet so a delay
|
||||
may be needed here in some case */
|
||||
sleep(3);
|
||||
|
||||
/* use n_gsm line discipline */
|
||||
ioctl(fd, TIOCSETD, &ldisc);
|
||||
|
||||
/* get n_gsm configuration */
|
||||
ioctl(fd, GSMIOC_GETCONF, &c);
|
||||
/* we are initiator and need encoding 0 (basic) */
|
||||
c.initiator = 1;
|
||||
c.encapsulation = 0;
|
||||
/* our modem defaults to a maximum size of 127 bytes */
|
||||
c.mru = 127;
|
||||
c.mtu = 127;
|
||||
/* set the new configuration */
|
||||
ioctl(fd, GSMIOC_SETCONF, &c);
|
||||
|
||||
/* and wait for ever to keep the line discipline enabled */
|
||||
daemon(0,0);
|
||||
pause();
|
||||
|
||||
4- create the devices corresponding to the "virtual" serial ports (take care,
|
||||
each modem has its configuration and some DLC have dedicated functions,
|
||||
for example GPS), starting with minor 1 (DLC0 is reserved for the management
|
||||
of the mux)
|
||||
|
||||
MAJOR=`cat /proc/devices |grep gsmtty | awk '{print $1}`
|
||||
for i in `seq 1 4`; do
|
||||
mknod /dev/ttygsm$i c $MAJOR $i
|
||||
done
|
||||
|
||||
5- use these devices as plain serial ports.
|
||||
for example, it's possible :
|
||||
- and to use gnokii to send / receive SMS on ttygsm1
|
||||
- to use ppp to establish a datalink on ttygsm2
|
||||
|
||||
6- first close all virtual ports before closing the physical port.
|
||||
|
||||
Additional Documentation
|
||||
------------------------
|
||||
More practical details on the protocol and how it's supported by industrial
|
||||
modems can be found in the following documents :
|
||||
http://www.telit.com/module/infopool/download.php?id=616
|
||||
http://www.u-blox.com/images/downloads/Product_Docs/LEON-G100-G200-MuxImplementation_ApplicationNote_%28GSM%20G1-CS-10002%29.pdf
|
||||
http://www.sierrawireless.com/Support/Downloads/AirPrime/WMP_Series/~/media/Support_Downloads/AirPrime/Application_notes/CMUX_Feature_Application_Note-Rev004.ashx
|
||||
http://wm.sim.com/sim/News/photo/2010721161442.pdf
|
||||
|
||||
11-03-08 - Eric Bénard - <eric@eukrea.com>
|
@ -86,7 +86,7 @@ to change the variables it has to get an exclusive write lock.
|
||||
|
||||
The routines look the same as above:
|
||||
|
||||
rwlock_t xxx_lock = RW_LOCK_UNLOCKED;
|
||||
rwlock_t xxx_lock = __RW_LOCK_UNLOCKED(xxx_lock);
|
||||
|
||||
unsigned long flags;
|
||||
|
||||
@ -196,25 +196,3 @@ appropriate:
|
||||
|
||||
For static initialization, use DEFINE_SPINLOCK() / DEFINE_RWLOCK() or
|
||||
__SPIN_LOCK_UNLOCKED() / __RW_LOCK_UNLOCKED() as appropriate.
|
||||
|
||||
SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED are deprecated. These interfere
|
||||
with lockdep state tracking.
|
||||
|
||||
Most of the time, you can simply turn:
|
||||
static spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED;
|
||||
into:
|
||||
static DEFINE_SPINLOCK(xxx_lock);
|
||||
|
||||
Static structure member variables go from:
|
||||
|
||||
struct foo bar {
|
||||
.lock = SPIN_LOCK_UNLOCKED;
|
||||
};
|
||||
|
||||
to:
|
||||
|
||||
struct foo bar {
|
||||
.lock = __SPIN_LOCK_UNLOCKED(bar.lock);
|
||||
};
|
||||
|
||||
Declaration of static rw_locks undergo a similar transformation.
|
||||
|
@ -88,20 +88,19 @@ you might want to raise the limit.
|
||||
|
||||
file-max & file-nr:
|
||||
|
||||
The kernel allocates file handles dynamically, but as yet it
|
||||
doesn't free them again.
|
||||
|
||||
The value in file-max denotes the maximum number of file-
|
||||
handles that the Linux kernel will allocate. When you get lots
|
||||
of error messages about running out of file handles, you might
|
||||
want to increase this limit.
|
||||
|
||||
Historically, the three values in file-nr denoted the number of
|
||||
allocated file handles, the number of allocated but unused file
|
||||
handles, and the maximum number of file handles. Linux 2.6 always
|
||||
reports 0 as the number of free file handles -- this is not an
|
||||
error, it just means that the number of allocated file handles
|
||||
exactly matches the number of used file handles.
|
||||
Historically,the kernel was able to allocate file handles
|
||||
dynamically, but not to free them again. The three values in
|
||||
file-nr denote the number of allocated file handles, the number
|
||||
of allocated but unused file handles, and the maximum number of
|
||||
file handles. Linux 2.6 always reports 0 as the number of free
|
||||
file handles -- this is not an error, it just means that the
|
||||
number of allocated file handles exactly matches the number of
|
||||
used file handles.
|
||||
|
||||
Attempts to allocate more file descriptors than file-max are
|
||||
reported with printk, look for "VFS: file-max limit <number>
|
||||
|
@ -247,6 +247,13 @@ You need very few things to get the syscalls tracing in an arch.
|
||||
- Support the TIF_SYSCALL_TRACEPOINT thread flags.
|
||||
- Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace
|
||||
in the ptrace syscalls tracing path.
|
||||
- If the system call table on this arch is more complicated than a simple array
|
||||
of addresses of the system calls, implement an arch_syscall_addr to return
|
||||
the address of a given system call.
|
||||
- If the symbol names of the system calls do not match the function names on
|
||||
this arch, define ARCH_HAS_SYSCALL_MATCH_SYM_NAME in asm/ftrace.h and
|
||||
implement arch_syscall_match_sym_name with the appropriate logic to return
|
||||
true if the function name corresponds with the symbol name.
|
||||
- Tag this arch as HAVE_SYSCALL_TRACEPOINTS.
|
||||
|
||||
|
||||
|
@ -80,11 +80,11 @@ of ftrace. Here is a list of some of the key files:
|
||||
tracers listed here can be configured by
|
||||
echoing their name into current_tracer.
|
||||
|
||||
tracing_enabled:
|
||||
tracing_on:
|
||||
|
||||
This sets or displays whether the current_tracer
|
||||
is activated and tracing or not. Echo 0 into this
|
||||
file to disable the tracer or 1 to enable it.
|
||||
This sets or displays whether writing to the trace
|
||||
ring buffer is enabled. Echo 0 into this file to disable
|
||||
the tracer or 1 to enable it.
|
||||
|
||||
trace:
|
||||
|
||||
@ -202,10 +202,6 @@ Here is the list of current tracers that may be configured.
|
||||
to draw a graph of function calls similar to C code
|
||||
source.
|
||||
|
||||
"sched_switch"
|
||||
|
||||
Traces the context switches and wakeups between tasks.
|
||||
|
||||
"irqsoff"
|
||||
|
||||
Traces the areas that disable interrupts and saves
|
||||
@ -273,39 +269,6 @@ format, the function name that was traced "path_put" and the
|
||||
parent function that called this function "path_walk". The
|
||||
timestamp is the time at which the function was entered.
|
||||
|
||||
The sched_switch tracer also includes tracing of task wakeups
|
||||
and context switches.
|
||||
|
||||
ksoftirqd/1-7 [01] 1453.070013: 7:115:R + 2916:115:S
|
||||
ksoftirqd/1-7 [01] 1453.070013: 7:115:R + 10:115:S
|
||||
ksoftirqd/1-7 [01] 1453.070013: 7:115:R ==> 10:115:R
|
||||
events/1-10 [01] 1453.070013: 10:115:S ==> 2916:115:R
|
||||
kondemand/1-2916 [01] 1453.070013: 2916:115:S ==> 7:115:R
|
||||
ksoftirqd/1-7 [01] 1453.070013: 7:115:S ==> 0:140:R
|
||||
|
||||
Wake ups are represented by a "+" and the context switches are
|
||||
shown as "==>". The format is:
|
||||
|
||||
Context switches:
|
||||
|
||||
Previous task Next Task
|
||||
|
||||
<pid>:<prio>:<state> ==> <pid>:<prio>:<state>
|
||||
|
||||
Wake ups:
|
||||
|
||||
Current task Task waking up
|
||||
|
||||
<pid>:<prio>:<state> + <pid>:<prio>:<state>
|
||||
|
||||
The prio is the internal kernel priority, which is the inverse
|
||||
of the priority that is usually displayed by user-space tools.
|
||||
Zero represents the highest priority (99). Prio 100 starts the
|
||||
"nice" priorities with 100 being equal to nice -20 and 139 being
|
||||
nice 19. The prio "140" is reserved for the idle task which is
|
||||
the lowest priority thread (pid 0).
|
||||
|
||||
|
||||
Latency trace format
|
||||
--------------------
|
||||
|
||||
@ -491,78 +454,10 @@ x494] <- /root/a.out[+0x4a8] <- /lib/libc-2.7.so[+0x1e1a6]
|
||||
latencies, as described in "Latency
|
||||
trace format".
|
||||
|
||||
sched_switch
|
||||
------------
|
||||
|
||||
This tracer simply records schedule switches. Here is an example
|
||||
of how to use it.
|
||||
|
||||
# echo sched_switch > current_tracer
|
||||
# echo 1 > tracing_enabled
|
||||
# sleep 1
|
||||
# echo 0 > tracing_enabled
|
||||
# cat trace
|
||||
|
||||
# tracer: sched_switch
|
||||
#
|
||||
# TASK-PID CPU# TIMESTAMP FUNCTION
|
||||
# | | | | |
|
||||
bash-3997 [01] 240.132281: 3997:120:R + 4055:120:R
|
||||
bash-3997 [01] 240.132284: 3997:120:R ==> 4055:120:R
|
||||
sleep-4055 [01] 240.132371: 4055:120:S ==> 3997:120:R
|
||||
bash-3997 [01] 240.132454: 3997:120:R + 4055:120:S
|
||||
bash-3997 [01] 240.132457: 3997:120:R ==> 4055:120:R
|
||||
sleep-4055 [01] 240.132460: 4055:120:D ==> 3997:120:R
|
||||
bash-3997 [01] 240.132463: 3997:120:R + 4055:120:D
|
||||
bash-3997 [01] 240.132465: 3997:120:R ==> 4055:120:R
|
||||
<idle>-0 [00] 240.132589: 0:140:R + 4:115:S
|
||||
<idle>-0 [00] 240.132591: 0:140:R ==> 4:115:R
|
||||
ksoftirqd/0-4 [00] 240.132595: 4:115:S ==> 0:140:R
|
||||
<idle>-0 [00] 240.132598: 0:140:R + 4:115:S
|
||||
<idle>-0 [00] 240.132599: 0:140:R ==> 4:115:R
|
||||
ksoftirqd/0-4 [00] 240.132603: 4:115:S ==> 0:140:R
|
||||
sleep-4055 [01] 240.133058: 4055:120:S ==> 3997:120:R
|
||||
[...]
|
||||
|
||||
|
||||
As we have discussed previously about this format, the header
|
||||
shows the name of the trace and points to the options. The
|
||||
"FUNCTION" is a misnomer since here it represents the wake ups
|
||||
and context switches.
|
||||
|
||||
The sched_switch file only lists the wake ups (represented with
|
||||
'+') and context switches ('==>') with the previous task or
|
||||
current task first followed by the next task or task waking up.
|
||||
The format for both of these is PID:KERNEL-PRIO:TASK-STATE.
|
||||
Remember that the KERNEL-PRIO is the inverse of the actual
|
||||
priority with zero (0) being the highest priority and the nice
|
||||
values starting at 100 (nice -20). Below is a quick chart to map
|
||||
the kernel priority to user land priorities.
|
||||
|
||||
Kernel Space User Space
|
||||
===============================================================
|
||||
0(high) to 98(low) user RT priority 99(high) to 1(low)
|
||||
with SCHED_RR or SCHED_FIFO
|
||||
---------------------------------------------------------------
|
||||
99 sched_priority is not used in scheduling
|
||||
decisions(it must be specified as 0)
|
||||
---------------------------------------------------------------
|
||||
100(high) to 139(low) user nice -20(high) to 19(low)
|
||||
---------------------------------------------------------------
|
||||
140 idle task priority
|
||||
---------------------------------------------------------------
|
||||
|
||||
The task states are:
|
||||
|
||||
R - running : wants to run, may not actually be running
|
||||
S - sleep : process is waiting to be woken up (handles signals)
|
||||
D - disk sleep (uninterruptible sleep) : process must be woken up
|
||||
(ignores signals)
|
||||
T - stopped : process suspended
|
||||
t - traced : process is being traced (with something like gdb)
|
||||
Z - zombie : process waiting to be cleaned up
|
||||
X - unknown
|
||||
|
||||
overwrite - This controls what happens when the trace buffer is
|
||||
full. If "1" (default), the oldest events are
|
||||
discarded and overwritten. If "0", then the newest
|
||||
events are discarded.
|
||||
|
||||
ftrace_enabled
|
||||
--------------
|
||||
@ -607,10 +502,10 @@ an example:
|
||||
# echo irqsoff > current_tracer
|
||||
# echo latency-format > trace_options
|
||||
# echo 0 > tracing_max_latency
|
||||
# echo 1 > tracing_enabled
|
||||
# echo 1 > tracing_on
|
||||
# ls -ltr
|
||||
[...]
|
||||
# echo 0 > tracing_enabled
|
||||
# echo 0 > tracing_on
|
||||
# cat trace
|
||||
# tracer: irqsoff
|
||||
#
|
||||
@ -715,10 +610,10 @@ is much like the irqsoff tracer.
|
||||
# echo preemptoff > current_tracer
|
||||
# echo latency-format > trace_options
|
||||
# echo 0 > tracing_max_latency
|
||||
# echo 1 > tracing_enabled
|
||||
# echo 1 > tracing_on
|
||||
# ls -ltr
|
||||
[...]
|
||||
# echo 0 > tracing_enabled
|
||||
# echo 0 > tracing_on
|
||||
# cat trace
|
||||
# tracer: preemptoff
|
||||
#
|
||||
@ -863,10 +758,10 @@ tracers.
|
||||
# echo preemptirqsoff > current_tracer
|
||||
# echo latency-format > trace_options
|
||||
# echo 0 > tracing_max_latency
|
||||
# echo 1 > tracing_enabled
|
||||
# echo 1 > tracing_on
|
||||
# ls -ltr
|
||||
[...]
|
||||
# echo 0 > tracing_enabled
|
||||
# echo 0 > tracing_on
|
||||
# cat trace
|
||||
# tracer: preemptirqsoff
|
||||
#
|
||||
@ -1026,9 +921,9 @@ Instead of performing an 'ls', we will run 'sleep 1' under
|
||||
# echo wakeup > current_tracer
|
||||
# echo latency-format > trace_options
|
||||
# echo 0 > tracing_max_latency
|
||||
# echo 1 > tracing_enabled
|
||||
# echo 1 > tracing_on
|
||||
# chrt -f 5 sleep 1
|
||||
# echo 0 > tracing_enabled
|
||||
# echo 0 > tracing_on
|
||||
# cat trace
|
||||
# tracer: wakeup
|
||||
#
|
||||
@ -1140,9 +1035,9 @@ ftrace_enabled is set; otherwise this tracer is a nop.
|
||||
|
||||
# sysctl kernel.ftrace_enabled=1
|
||||
# echo function > current_tracer
|
||||
# echo 1 > tracing_enabled
|
||||
# echo 1 > tracing_on
|
||||
# usleep 1
|
||||
# echo 0 > tracing_enabled
|
||||
# echo 0 > tracing_on
|
||||
# cat trace
|
||||
# tracer: function
|
||||
#
|
||||
@ -1180,7 +1075,7 @@ int trace_fd;
|
||||
[...]
|
||||
int main(int argc, char *argv[]) {
|
||||
[...]
|
||||
trace_fd = open(tracing_file("tracing_enabled"), O_WRONLY);
|
||||
trace_fd = open(tracing_file("tracing_on"), O_WRONLY);
|
||||
[...]
|
||||
if (condition_hit()) {
|
||||
write(trace_fd, "0", 1);
|
||||
@ -1631,9 +1526,9 @@ If I am only interested in sys_nanosleep and hrtimer_interrupt:
|
||||
# echo sys_nanosleep hrtimer_interrupt \
|
||||
> set_ftrace_filter
|
||||
# echo function > current_tracer
|
||||
# echo 1 > tracing_enabled
|
||||
# echo 1 > tracing_on
|
||||
# usleep 1
|
||||
# echo 0 > tracing_enabled
|
||||
# echo 0 > tracing_on
|
||||
# cat trace
|
||||
# tracer: ftrace
|
||||
#
|
||||
@ -1879,9 +1774,9 @@ different. The trace is live.
|
||||
# echo function > current_tracer
|
||||
# cat trace_pipe > /tmp/trace.out &
|
||||
[1] 4153
|
||||
# echo 1 > tracing_enabled
|
||||
# echo 1 > tracing_on
|
||||
# usleep 1
|
||||
# echo 0 > tracing_enabled
|
||||
# echo 0 > tracing_on
|
||||
# cat trace
|
||||
# tracer: function
|
||||
#
|
||||
|
@ -42,11 +42,25 @@ Synopsis of kprobe_events
|
||||
+|-offs(FETCHARG) : Fetch memory at FETCHARG +|- offs address.(**)
|
||||
NAME=FETCHARG : Set NAME as the argument name of FETCHARG.
|
||||
FETCHARG:TYPE : Set TYPE as the type of FETCHARG. Currently, basic types
|
||||
(u8/u16/u32/u64/s8/s16/s32/s64) and string are supported.
|
||||
(u8/u16/u32/u64/s8/s16/s32/s64), "string" and bitfield
|
||||
are supported.
|
||||
|
||||
(*) only for return probe.
|
||||
(**) this is useful for fetching a field of data structures.
|
||||
|
||||
Types
|
||||
-----
|
||||
Several types are supported for fetch-args. Kprobe tracer will access memory
|
||||
by given type. Prefix 's' and 'u' means those types are signed and unsigned
|
||||
respectively. Traced arguments are shown in decimal (signed) or hex (unsigned).
|
||||
String type is a special type, which fetches a "null-terminated" string from
|
||||
kernel space. This means it will fail and store NULL if the string container
|
||||
has been paged out.
|
||||
Bitfield is another special type, which takes 3 parameters, bit-width, bit-
|
||||
offset, and container-size (usually 32). The syntax is;
|
||||
|
||||
b<bit-width>@<bit-offset>/<container-size>
|
||||
|
||||
|
||||
Per-Probe Event Filtering
|
||||
-------------------------
|
||||
|
@ -12,6 +12,10 @@ Controller Drivers (HCD). So, if HCD is buggy, the traces reported by
|
||||
usbmon may not correspond to bus transactions precisely. This is the same
|
||||
situation as with tcpdump.
|
||||
|
||||
Two APIs are currently implemented: "text" and "binary". The binary API
|
||||
is available through a character device in /dev namespace and is an ABI.
|
||||
The text API is deprecated since 2.6.35, but available for convenience.
|
||||
|
||||
* How to use usbmon to collect raw text traces
|
||||
|
||||
Unlike the packet socket, usbmon has an interface which provides traces
|
||||
@ -162,39 +166,11 @@ Here is the list of words, from left to right:
|
||||
not machine words, but really just a byte stream split into words to make
|
||||
it easier to read. Thus, the last word may contain from one to four bytes.
|
||||
The length of collected data is limited and can be less than the data length
|
||||
report in Data Length word.
|
||||
|
||||
Here is an example of code to read the data stream in a well known programming
|
||||
language:
|
||||
|
||||
class ParsedLine {
|
||||
int data_len; /* Available length of data */
|
||||
byte data[];
|
||||
|
||||
void parseData(StringTokenizer st) {
|
||||
int availwords = st.countTokens();
|
||||
data = new byte[availwords * 4];
|
||||
data_len = 0;
|
||||
while (st.hasMoreTokens()) {
|
||||
String data_str = st.nextToken();
|
||||
int len = data_str.length() / 2;
|
||||
int i;
|
||||
int b; // byte is signed, apparently?! XXX
|
||||
for (i = 0; i < len; i++) {
|
||||
// data[data_len] = Byte.parseByte(
|
||||
// data_str.substring(i*2, i*2 + 2),
|
||||
// 16);
|
||||
b = Integer.parseInt(
|
||||
data_str.substring(i*2, i*2 + 2),
|
||||
16);
|
||||
if (b >= 128)
|
||||
b *= -1;
|
||||
data[data_len] = (byte) b;
|
||||
data_len++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
reported in the Data Length word. In the case of an Isochronous input (Zi)
|
||||
completion where the received data is sparse in the buffer, the length of
|
||||
the collected data can be greater than the Data Length value (because Data
|
||||
Length counts only the bytes that were received whereas the Data words
|
||||
contain the entire transfer buffer).
|
||||
|
||||
Examples:
|
||||
|
||||
|
50
Documentation/zh_CN/SecurityBugs
Normal file
50
Documentation/zh_CN/SecurityBugs
Normal file
@ -0,0 +1,50 @@
|
||||
Chinese translated version of Documentation/SecurityBugs
|
||||
|
||||
If you have any comment or update to the content, please contact the
|
||||
original document maintainer directly. However, if you have a problem
|
||||
communicating in English you can also ask the Chinese maintainer for
|
||||
help. Contact the Chinese maintainer if this translation is outdated
|
||||
or if there is a problem with the translation.
|
||||
|
||||
Chinese maintainer: Harry Wei <harryxiyou@gmail.com>
|
||||
---------------------------------------------------------------------
|
||||
Documentation/SecurityBugs 的中文翻译
|
||||
|
||||
如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
|
||||
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
|
||||
译存在问题,请联系中文版维护者。
|
||||
|
||||
中文版维护者: 贾威威 Harry Wei <harryxiyou@gmail.com>
|
||||
中文版翻译者: 贾威威 Harry Wei <harryxiyou@gmail.com>
|
||||
中文版校译者: 贾威威 Harry Wei <harryxiyou@gmail.com>
|
||||
|
||||
|
||||
以下为正文
|
||||
---------------------------------------------------------------------
|
||||
Linux内核开发者认为安全非常重要。因此,我们想要知道当一个有关于
|
||||
安全的漏洞被发现的时候,并且它可能会被尽快的修复或者公开。请把这个安全
|
||||
漏洞报告给Linux内核安全团队。
|
||||
|
||||
1) 联系
|
||||
|
||||
linux内核安全团队可以通过email<security@kernel.org>来联系。这是
|
||||
一组独立的安全工作人员,可以帮助改善漏洞报告并且公布和取消一个修复。安
|
||||
全团队有可能会从部分的维护者那里引进额外的帮助来了解并且修复安全漏洞。
|
||||
当遇到任何漏洞,所能提供的信息越多就越能诊断和修复。如果你不清楚什么
|
||||
是有帮助的信息,那就请重温一下REPORTING-BUGS文件中的概述过程。任
|
||||
何攻击性的代码都是非常有用的,未经报告者的同意不会被取消,除非它已经
|
||||
被公布于众。
|
||||
|
||||
2) 公开
|
||||
|
||||
Linux内核安全团队的宗旨就是和漏洞提交者一起处理漏洞的解决方案直
|
||||
到公开。我们喜欢尽快地完全公开漏洞。当一个漏洞或者修复还没有被完全地理
|
||||
解,解决方案没有通过测试或者供应商协调,可以合理地延迟公开。然而,我们
|
||||
期望这些延迟尽可能的短些,是可数的几天,而不是几个星期或者几个月。公开
|
||||
日期是通过安全团队和漏洞提供者以及供应商洽谈后的结果。公开时间表是从很
|
||||
短(特殊的,它已经被公众所知道)到几个星期。作为一个基本的默认政策,我
|
||||
们所期望通知公众的日期是7天的安排。
|
||||
|
||||
3) 保密协议
|
||||
|
||||
Linux内核安全团队不是一个正式的团体,因此不能加入任何的保密协议。
|
109
Documentation/zh_CN/SubmitChecklist
Normal file
109
Documentation/zh_CN/SubmitChecklist
Normal file
@ -0,0 +1,109 @@
|
||||
Chinese translated version of Documentation/SubmitChecklist
|
||||
|
||||
If you have any comment or update to the content, please contact the
|
||||
original document maintainer directly. However, if you have a problem
|
||||
communicating in English you can also ask the Chinese maintainer for
|
||||
help. Contact the Chinese maintainer if this translation is outdated
|
||||
or if there is a problem with the translation.
|
||||
|
||||
Chinese maintainer: Harry Wei <harryxiyou@gmail.com>
|
||||
---------------------------------------------------------------------
|
||||
Documentation/SubmitChecklist 的中文翻译
|
||||
|
||||
如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
|
||||
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
|
||||
译存在问题,请联系中文版维护者。
|
||||
|
||||
中文版维护者: 贾威威 Harry Wei <harryxiyou@gmail.com>
|
||||
中文版翻译者: 贾威威 Harry Wei <harryxiyou@gmail.com>
|
||||
中文版校译者: 贾威威 Harry Wei <harryxiyou@gmail.com>
|
||||
|
||||
|
||||
以下为正文
|
||||
---------------------------------------------------------------------
|
||||
Linux内核提交清单
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
这里有一些内核开发者应该做的基本事情,如果他们想看到自己的内核补丁提交
|
||||
被接受的更快。
|
||||
|
||||
这些都是超出Documentation/SubmittingPatches文档里所提供的以及其他
|
||||
关于提交Linux内核补丁的说明。
|
||||
|
||||
1:如果你使用了一个功能那么就#include定义/声明那个功能的那个文件。
|
||||
不要依靠其他间接引入定义/声明那个功能的头文件。
|
||||
|
||||
2:构建简洁适用或者更改CONFIG选项 =y,=m,或者=n。
|
||||
不要有编译警告/错误, 不要有链接警告/错误。
|
||||
|
||||
2b:通过 allnoconfig, allmodconfig
|
||||
|
||||
2c:当使用 0=builddir 成功地构建
|
||||
|
||||
3:通过使用本地交叉编译工具或者其他一些构建产所,在多CPU框架上构建。
|
||||
|
||||
4:ppc64 是一个很好的检查交叉编译的框架,因为它往往把‘unsigned long’
|
||||
当64位值来使用。
|
||||
|
||||
5:按照Documentation/CodingStyle文件里的详细描述,检查你补丁的整体风格。
|
||||
使用补丁风格检查琐碎的违规(scripts/checkpatch.pl),审核员优先提交。
|
||||
你应该调整遗留在你补丁中的所有违规。
|
||||
|
||||
6:任何更新或者改动CONFIG选项都不能打乱配置菜单。
|
||||
|
||||
7:所有的Kconfig选项更新都要有说明文字。
|
||||
|
||||
8:已经认真地总结了相关的Kconfig组合。这是很难通过测试做好的--脑力在这里下降。
|
||||
|
||||
9:检查具有简洁性。
|
||||
|
||||
10:使用'make checkstack'和'make namespacecheck'检查,然后修改所找到的问题。
|
||||
注意:堆栈检查不会明确地出现问题,但是任何的一个函数在堆栈上使用多于512字节
|
||||
都要准备修改。
|
||||
|
||||
11:包含kernel-doc到全局内核APIs文件。(不要求静态的函数,但是包含也无所谓。)
|
||||
使用'make htmldocs'或者'make mandocs'来检查kernel-doc,然后修改任何
|
||||
发现的问题。
|
||||
|
||||
12:已经通过CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT,
|
||||
CONFIG_DEBUG_SLAB, CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES,
|
||||
CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_SPINLOCK_SLEEP测试,并且同时都
|
||||
使能。
|
||||
|
||||
13:已经都构建并且使用或者不使用 CONFIG_SMP 和 CONFIG_PREEMPT测试执行时间。
|
||||
|
||||
14:如果补丁影响IO/Disk,等等:已经通过使用或者不使用 CONFIG_LBDAF 测试。
|
||||
|
||||
15:所有的codepaths已经行使所有lockdep启用功能。
|
||||
|
||||
16:所有的/proc记录更新都要作成文件放在Documentation/目录下。
|
||||
|
||||
17:所有的内核启动参数更新都被记录到Documentation/kernel-parameters.txt文件中。
|
||||
|
||||
18:所有的模块参数更新都用MODULE_PARM_DESC()记录。
|
||||
|
||||
19:所有的用户空间接口更新都被记录到Documentation/ABI/。查看Documentation/ABI/README
|
||||
可以获得更多的信息。改变用户空间接口的补丁应该被邮件抄送给linux-api@vger.kernel.org。
|
||||
|
||||
20:检查它是不是都通过`make headers_check'。
|
||||
|
||||
21:已经通过至少引入slab和page-allocation失败检查。查看Documentation/fault-injection/。
|
||||
|
||||
22:新加入的源码已经通过`gcc -W'(使用"make EXTRA_CFLAGS=-W")编译。这样将产生很多烦恼,
|
||||
但是对于寻找漏洞很有益处,例如:"warning: comparison between signed and unsigned"。
|
||||
|
||||
23:当它被合并到-mm补丁集后再测试,用来确定它是否还和补丁队列中的其他补丁一起工作以及在VM,VFS
|
||||
和其他子系统中各个变化。
|
||||
|
||||
24:所有的内存屏障{e.g., barrier(), rmb(), wmb()}需要在源代码中的一个注释来解释他们都是干什么的
|
||||
以及原因。
|
||||
|
||||
25:如果有任何输入输出控制的补丁被添加,也要更新Documentation/ioctl/ioctl-number.txt。
|
||||
|
||||
26:如果你的更改代码依靠或者使用任何的内核APIs或者与下面的kconfig符号有关系的功能,你就要
|
||||
使用相关的kconfig符号关闭, and/or =m(如果选项提供)[在同一时间不是所用的都启用,仅仅各个或者自由
|
||||
组合他们]:
|
||||
|
||||
CONFIG_SMP, CONFIG_SYSFS, CONFIG_PROC_FS, CONFIG_INPUT, CONFIG_PCI,
|
||||
CONFIG_BLOCK, CONFIG_PM, CONFIG_HOTPLUG, CONFIG_MAGIC_SYSRQ,
|
||||
CONFIG_NET, CONFIG_INET=n (后一个使用 CONFIG_NET=y)
|
@ -100,7 +100,7 @@ http://userweb.kernel.org/~akpm/stuff/patch-scripts.tar.gz
|
||||
|
||||
将改动拆分,逻辑类似的放到同一个补丁文件里。
|
||||
|
||||
例如,如果你的改动里同时有bug修正和性能优化,那么把这些改动才分到两个或
|
||||
例如,如果你的改动里同时有bug修正和性能优化,那么把这些改动拆分到两个或
|
||||
者更多的补丁文件中。如果你的改动包含对API的修改,并且修改了驱动程序来适
|
||||
应这些新的API,那么把这些修改分成两个补丁。
|
||||
|
||||
@ -230,7 +230,7 @@ pref("mailnews.display.disable_format_flowed_support", true);
|
||||
些原因,修正错误,重新提交更新后的改动,是你自己的工作。
|
||||
|
||||
Linus不给出任何评论就“丢弃”你的补丁是常见的事情。在系统中这样的事情很
|
||||
平常。如果他没有接受你的补丁,也许是由于以下原本:
|
||||
平常。如果他没有接受你的补丁,也许是由于以下原因:
|
||||
* 你的补丁不能在最新版本的内核上干净的打上。
|
||||
* 你的补丁在 linux-kernel 邮件列表中没有得到充分的讨论。
|
||||
* 风格问题(参照第2小节)
|
||||
|
167
Documentation/zh_CN/magic-number.txt
Normal file
167
Documentation/zh_CN/magic-number.txt
Normal file
@ -0,0 +1,167 @@
|
||||
Chinese translated version of Documentation/magic-number.txt
|
||||
|
||||
If you have any comment or update to the content, please post to LKML directly.
|
||||
However, if you have problem communicating in English you can also ask the
|
||||
Chinese maintainer for help. Contact the Chinese maintainer, if this
|
||||
translation is outdated or there is problem with translation.
|
||||
|
||||
Chinese maintainer: Jia Wei Wei <harryxiyou@gmail.com>
|
||||
---------------------------------------------------------------------
|
||||
Documentation/magic-number.txt的中文翻译
|
||||
|
||||
如果想评论或更新本文的内容,请直接发信到LKML。如果你使用英文交流有困难的话,也可
|
||||
以向中文版维护者求助。如果本翻译更新不及时或者翻译存在问题,请联系中文版维护者。
|
||||
|
||||
中文版维护者: 贾威威 Jia Wei Wei <harryxiyou@gmail.com>
|
||||
中文版翻译者: 贾威威 Jia Wei Wei <harryxiyou@gmail.com>
|
||||
中文版校译者: 贾威威 Jia Wei Wei <harryxiyou@gmail.com>
|
||||
|
||||
以下为正文
|
||||
---------------------------------------------------------------------
|
||||
这个文件是有关当前使用的魔术值注册表。当你给一个结构添加了一个魔术值,你也应该把这个魔术值添加到这个文件,因为我们最好把用于各种结构的魔术值统一起来。
|
||||
|
||||
使用魔术值来保护内核数据结构是一个非常好的主意。这就允许你在运行期检查(a)一个结构是否已经被攻击,或者(b)你已经给一个例行程序通过了一个错误的结构。后一种情况特别地有用---特别是当你通过一个空指针指向结构体的时候。tty源码,例如,经常通过特定驱动使用这种方法并且反复地排列特定方面的结构。
|
||||
|
||||
使用魔术值的方法是在结构的开始处声明的,如下:
|
||||
|
||||
struct tty_ldisc {
|
||||
int magic;
|
||||
...
|
||||
};
|
||||
|
||||
当你以后给内核添加增强功能的时候,请遵守这条规则!这样就会节省数不清的调试时间,特别是一些古怪的情况,例如,数组超出范围并且重新写了超出部分。遵守这个规则,这些情况可以被快速地,安全地避免。
|
||||
|
||||
Theodore Ts'o
|
||||
31 Mar 94
|
||||
|
||||
给当前的Linux 2.1.55添加魔术表。
|
||||
|
||||
Michael Chastain
|
||||
<mailto:mec@shout.net>
|
||||
22 Sep 1997
|
||||
|
||||
现在应该最新的Linux 2.1.112.因为在特性冻结期间,不能在2.2.x前改变任何东西。这些条目被数域所排序。
|
||||
|
||||
Krzysztof G.Baranowski
|
||||
<mailto: kgb@knm.org.pl>
|
||||
29 Jul 1998
|
||||
|
||||
更新魔术表到Linux 2.5.45。刚好越过特性冻结,但是有可能还会有一些新的魔术值在2.6.x之前融入到内核中。
|
||||
|
||||
Petr Baudis
|
||||
<pasky@ucw.cz>
|
||||
03 Nov 2002
|
||||
|
||||
更新魔术表到Linux 2.5.74。
|
||||
|
||||
Fabian Frederick
|
||||
<ffrederick@users.sourceforge.net>
|
||||
09 Jul 2003
|
||||
|
||||
魔术名 地址 结构 所在文件
|
||||
===========================================================================
|
||||
PG_MAGIC 'P' pg_{read,write}_hdr include/linux/pg.h
|
||||
CMAGIC 0x0111 user include/linux/a.out.h
|
||||
MKISS_DRIVER_MAGIC 0x04bf mkiss_channel drivers/net/mkiss.h
|
||||
RISCOM8_MAGIC 0x0907 riscom_port drivers/char/riscom8.h
|
||||
SPECIALIX_MAGIC 0x0907 specialix_port drivers/char/specialix_io8.h
|
||||
HDLC_MAGIC 0x239e n_hdlc drivers/char/n_hdlc.c
|
||||
APM_BIOS_MAGIC 0x4101 apm_user arch/i386/kernel/apm.c
|
||||
CYCLADES_MAGIC 0x4359 cyclades_port include/linux/cyclades.h
|
||||
DB_MAGIC 0x4442 fc_info drivers/net/iph5526_novram.c
|
||||
DL_MAGIC 0x444d fc_info drivers/net/iph5526_novram.c
|
||||
FASYNC_MAGIC 0x4601 fasync_struct include/linux/fs.h
|
||||
FF_MAGIC 0x4646 fc_info drivers/net/iph5526_novram.c
|
||||
ISICOM_MAGIC 0x4d54 isi_port include/linux/isicom.h
|
||||
PTY_MAGIC 0x5001 drivers/char/pty.c
|
||||
PPP_MAGIC 0x5002 ppp include/linux/if_pppvar.h
|
||||
SERIAL_MAGIC 0x5301 async_struct include/linux/serial.h
|
||||
SSTATE_MAGIC 0x5302 serial_state include/linux/serial.h
|
||||
SLIP_MAGIC 0x5302 slip drivers/net/slip.h
|
||||
STRIP_MAGIC 0x5303 strip drivers/net/strip.c
|
||||
X25_ASY_MAGIC 0x5303 x25_asy drivers/net/x25_asy.h
|
||||
SIXPACK_MAGIC 0x5304 sixpack drivers/net/hamradio/6pack.h
|
||||
AX25_MAGIC 0x5316 ax_disp drivers/net/mkiss.h
|
||||
ESP_MAGIC 0x53ee esp_struct drivers/char/esp.h
|
||||
TTY_MAGIC 0x5401 tty_struct include/linux/tty.h
|
||||
MGSL_MAGIC 0x5401 mgsl_info drivers/char/synclink.c
|
||||
TTY_DRIVER_MAGIC 0x5402 tty_driver include/linux/tty_driver.h
|
||||
MGSLPC_MAGIC 0x5402 mgslpc_info drivers/char/pcmcia/synclink_cs.c
|
||||
TTY_LDISC_MAGIC 0x5403 tty_ldisc include/linux/tty_ldisc.h
|
||||
USB_SERIAL_MAGIC 0x6702 usb_serial drivers/usb/serial/usb-serial.h
|
||||
FULL_DUPLEX_MAGIC 0x6969 drivers/net/tulip/de2104x.c
|
||||
USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth drivers/usb/class/bluetty.c
|
||||
RFCOMM_TTY_MAGIC 0x6d02 net/bluetooth/rfcomm/tty.c
|
||||
USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port drivers/usb/serial/usb-serial.h
|
||||
CG_MAGIC 0x00090255 ufs_cylinder_group include/linux/ufs_fs.h
|
||||
A2232_MAGIC 0x000a2232 gs_port drivers/char/ser_a2232.h
|
||||
RPORT_MAGIC 0x00525001 r_port drivers/char/rocket_int.h
|
||||
LSEMAGIC 0x05091998 lse drivers/fc4/fc.c
|
||||
GDTIOCTL_MAGIC 0x06030f07 gdth_iowr_str drivers/scsi/gdth_ioctl.h
|
||||
RIEBL_MAGIC 0x09051990 drivers/net/atarilance.c
|
||||
RIO_MAGIC 0x12345678 gs_port drivers/char/rio/rio_linux.c
|
||||
SX_MAGIC 0x12345678 gs_port drivers/char/sx.h
|
||||
NBD_REQUEST_MAGIC 0x12560953 nbd_request include/linux/nbd.h
|
||||
RED_MAGIC2 0x170fc2a5 (any) mm/slab.c
|
||||
BAYCOM_MAGIC 0x19730510 baycom_state drivers/net/baycom_epp.c
|
||||
ISDN_X25IFACE_MAGIC 0x1e75a2b9 isdn_x25iface_proto_data
|
||||
drivers/isdn/isdn_x25iface.h
|
||||
ECP_MAGIC 0x21504345 cdkecpsig include/linux/cdk.h
|
||||
LSOMAGIC 0x27091997 lso drivers/fc4/fc.c
|
||||
LSMAGIC 0x2a3b4d2a ls drivers/fc4/fc.c
|
||||
WANPIPE_MAGIC 0x414C4453 sdla_{dump,exec} include/linux/wanpipe.h
|
||||
CS_CARD_MAGIC 0x43525553 cs_card sound/oss/cs46xx.c
|
||||
LABELCL_MAGIC 0x4857434c labelcl_info_s include/asm/ia64/sn/labelcl.h
|
||||
ISDN_ASYNC_MAGIC 0x49344C01 modem_info include/linux/isdn.h
|
||||
CTC_ASYNC_MAGIC 0x49344C01 ctc_tty_info drivers/s390/net/ctctty.c
|
||||
ISDN_NET_MAGIC 0x49344C02 isdn_net_local_s drivers/isdn/i4l/isdn_net_lib.h
|
||||
SAVEKMSG_MAGIC2 0x4B4D5347 savekmsg arch/*/amiga/config.c
|
||||
STLI_BOARDMAGIC 0x4bc6c825 stlibrd include/linux/istallion.h
|
||||
CS_STATE_MAGIC 0x4c4f4749 cs_state sound/oss/cs46xx.c
|
||||
SLAB_C_MAGIC 0x4f17a36d kmem_cache mm/slab.c
|
||||
COW_MAGIC 0x4f4f4f4d cow_header_v1 arch/um/drivers/ubd_user.c
|
||||
I810_CARD_MAGIC 0x5072696E i810_card sound/oss/i810_audio.c
|
||||
TRIDENT_CARD_MAGIC 0x5072696E trident_card sound/oss/trident.c
|
||||
ROUTER_MAGIC 0x524d4157 wan_device include/linux/wanrouter.h
|
||||
SCC_MAGIC 0x52696368 gs_port drivers/char/scc.h
|
||||
SAVEKMSG_MAGIC1 0x53415645 savekmsg arch/*/amiga/config.c
|
||||
GDA_MAGIC 0x58464552 gda arch/mips/include/asm/sn/gda.h
|
||||
RED_MAGIC1 0x5a2cf071 (any) mm/slab.c
|
||||
STL_PORTMAGIC 0x5a7182c9 stlport include/linux/stallion.h
|
||||
EEPROM_MAGIC_VALUE 0x5ab478d2 lanai_dev drivers/atm/lanai.c
|
||||
HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state include/linux/hdlcdrv.h
|
||||
EPCA_MAGIC 0x5c6df104 channel include/linux/epca.h
|
||||
PCXX_MAGIC 0x5c6df104 channel drivers/char/pcxx.h
|
||||
KV_MAGIC 0x5f4b565f kernel_vars_s arch/mips/include/asm/sn/klkernvars.h
|
||||
I810_STATE_MAGIC 0x63657373 i810_state sound/oss/i810_audio.c
|
||||
TRIDENT_STATE_MAGIC 0x63657373 trient_state sound/oss/trident.c
|
||||
M3_CARD_MAGIC 0x646e6f50 m3_card sound/oss/maestro3.c
|
||||
FW_HEADER_MAGIC 0x65726F66 fw_header drivers/atm/fore200e.h
|
||||
SLOT_MAGIC 0x67267321 slot drivers/hotplug/cpqphp.h
|
||||
SLOT_MAGIC 0x67267322 slot drivers/hotplug/acpiphp.h
|
||||
LO_MAGIC 0x68797548 nbd_device include/linux/nbd.h
|
||||
OPROFILE_MAGIC 0x6f70726f super_block drivers/oprofile/oprofilefs.h
|
||||
M3_STATE_MAGIC 0x734d724d m3_state sound/oss/maestro3.c
|
||||
STL_PANELMAGIC 0x7ef621a1 stlpanel include/linux/stallion.h
|
||||
VMALLOC_MAGIC 0x87654320 snd_alloc_track sound/core/memory.c
|
||||
KMALLOC_MAGIC 0x87654321 snd_alloc_track sound/core/memory.c
|
||||
PWC_MAGIC 0x89DC10AB pwc_device drivers/usb/media/pwc.h
|
||||
NBD_REPLY_MAGIC 0x96744668 nbd_reply include/linux/nbd.h
|
||||
STL_BOARDMAGIC 0xa2267f52 stlbrd include/linux/stallion.h
|
||||
ENI155_MAGIC 0xa54b872d midway_eprom drivers/atm/eni.h
|
||||
SCI_MAGIC 0xbabeface gs_port drivers/char/sh-sci.h
|
||||
CODA_MAGIC 0xC0DAC0DA coda_file_info include/linux/coda_fs_i.h
|
||||
DPMEM_MAGIC 0xc0ffee11 gdt_pci_sram drivers/scsi/gdth.h
|
||||
STLI_PORTMAGIC 0xe671c7a1 stliport include/linux/istallion.h
|
||||
YAM_MAGIC 0xF10A7654 yam_port drivers/net/hamradio/yam.c
|
||||
CCB_MAGIC 0xf2691ad2 ccb drivers/scsi/ncr53c8xx.c
|
||||
QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry drivers/scsi/arm/queue.c
|
||||
QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry drivers/scsi/arm/queue.c
|
||||
HTB_CMAGIC 0xFEFAFEF1 htb_class net/sched/sch_htb.c
|
||||
NMI_MAGIC 0x48414d4d455201 nmi_s arch/mips/include/asm/sn/nmi.h
|
||||
|
||||
请注意,在声音记忆管理中仍然有每一些被定义的驱动魔术值。查看include/sound/sndmagic.h来获取他们完整的列表信息。很多OSS声音驱动拥有自己从声卡PCI ID构建的魔术值-他们也没有被列在这里。
|
||||
|
||||
IrDA子系统也使用了大量的自己的魔术值,查看include/net/irda/irda.h来获取他们完整的信息。
|
||||
|
||||
HFS是另外一个比较大的使用魔术值的文件系统-你可以在fs/hfs/hfs.h中找到他们。
|
60
MAINTAINERS
60
MAINTAINERS
@ -465,6 +465,16 @@ M: Matt Turner <mattst88@gmail.com>
|
||||
L: linux-alpha@vger.kernel.org
|
||||
F: arch/alpha/
|
||||
|
||||
ALTERA UART/JTAG UART SERIAL DRIVERS
|
||||
M: Tobias Klauser <tklauser@distanz.ch>
|
||||
L: linux-serial@vger.kernel.org
|
||||
L: nios2-dev@sopc.et.ntust.edu.tw (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
F: drivers/tty/serial/altera_uart.c
|
||||
F: drivers/tty/serial/altera_jtaguart.c
|
||||
F: include/linux/altera_uart.h
|
||||
F: include/linux/altera_jtaguart.h
|
||||
|
||||
AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER
|
||||
M: Thomas Dahlmann <dahlmann.thomas@arcor.de>
|
||||
L: linux-geode@lists.infradead.org (moderated for non-subscribers)
|
||||
@ -557,6 +567,13 @@ S: Maintained
|
||||
F: drivers/net/appletalk/
|
||||
F: net/appletalk/
|
||||
|
||||
ARASAN COMPACT FLASH PATA CONTROLLER
|
||||
M: Viresh Kumar <viresh.kumar@st.com>
|
||||
L: linux-ide@vger.kernel.org
|
||||
S: Maintained
|
||||
F: include/linux/pata_arasan_cf_data.h
|
||||
F: drivers/ata/pata_arasan_cf.c
|
||||
|
||||
ARC FRAMEBUFFER DRIVER
|
||||
M: Jaya Kumar <jayalk@intworks.biz>
|
||||
S: Maintained
|
||||
@ -1214,7 +1231,7 @@ ATHEROS AR9170 WIRELESS DRIVER
|
||||
M: Christian Lamparter <chunkeey@web.de>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
W: http://wireless.kernel.org/en/users/Drivers/ar9170
|
||||
S: Maintained
|
||||
S: Obsolete
|
||||
F: drivers/net/wireless/ath/ar9170/
|
||||
|
||||
CARL9170 LINUX COMMUNITY WIRELESS DRIVER
|
||||
@ -1710,6 +1727,7 @@ S: Maintained
|
||||
F: Documentation/zh_CN/
|
||||
|
||||
CISCO VIC ETHERNET NIC DRIVER
|
||||
M: Christian Benvenuti <benve@cisco.com>
|
||||
M: Vasanthy Kolluri <vkolluri@cisco.com>
|
||||
M: Roopa Prabhu <roprabhu@cisco.com>
|
||||
M: David Wang <dwang2@cisco.com>
|
||||
@ -2826,7 +2844,7 @@ F: mm/hwpoison-inject.c
|
||||
HYPERVISOR VIRTUAL CONSOLE DRIVER
|
||||
L: linuxppc-dev@lists.ozlabs.org
|
||||
S: Odd Fixes
|
||||
F: drivers/char/hvc_*
|
||||
F: drivers/tty/hvc/
|
||||
|
||||
iSCSI BOOT FIRMWARE TABLE (iBFT) DRIVER
|
||||
M: Peter Jones <pjones@redhat.com>
|
||||
@ -3441,7 +3459,7 @@ M: Jiri Kosina <jkosina@suse.cz>
|
||||
M: David Sterba <dsterba@suse.cz>
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/ipwireless_cs.git
|
||||
F: drivers/char/pcmcia/ipwireless/
|
||||
F: drivers/tty/ipwireless/
|
||||
|
||||
IPX NETWORK LAYER
|
||||
M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
|
||||
@ -3596,12 +3614,6 @@ W: http://lse.sourceforge.net/kdump/
|
||||
S: Maintained
|
||||
F: Documentation/kdump/
|
||||
|
||||
KERNEL AUTOMOUNTER (AUTOFS)
|
||||
M: "H. Peter Anvin" <hpa@zytor.com>
|
||||
L: autofs@linux.kernel.org
|
||||
S: Obsolete
|
||||
F: drivers/staging/autofs/
|
||||
|
||||
KERNEL AUTOMOUNTER v4 (AUTOFS4)
|
||||
M: Ian Kent <raven@themaw.net>
|
||||
L: autofs@linux.kernel.org
|
||||
@ -4292,10 +4304,7 @@ S: Maintained
|
||||
F: net/sched/sch_netem.c
|
||||
|
||||
NETERION 10GbE DRIVERS (s2io/vxge)
|
||||
M: Ramkrishna Vepa <ramkrishna.vepa@exar.com>
|
||||
M: Sivakumar Subramani <sivakumar.subramani@exar.com>
|
||||
M: Sreenivasa Honnur <sreenivasa.honnur@exar.com>
|
||||
M: Jon Mason <jon.mason@exar.com>
|
||||
M: Jon Mason <jdmason@kudzu.us>
|
||||
L: netdev@vger.kernel.org
|
||||
W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/Linux?Anonymous
|
||||
W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/X3100Linux?Anonymous
|
||||
@ -4898,6 +4907,15 @@ S: Maintained
|
||||
F: drivers/block/pktcdvd.c
|
||||
F: include/linux/pktcdvd.h
|
||||
|
||||
PKUNITY SOC DRIVERS
|
||||
M: Guan Xuetao <gxt@mprc.pku.edu.cn>
|
||||
W: http://mprc.pku.edu.cn/~guanxuetao/linux
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32.git
|
||||
F: drivers/input/serio/i8042-unicore32io.h
|
||||
F: drivers/i2c/busses/i2c-puv3.c
|
||||
F: drivers/video/fb-puv3.c
|
||||
|
||||
PMC SIERRA MaxRAID DRIVER
|
||||
M: Anil Ravindranath <anil_ravindranath@pmc-sierra.com>
|
||||
L: linux-scsi@vger.kernel.org
|
||||
@ -5161,6 +5179,7 @@ RALINK RT2X00 WIRELESS LAN DRIVER
|
||||
P: rt2x00 project
|
||||
M: Ivo van Doorn <IvDoorn@gmail.com>
|
||||
M: Gertjan van Wingerde <gwingerde@gmail.com>
|
||||
M: Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
L: users@rt2x00.serialmonkey.com (moderated for non-subscribers)
|
||||
W: http://rt2x00.serialmonkey.com/
|
||||
@ -6084,13 +6103,11 @@ F: sound/soc/codecs/twl4030*
|
||||
TIPC NETWORK LAYER
|
||||
M: Jon Maloy <jon.maloy@ericsson.com>
|
||||
M: Allan Stephens <allan.stephens@windriver.com>
|
||||
L: tipc-discussion@lists.sourceforge.net
|
||||
L: netdev@vger.kernel.org (core kernel code)
|
||||
L: tipc-discussion@lists.sourceforge.net (user apps, general discussion)
|
||||
W: http://tipc.sourceforge.net/
|
||||
W: http://tipc.cslab.ericsson.net/
|
||||
T: git git://tipc.cslab.ericsson.net/pub/git/tipc.git
|
||||
S: Maintained
|
||||
F: include/linux/tipc*.h
|
||||
F: include/net/tipc/
|
||||
F: net/tipc/
|
||||
|
||||
TILE ARCHITECTURE
|
||||
@ -6098,7 +6115,7 @@ M: Chris Metcalf <cmetcalf@tilera.com>
|
||||
W: http://www.tilera.com/scm/
|
||||
S: Supported
|
||||
F: arch/tile/
|
||||
F: drivers/char/hvc_tile.c
|
||||
F: drivers/tty/hvc/hvc_tile.c
|
||||
F: drivers/net/tile/
|
||||
|
||||
TLAN NETWORK DRIVER
|
||||
@ -6262,6 +6279,13 @@ F: drivers/uwb/
|
||||
F: include/linux/uwb.h
|
||||
F: include/linux/uwb/
|
||||
|
||||
UNICORE32 ARCHITECTURE:
|
||||
M: Guan Xuetao <gxt@mprc.pku.edu.cn>
|
||||
W: http://mprc.pku.edu.cn/~guanxuetao/linux
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32.git
|
||||
F: arch/unicore32/
|
||||
|
||||
UNIFDEF
|
||||
M: Tony Finch <dot@dotat.at>
|
||||
W: http://dotat.at/prog/unifdef
|
||||
|
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
VERSION = 2
|
||||
PATCHLEVEL = 6
|
||||
SUBLEVEL = 38
|
||||
EXTRAVERSION = -rc8
|
||||
EXTRAVERSION =
|
||||
NAME = Flesh-Eating Bats with Fangs
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
@ -31,6 +31,8 @@
|
||||
#define __O_SYNC 020000000
|
||||
#define O_SYNC (__O_SYNC|O_DSYNC)
|
||||
|
||||
#define O_PATH 040000000
|
||||
|
||||
#define F_GETLK 7
|
||||
#define F_SETLK 8
|
||||
#define F_SETLKW 9
|
||||
|
@ -29,7 +29,7 @@
|
||||
: "r" (uaddr), "r"(oparg) \
|
||||
: "memory")
|
||||
|
||||
static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
|
||||
static inline int futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
|
||||
{
|
||||
int op = (encoded_op >> 28) & 7;
|
||||
int cmp = (encoded_op >> 24) & 15;
|
||||
@ -39,7 +39,7 @@ static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
|
||||
if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
|
||||
oparg = 1 << oparg;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
|
||||
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
|
||||
return -EFAULT;
|
||||
|
||||
pagefault_disable();
|
||||
@ -81,21 +81,23 @@ static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
|
||||
}
|
||||
|
||||
static inline int
|
||||
futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
|
||||
futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
|
||||
u32 oldval, u32 newval)
|
||||
{
|
||||
int prev, cmp;
|
||||
int ret = 0, cmp;
|
||||
u32 prev;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
|
||||
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
|
||||
return -EFAULT;
|
||||
|
||||
__asm__ __volatile__ (
|
||||
__ASM_SMP_MB
|
||||
"1: ldl_l %0,0(%2)\n"
|
||||
" cmpeq %0,%3,%1\n"
|
||||
" beq %1,3f\n"
|
||||
" mov %4,%1\n"
|
||||
"2: stl_c %1,0(%2)\n"
|
||||
" beq %1,4f\n"
|
||||
"1: ldl_l %1,0(%3)\n"
|
||||
" cmpeq %1,%4,%2\n"
|
||||
" beq %2,3f\n"
|
||||
" mov %5,%2\n"
|
||||
"2: stl_c %2,0(%3)\n"
|
||||
" beq %2,4f\n"
|
||||
"3: .subsection 2\n"
|
||||
"4: br 1b\n"
|
||||
" .previous\n"
|
||||
@ -105,11 +107,12 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
|
||||
" .long 2b-.\n"
|
||||
" lda $31,3b-2b(%0)\n"
|
||||
" .previous\n"
|
||||
: "=&r"(prev), "=&r"(cmp)
|
||||
: "+r"(ret), "=&r"(prev), "=&r"(cmp)
|
||||
: "r"(uaddr), "r"((long)oldval), "r"(newval)
|
||||
: "memory");
|
||||
|
||||
return prev;
|
||||
*uval = prev;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
@ -94,6 +94,7 @@
|
||||
#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
|
||||
#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
|
||||
#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
|
||||
#define TIOCVHANGUP 0x5437
|
||||
|
||||
#define TIOCSERCONFIG 0x5453
|
||||
#define TIOCSERGWILD 0x5454
|
||||
|
@ -13,44 +13,13 @@
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/spinlock.h>
|
||||
|
||||
struct rwsem_waiter;
|
||||
|
||||
extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem);
|
||||
extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
|
||||
extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *);
|
||||
extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
|
||||
|
||||
/*
|
||||
* the semaphore definition
|
||||
*/
|
||||
struct rw_semaphore {
|
||||
long count;
|
||||
#define RWSEM_UNLOCKED_VALUE 0x0000000000000000L
|
||||
#define RWSEM_ACTIVE_BIAS 0x0000000000000001L
|
||||
#define RWSEM_ACTIVE_MASK 0x00000000ffffffffL
|
||||
#define RWSEM_WAITING_BIAS (-0x0000000100000000L)
|
||||
#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
|
||||
#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
|
||||
spinlock_t wait_lock;
|
||||
struct list_head wait_list;
|
||||
};
|
||||
|
||||
#define __RWSEM_INITIALIZER(name) \
|
||||
{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
|
||||
LIST_HEAD_INIT((name).wait_list) }
|
||||
|
||||
#define DECLARE_RWSEM(name) \
|
||||
struct rw_semaphore name = __RWSEM_INITIALIZER(name)
|
||||
|
||||
static inline void init_rwsem(struct rw_semaphore *sem)
|
||||
{
|
||||
sem->count = RWSEM_UNLOCKED_VALUE;
|
||||
spin_lock_init(&sem->wait_lock);
|
||||
INIT_LIST_HEAD(&sem->wait_list);
|
||||
}
|
||||
|
||||
static inline void __down_read(struct rw_semaphore *sem)
|
||||
{
|
||||
@ -250,10 +219,5 @@ static inline long rwsem_atomic_update(long val, struct rw_semaphore *sem)
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline int rwsem_is_locked(struct rw_semaphore *sem)
|
||||
{
|
||||
return (sem->count != 0);
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _ALPHA_RWSEM_H */
|
||||
|
@ -230,44 +230,24 @@ linux_to_osf_statfs(struct kstatfs *linux_stat, struct osf_statfs __user *osf_st
|
||||
return copy_to_user(osf_stat, &tmp_stat, bufsiz) ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
static int
|
||||
do_osf_statfs(struct path *path, struct osf_statfs __user *buffer,
|
||||
unsigned long bufsiz)
|
||||
SYSCALL_DEFINE3(osf_statfs, const char __user *, pathname,
|
||||
struct osf_statfs __user *, buffer, unsigned long, bufsiz)
|
||||
{
|
||||
struct kstatfs linux_stat;
|
||||
int error = vfs_statfs(path, &linux_stat);
|
||||
int error = user_statfs(pathname, &linux_stat);
|
||||
if (!error)
|
||||
error = linux_to_osf_statfs(&linux_stat, buffer, bufsiz);
|
||||
return error;
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE3(osf_statfs, const char __user *, pathname,
|
||||
struct osf_statfs __user *, buffer, unsigned long, bufsiz)
|
||||
{
|
||||
struct path path;
|
||||
int retval;
|
||||
|
||||
retval = user_path(pathname, &path);
|
||||
if (!retval) {
|
||||
retval = do_osf_statfs(&path, buffer, bufsiz);
|
||||
path_put(&path);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE3(osf_fstatfs, unsigned long, fd,
|
||||
struct osf_statfs __user *, buffer, unsigned long, bufsiz)
|
||||
{
|
||||
struct file *file;
|
||||
int retval;
|
||||
|
||||
retval = -EBADF;
|
||||
file = fget(fd);
|
||||
if (file) {
|
||||
retval = do_osf_statfs(&file->f_path, buffer, bufsiz);
|
||||
fput(file);
|
||||
}
|
||||
return retval;
|
||||
struct kstatfs linux_stat;
|
||||
int error = fd_statfs(fd, &linux_stat);
|
||||
if (!error)
|
||||
error = linux_to_osf_statfs(&linux_stat, buffer, bufsiz);
|
||||
return error;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -149,6 +149,7 @@ static int
|
||||
titan_set_irq_affinity(struct irq_data *d, const struct cpumask *affinity,
|
||||
bool force)
|
||||
{
|
||||
unsigned int irq = d->irq;
|
||||
spin_lock(&titan_irq_lock);
|
||||
titan_cpu_set_irq_affinity(irq - 16, *affinity);
|
||||
titan_update_irq_hw(titan_cached_irq_mask);
|
||||
|
@ -159,7 +159,7 @@ void read_persistent_clock(struct timespec *ts)
|
||||
|
||||
/*
|
||||
* timer_interrupt() needs to keep up the real-time clock,
|
||||
* as well as call the "do_timer()" routine every clocktick
|
||||
* as well as call the "xtime_update()" routine every clocktick
|
||||
*/
|
||||
irqreturn_t timer_interrupt(int irq, void *dev)
|
||||
{
|
||||
@ -172,8 +172,6 @@ irqreturn_t timer_interrupt(int irq, void *dev)
|
||||
profile_tick(CPU_PROFILING);
|
||||
#endif
|
||||
|
||||
write_seqlock(&xtime_lock);
|
||||
|
||||
/*
|
||||
* Calculate how many ticks have passed since the last update,
|
||||
* including any previous partial leftover. Save any resulting
|
||||
@ -187,9 +185,7 @@ irqreturn_t timer_interrupt(int irq, void *dev)
|
||||
nticks = delta >> FIX_SHIFT;
|
||||
|
||||
if (nticks)
|
||||
do_timer(nticks);
|
||||
|
||||
write_sequnlock(&xtime_lock);
|
||||
xtime_update(nticks);
|
||||
|
||||
if (test_irq_work_pending()) {
|
||||
clear_irq_work_pending();
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <asm-generic/vmlinux.lds.h>
|
||||
#include <asm/thread_info.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
OUTPUT_FORMAT("elf64-alpha")
|
||||
@ -38,7 +39,7 @@ SECTIONS
|
||||
__init_begin = ALIGN(PAGE_SIZE);
|
||||
INIT_TEXT_SECTION(PAGE_SIZE)
|
||||
INIT_DATA_SECTION(16)
|
||||
PERCPU(PAGE_SIZE)
|
||||
PERCPU(L1_CACHE_BYTES, PAGE_SIZE)
|
||||
/* Align to THREAD_SIZE rather than PAGE_SIZE here so any padding page
|
||||
needed for the THREAD_SIZE aligned init_task gets freed after init */
|
||||
. = ALIGN(THREAD_SIZE);
|
||||
@ -46,7 +47,7 @@ SECTIONS
|
||||
/* Freed after init ends here */
|
||||
|
||||
_data = .;
|
||||
RW_DATA_SECTION(64, PAGE_SIZE, THREAD_SIZE)
|
||||
RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
|
||||
|
||||
.got : {
|
||||
*(.got)
|
||||
|
158
arch/arm/Kconfig
158
arch/arm/Kconfig
@ -7,7 +7,7 @@ config ARM
|
||||
select HAVE_MEMBLOCK
|
||||
select RTC_LIB
|
||||
select SYS_SUPPORTS_APM_EMULATION
|
||||
select GENERIC_ATOMIC64 if (!CPU_32v6K || !AEABI)
|
||||
select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
|
||||
select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
|
||||
select HAVE_ARCH_KGDB
|
||||
select HAVE_KPROBES if (!XIP_KERNEL && !THUMB2_KERNEL)
|
||||
@ -24,7 +24,7 @@ config ARM
|
||||
select HAVE_PERF_EVENTS
|
||||
select PERF_USE_VMALLOC
|
||||
select HAVE_REGS_AND_STACK_ACCESS_API
|
||||
select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V7))
|
||||
select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
|
||||
select HAVE_C_RECORDMCOUNT
|
||||
select HAVE_GENERIC_HARDIRQS
|
||||
select HAVE_SPARSE_IRQ
|
||||
@ -63,6 +63,10 @@ config GENERIC_CLOCKEVENTS_BROADCAST
|
||||
depends on GENERIC_CLOCKEVENTS
|
||||
default y if SMP
|
||||
|
||||
config KTIME_SCALAR
|
||||
bool
|
||||
default y
|
||||
|
||||
config HAVE_TCM
|
||||
bool
|
||||
select GENERIC_ALLOCATOR
|
||||
@ -178,11 +182,6 @@ config FIQ
|
||||
config ARCH_MTD_XIP
|
||||
bool
|
||||
|
||||
config ARM_L1_CACHE_SHIFT_6
|
||||
bool
|
||||
help
|
||||
Setting ARM L1 cache line size to 64 Bytes.
|
||||
|
||||
config VECTORS_BASE
|
||||
hex
|
||||
default 0xffff0000 if MMU || CPU_HIGH_VECTOR
|
||||
@ -191,6 +190,22 @@ config VECTORS_BASE
|
||||
help
|
||||
The base address of exception vectors.
|
||||
|
||||
config ARM_PATCH_PHYS_VIRT
|
||||
bool "Patch physical to virtual translations at runtime (EXPERIMENTAL)"
|
||||
depends on EXPERIMENTAL
|
||||
depends on !XIP_KERNEL && MMU
|
||||
depends on !ARCH_REALVIEW || !SPARSEMEM
|
||||
help
|
||||
Patch phys-to-virt translation functions at runtime according to
|
||||
the position of the kernel in system memory.
|
||||
|
||||
This can only be used with non-XIP with MMU kernels where
|
||||
the base of physical memory is at a 16MB boundary.
|
||||
|
||||
config ARM_PATCH_PHYS_VIRT_16BIT
|
||||
def_bool y
|
||||
depends on ARM_PATCH_PHYS_VIRT && ARCH_MSM
|
||||
|
||||
source "init/Kconfig"
|
||||
|
||||
source "kernel/Kconfig.freezer"
|
||||
@ -212,15 +227,6 @@ choice
|
||||
prompt "ARM system type"
|
||||
default ARCH_VERSATILE
|
||||
|
||||
config ARCH_AAEC2000
|
||||
bool "Agilent AAEC-2000 based"
|
||||
select CPU_ARM920T
|
||||
select ARM_AMBA
|
||||
select HAVE_CLK
|
||||
select ARCH_USES_GETTIMEOFFSET
|
||||
help
|
||||
This enables support for systems based on the Agilent AAEC-2000
|
||||
|
||||
config ARCH_INTEGRATOR
|
||||
bool "ARM Ltd. Integrator family"
|
||||
select ARM_AMBA
|
||||
@ -346,7 +352,7 @@ config ARCH_FOOTBRIDGE
|
||||
bool "FootBridge"
|
||||
select CPU_SA110
|
||||
select FOOTBRIDGE
|
||||
select ARCH_USES_GETTIMEOFFSET
|
||||
select GENERIC_CLOCKEVENTS
|
||||
help
|
||||
Support for systems based on the DC21285 companion chip
|
||||
("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
|
||||
@ -457,6 +463,7 @@ config ARCH_IXP4XX
|
||||
|
||||
config ARCH_DOVE
|
||||
bool "Marvell Dove"
|
||||
select CPU_V6K
|
||||
select PCI
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select GENERIC_CLOCKEVENTS
|
||||
@ -795,17 +802,6 @@ config ARCH_TCC_926
|
||||
help
|
||||
Support for Telechips TCC ARM926-based systems.
|
||||
|
||||
config ARCH_LH7A40X
|
||||
bool "Sharp LH7A40X"
|
||||
select CPU_ARM922T
|
||||
select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM
|
||||
select ARCH_USES_GETTIMEOFFSET
|
||||
help
|
||||
Say Y here for systems based on one of the Sharp LH7A40X
|
||||
System on a Chip processors. These CPUs include an ARM922T
|
||||
core with a wide array of integrated devices for
|
||||
hand-held and low-power applications.
|
||||
|
||||
config ARCH_U300
|
||||
bool "ST-Ericsson U300 Series"
|
||||
depends on MMU
|
||||
@ -875,6 +871,16 @@ config PLAT_SPEAR
|
||||
help
|
||||
Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
|
||||
|
||||
config ARCH_VT8500
|
||||
bool "VIA/WonderMedia 85xx"
|
||||
select CPU_ARM926T
|
||||
select GENERIC_GPIO
|
||||
select ARCH_HAS_CPUFREQ
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select HAVE_PWM
|
||||
help
|
||||
Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
|
||||
endchoice
|
||||
|
||||
#
|
||||
@ -882,8 +888,6 @@ endchoice
|
||||
# Kconfigs may be included either alphabetically (according to the
|
||||
# plat- suffix) or along side the corresponding mach-* source.
|
||||
#
|
||||
source "arch/arm/mach-aaec2000/Kconfig"
|
||||
|
||||
source "arch/arm/mach-at91/Kconfig"
|
||||
|
||||
source "arch/arm/mach-bcmring/Kconfig"
|
||||
@ -922,8 +926,6 @@ source "arch/arm/mach-kirkwood/Kconfig"
|
||||
|
||||
source "arch/arm/mach-ks8695/Kconfig"
|
||||
|
||||
source "arch/arm/mach-lh7a40x/Kconfig"
|
||||
|
||||
source "arch/arm/mach-loki/Kconfig"
|
||||
|
||||
source "arch/arm/mach-lpc32xx/Kconfig"
|
||||
@ -1007,6 +1009,8 @@ source "arch/arm/mach-versatile/Kconfig"
|
||||
|
||||
source "arch/arm/mach-vexpress/Kconfig"
|
||||
|
||||
source "arch/arm/mach-vt8500/Kconfig"
|
||||
|
||||
source "arch/arm/mach-w90x900/Kconfig"
|
||||
|
||||
# Definitions to make life easier
|
||||
@ -1048,7 +1052,7 @@ config XSCALE_PMU
|
||||
default y
|
||||
|
||||
config CPU_HAS_PMU
|
||||
depends on (CPU_V6 || CPU_V7 || XSCALE_PMU) && \
|
||||
depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \
|
||||
(!ARCH_OMAP3 || OMAP3_EMU)
|
||||
default y
|
||||
bool
|
||||
@ -1064,7 +1068,7 @@ endif
|
||||
|
||||
config ARM_ERRATA_411920
|
||||
bool "ARM errata: Invalidation of the Instruction Cache operation can fail"
|
||||
depends on CPU_V6
|
||||
depends on CPU_V6 || CPU_V6K
|
||||
help
|
||||
Invalidation of the Instruction Cache operation can
|
||||
fail. This erratum is present in 1136 (before r1p4), 1156 and 1176.
|
||||
@ -1140,7 +1144,7 @@ config ARM_ERRATA_742231
|
||||
|
||||
config PL310_ERRATA_588369
|
||||
bool "Clean & Invalidate maintenance operations do not invalidate clean lines"
|
||||
depends on CACHE_L2X0 && ARCH_OMAP4
|
||||
depends on CACHE_L2X0
|
||||
help
|
||||
The PL310 L2 cache controller implements three types of Clean &
|
||||
Invalidate maintenance operations: by Physical Address
|
||||
@ -1149,8 +1153,7 @@ config PL310_ERRATA_588369
|
||||
clean operation followed immediately by an invalidate operation,
|
||||
both performing to the same memory location. This functionality
|
||||
is not correctly implemented in PL310 as clean lines are not
|
||||
invalidated as a result of these operations. Note that this errata
|
||||
uses Texas Instrument's secure monitor api.
|
||||
invalidated as a result of these operations.
|
||||
|
||||
config ARM_ERRATA_720789
|
||||
bool "ARM errata: TLBIASIDIS and TLBIMVAIS operations can broadcast a faulty ASID"
|
||||
@ -1164,6 +1167,17 @@ config ARM_ERRATA_720789
|
||||
tables. The workaround changes the TLB flushing routines to invalidate
|
||||
entries regardless of the ASID.
|
||||
|
||||
config PL310_ERRATA_727915
|
||||
bool "Background Clean & Invalidate by Way operation can cause data corruption"
|
||||
depends on CACHE_L2X0
|
||||
help
|
||||
PL310 implements the Clean & Invalidate by Way L2 cache maintenance
|
||||
operation (offset 0x7FC). This operation runs in background so that
|
||||
PL310 can handle normal accesses while it is in progress. Under very
|
||||
rare circumstances, due to this erratum, write data can be lost when
|
||||
PL310 treats a cacheable write transaction during a Clean &
|
||||
Invalidate by Way operation.
|
||||
|
||||
config ARM_ERRATA_743622
|
||||
bool "ARM errata: Faulty hazard checking in the Store Buffer may lead to data corruption"
|
||||
depends on CPU_V7
|
||||
@ -1202,6 +1216,28 @@ config ARM_ERRATA_753970
|
||||
This has the same effect as the cache sync operation: store buffer
|
||||
drain and waiting for all buffers empty.
|
||||
|
||||
config ARM_ERRATA_754322
|
||||
bool "ARM errata: possible faulty MMU translations following an ASID switch"
|
||||
depends on CPU_V7
|
||||
help
|
||||
This option enables the workaround for the 754322 Cortex-A9 (r2p*,
|
||||
r3p*) erratum. A speculative memory access may cause a page table walk
|
||||
which starts prior to an ASID switch but completes afterwards. This
|
||||
can populate the micro-TLB with a stale entry which may be hit with
|
||||
the new ASID. This workaround places two dsb instructions in the mm
|
||||
switching code so that no page table walks can cross the ASID switch.
|
||||
|
||||
config ARM_ERRATA_754327
|
||||
bool "ARM errata: no automatic Store Buffer drain"
|
||||
depends on CPU_V7 && SMP
|
||||
help
|
||||
This option enables the workaround for the 754327 Cortex-A9 (prior to
|
||||
r2p0) erratum. The Store Buffer does not have any automatic draining
|
||||
mechanism and therefore a livelock may occur if an external agent
|
||||
continuously polls a memory location waiting to observe an update.
|
||||
This workaround defines cpu_relax() as smp_mb(), preventing correctly
|
||||
written polling loops from denying visibility of updates to memory.
|
||||
|
||||
endmenu
|
||||
|
||||
source "arch/arm/common/Kconfig"
|
||||
@ -1275,6 +1311,7 @@ source "kernel/time/Kconfig"
|
||||
config SMP
|
||||
bool "Symmetric Multi-Processing (EXPERIMENTAL)"
|
||||
depends on EXPERIMENTAL
|
||||
depends on CPU_V6K || CPU_V7
|
||||
depends on GENERIC_CLOCKEVENTS
|
||||
depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \
|
||||
MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \
|
||||
@ -1386,7 +1423,7 @@ config HZ
|
||||
|
||||
config THUMB2_KERNEL
|
||||
bool "Compile the kernel in Thumb-2 mode (EXPERIMENTAL)"
|
||||
depends on CPU_V7 && !CPU_V6 && EXPERIMENTAL
|
||||
depends on CPU_V7 && !CPU_V6 && !CPU_V6K && EXPERIMENTAL
|
||||
select AEABI
|
||||
select ARM_ASM_UNIFIED
|
||||
help
|
||||
@ -1396,6 +1433,37 @@ config THUMB2_KERNEL
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config THUMB2_AVOID_R_ARM_THM_JUMP11
|
||||
bool "Work around buggy Thumb-2 short branch relocations in gas"
|
||||
depends on THUMB2_KERNEL && MODULES
|
||||
default y
|
||||
help
|
||||
Various binutils versions can resolve Thumb-2 branches to
|
||||
locally-defined, preemptible global symbols as short-range "b.n"
|
||||
branch instructions.
|
||||
|
||||
This is a problem, because there's no guarantee the final
|
||||
destination of the symbol, or any candidate locations for a
|
||||
trampoline, are within range of the branch. For this reason, the
|
||||
kernel does not support fixing up the R_ARM_THM_JUMP11 (102)
|
||||
relocation in modules at all, and it makes little sense to add
|
||||
support.
|
||||
|
||||
The symptom is that the kernel fails with an "unsupported
|
||||
relocation" error when loading some modules.
|
||||
|
||||
Until fixed tools are available, passing
|
||||
-fno-optimize-sibling-calls to gcc should prevent gcc generating
|
||||
code which hits this problem, at the cost of a bit of extra runtime
|
||||
stack usage in some cases.
|
||||
|
||||
The problem is described in more detail at:
|
||||
https://bugs.launchpad.net/binutils-linaro/+bug/725126
|
||||
|
||||
Only Thumb-2 kernels are affected.
|
||||
|
||||
Unless you are sure your tools don't have this problem, say Y.
|
||||
|
||||
config ARM_ASM_UNIFIED
|
||||
bool
|
||||
|
||||
@ -1644,6 +1712,18 @@ config ZBOOT_ROM
|
||||
Say Y here if you intend to execute your compressed kernel image
|
||||
(zImage) directly from ROM or flash. If unsure, say N.
|
||||
|
||||
config ZBOOT_ROM_MMCIF
|
||||
bool "Include MMCIF loader in zImage (EXPERIMENTAL)"
|
||||
depends on ZBOOT_ROM && ARCH_SH7372 && EXPERIMENTAL
|
||||
help
|
||||
Say Y here to include experimental MMCIF loading code in the
|
||||
ROM-able zImage. With this enabled it is possible to write the
|
||||
the ROM-able zImage kernel image to an MMC card and boot the
|
||||
kernel straight from the reset vector. At reset the processor
|
||||
Mask ROM will load the first part of the the ROM-able zImage
|
||||
which in turn loads the rest the kernel image to RAM using the
|
||||
MMCIF hardware block.
|
||||
|
||||
config CMDLINE
|
||||
string "Default kernel command string"
|
||||
default ""
|
||||
@ -1877,7 +1957,7 @@ config FPE_FASTFPE
|
||||
|
||||
config VFP
|
||||
bool "VFP-format floating point maths"
|
||||
depends on CPU_V6 || CPU_ARM926T || CPU_V7 || CPU_FEROCEON
|
||||
depends on CPU_V6 || CPU_V6K || CPU_ARM926T || CPU_V7 || CPU_FEROCEON
|
||||
help
|
||||
Say Y to include VFP support code in the kernel. This is needed
|
||||
if your hardware includes a VFP unit.
|
||||
|
@ -89,6 +89,7 @@ tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110)
|
||||
tune-$(CONFIG_CPU_XSC3) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
|
||||
tune-$(CONFIG_CPU_FEROCEON) :=$(call cc-option,-mtune=marvell-f,-mtune=xscale)
|
||||
tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
|
||||
tune-$(CONFIG_CPU_V6K) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
|
||||
|
||||
ifeq ($(CONFIG_AEABI),y)
|
||||
CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork
|
||||
@ -105,6 +106,10 @@ AFLAGS_AUTOIT :=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mau
|
||||
AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
|
||||
CFLAGS_THUMB2 :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
|
||||
AFLAGS_THUMB2 :=$(CFLAGS_THUMB2) -Wa$(comma)-mthumb
|
||||
# Work around buggy relocation from gas if requested:
|
||||
ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y)
|
||||
CFLAGS_MODULE +=-fno-optimize-sibling-calls
|
||||
endif
|
||||
endif
|
||||
|
||||
# Need -Uarm for gcc < 3.x
|
||||
@ -126,7 +131,6 @@ endif
|
||||
|
||||
# Machine directory name. This list is sorted alphanumerically
|
||||
# by CONFIG_* macro name.
|
||||
machine-$(CONFIG_ARCH_AAEC2000) := aaec2000
|
||||
machine-$(CONFIG_ARCH_AT91) := at91
|
||||
machine-$(CONFIG_ARCH_BCMRING) := bcmring
|
||||
machine-$(CONFIG_ARCH_CLPS711X) := clps711x
|
||||
@ -146,7 +150,6 @@ machine-$(CONFIG_ARCH_IXP23XX) := ixp23xx
|
||||
machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx
|
||||
machine-$(CONFIG_ARCH_KIRKWOOD) := kirkwood
|
||||
machine-$(CONFIG_ARCH_KS8695) := ks8695
|
||||
machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x
|
||||
machine-$(CONFIG_ARCH_LOKI) := loki
|
||||
machine-$(CONFIG_ARCH_LPC32XX) := lpc32xx
|
||||
machine-$(CONFIG_ARCH_MMP) := mmp
|
||||
@ -190,6 +193,7 @@ machine-$(CONFIG_ARCH_U300) := u300
|
||||
machine-$(CONFIG_ARCH_U8500) := ux500
|
||||
machine-$(CONFIG_ARCH_VERSATILE) := versatile
|
||||
machine-$(CONFIG_ARCH_VEXPRESS) := vexpress
|
||||
machine-$(CONFIG_ARCH_VT8500) := vt8500
|
||||
machine-$(CONFIG_ARCH_W90X900) := w90x900
|
||||
machine-$(CONFIG_ARCH_NUC93X) := nuc93x
|
||||
machine-$(CONFIG_FOOTBRIDGE) := footbridge
|
||||
@ -280,7 +284,7 @@ bzImage: zImage
|
||||
zImage Image xipImage bootpImage uImage: vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
|
||||
|
||||
zinstall install: vmlinux
|
||||
zinstall uinstall install: vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
|
||||
|
||||
# We use MRPROPER_FILES and CLEAN_FILES now
|
||||
@ -301,6 +305,7 @@ define archhelp
|
||||
echo ' (supply initrd image via make variable INITRD=<path>)'
|
||||
echo ' install - Install uncompressed kernel'
|
||||
echo ' zinstall - Install compressed kernel'
|
||||
echo ' uinstall - Install U-Boot wrapped compressed kernel'
|
||||
echo ' Install using (your) ~/bin/$(INSTALLKERNEL) or'
|
||||
echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
|
||||
echo ' install to $$(INSTALL_PATH) and run lilo'
|
||||
|
@ -99,6 +99,10 @@ zinstall: $(obj)/zImage
|
||||
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
|
||||
$(obj)/zImage System.map "$(INSTALL_PATH)"
|
||||
|
||||
uinstall: $(obj)/uImage
|
||||
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
|
||||
$(obj)/uImage System.map "$(INSTALL_PATH)"
|
||||
|
||||
zi:
|
||||
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
|
||||
$(obj)/zImage System.map "$(INSTALL_PATH)"
|
||||
|
@ -4,9 +4,20 @@
|
||||
# create a compressed vmlinuz image from the original vmlinux
|
||||
#
|
||||
|
||||
OBJS =
|
||||
|
||||
# Ensure that mmcif loader code appears early in the image
|
||||
# to minimise that number of bocks that have to be read in
|
||||
# order to load it.
|
||||
ifeq ($(CONFIG_ZBOOT_ROM_MMCIF),y)
|
||||
ifeq ($(CONFIG_ARCH_SH7372),y)
|
||||
OBJS += mmcif-sh7372.o
|
||||
endif
|
||||
endif
|
||||
|
||||
AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
|
||||
HEAD = head.o
|
||||
OBJS = misc.o decompress.o
|
||||
OBJS += misc.o decompress.o
|
||||
FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c
|
||||
|
||||
#
|
||||
@ -29,6 +40,10 @@ ifeq ($(CONFIG_ARCH_SA1100),y)
|
||||
OBJS += head-sa1100.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_VT8500),y)
|
||||
OBJS += head-vt8500.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CPU_XSCALE),y)
|
||||
OBJS += head-xscale.o
|
||||
endif
|
||||
@ -83,9 +98,11 @@ endif
|
||||
EXTRA_CFLAGS := -fpic -fno-builtin
|
||||
EXTRA_AFLAGS := -Wa,-march=all
|
||||
|
||||
# Provide size of uncompressed kernel to the decompressor via a linker symbol.
|
||||
LDFLAGS_vmlinux = --defsym _image_size=$(shell stat -c "%s" $(obj)/../Image)
|
||||
# Supply ZRELADDR to the decompressor via a linker symbol.
|
||||
ifneq ($(CONFIG_AUTO_ZRELADDR),y)
|
||||
LDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
|
||||
LDFLAGS_vmlinux += --defsym zreladdr=$(ZRELADDR)
|
||||
endif
|
||||
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
|
||||
LDFLAGS_vmlinux += --be8
|
||||
|
@ -25,6 +25,36 @@
|
||||
/* load board-specific initialization code */
|
||||
#include <mach/zboot.h>
|
||||
|
||||
#ifdef CONFIG_ZBOOT_ROM_MMCIF
|
||||
/* Load image from MMC */
|
||||
adr sp, __tmp_stack + 128
|
||||
ldr r0, __image_start
|
||||
ldr r1, __image_end
|
||||
subs r1, r1, r0
|
||||
ldr r0, __load_base
|
||||
bl mmcif_loader
|
||||
|
||||
/* Jump to loaded code */
|
||||
ldr r0, __loaded
|
||||
ldr r1, __image_start
|
||||
sub r0, r0, r1
|
||||
ldr r1, __load_base
|
||||
add pc, r0, r1
|
||||
|
||||
__image_start:
|
||||
.long _start
|
||||
__image_end:
|
||||
.long _got_end
|
||||
__load_base:
|
||||
.long CONFIG_MEMORY_START + 0x02000000 @ Load at 32Mb into SDRAM
|
||||
__loaded:
|
||||
.long __continue
|
||||
.align
|
||||
__tmp_stack:
|
||||
.space 128
|
||||
__continue:
|
||||
#endif /* CONFIG_ZBOOT_ROM_MMCIF */
|
||||
|
||||
b 1f
|
||||
__atags:@ tag #1
|
||||
.long 12 @ tag->hdr.size = tag_size(tag_core);
|
||||
|
46
arch/arm/boot/compressed/head-vt8500.S
Normal file
46
arch/arm/boot/compressed/head-vt8500.S
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* linux/arch/arm/boot/compressed/head-vt8500.S
|
||||
*
|
||||
* Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
|
||||
*
|
||||
* VIA VT8500 specific tweaks. This is merged into head.S by the linker.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/linkage.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
.section ".start", "ax"
|
||||
|
||||
__VT8500_start:
|
||||
@ Compare the SCC ID register against a list of known values
|
||||
ldr r1, .SCCID
|
||||
ldr r3, [r1]
|
||||
|
||||
@ VT8500 override
|
||||
ldr r4, .VT8500SCC
|
||||
cmp r3, r4
|
||||
ldreq r7, .ID_BV07
|
||||
beq .Lendvt8500
|
||||
|
||||
@ WM8505 override
|
||||
ldr r4, .WM8505SCC
|
||||
cmp r3, r4
|
||||
ldreq r7, .ID_8505
|
||||
beq .Lendvt8500
|
||||
|
||||
@ Otherwise, leave the bootloader's machine id untouched
|
||||
|
||||
.SCCID:
|
||||
.word 0xd8120000
|
||||
.VT8500SCC:
|
||||
.word 0x34000102
|
||||
.WM8505SCC:
|
||||
.word 0x34260103
|
||||
|
||||
.ID_BV07:
|
||||
.word MACH_TYPE_BV07
|
||||
.ID_8505:
|
||||
.word MACH_TYPE_WM8505_7IN_NETBOOK
|
||||
|
||||
.Lendvt8500:
|
@ -21,7 +21,7 @@
|
||||
|
||||
#if defined(CONFIG_DEBUG_ICEDCC)
|
||||
|
||||
#ifdef CONFIG_CPU_V6
|
||||
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
|
||||
.macro loadsp, rb, tmp
|
||||
.endm
|
||||
.macro writeb, ch, rb
|
||||
@ -128,14 +128,14 @@ wait: mrc p14, 0, pc, c0, c1, 0
|
||||
.arm @ Always enter in ARM state
|
||||
start:
|
||||
.type start,#function
|
||||
THUMB( adr r12, BSYM(1f) )
|
||||
THUMB( bx r12 )
|
||||
THUMB( .rept 6 )
|
||||
ARM( .rept 8 )
|
||||
.rept 7
|
||||
mov r0, r0
|
||||
.endr
|
||||
ARM( mov r0, r0 )
|
||||
ARM( b 1f )
|
||||
THUMB( adr r12, BSYM(1f) )
|
||||
THUMB( bx r12 )
|
||||
|
||||
b 1f
|
||||
.word 0x016f2818 @ Magic numbers to help the loader
|
||||
.word start @ absolute load/run zImage address
|
||||
.word _edata @ zImage end address
|
||||
@ -174,9 +174,7 @@ not_angel:
|
||||
*/
|
||||
|
||||
.text
|
||||
adr r0, LC0
|
||||
ldmia r0, {r1, r2, r3, r5, r6, r11, ip}
|
||||
ldr sp, [r0, #28]
|
||||
|
||||
#ifdef CONFIG_AUTO_ZRELADDR
|
||||
@ determine final kernel image address
|
||||
mov r4, pc
|
||||
@ -185,35 +183,108 @@ not_angel:
|
||||
#else
|
||||
ldr r4, =zreladdr
|
||||
#endif
|
||||
subs r0, r0, r1 @ calculate the delta offset
|
||||
|
||||
@ if delta is zero, we are
|
||||
beq not_relocated @ running at the address we
|
||||
@ were linked at.
|
||||
bl cache_on
|
||||
|
||||
restart: adr r0, LC0
|
||||
ldmia r0, {r1, r2, r3, r5, r6, r9, r11, r12}
|
||||
ldr sp, [r0, #32]
|
||||
|
||||
/*
|
||||
* We're running at a different address. We need to fix
|
||||
* up various pointers:
|
||||
* r5 - zImage base address (_start)
|
||||
* r6 - size of decompressed image
|
||||
* r11 - GOT start
|
||||
* ip - GOT end
|
||||
* We might be running at a different address. We need
|
||||
* to fix up various pointers.
|
||||
*/
|
||||
add r5, r5, r0
|
||||
sub r0, r0, r1 @ calculate the delta offset
|
||||
add r5, r5, r0 @ _start
|
||||
add r6, r6, r0 @ _edata
|
||||
|
||||
#ifndef CONFIG_ZBOOT_ROM
|
||||
/* malloc space is above the relocated stack (64k max) */
|
||||
add sp, sp, r0
|
||||
add r10, sp, #0x10000
|
||||
#else
|
||||
/*
|
||||
* With ZBOOT_ROM the bss/stack is non relocatable,
|
||||
* but someone could still run this code from RAM,
|
||||
* in which case our reference is _edata.
|
||||
*/
|
||||
mov r10, r6
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check to see if we will overwrite ourselves.
|
||||
* r4 = final kernel address
|
||||
* r5 = start of this image
|
||||
* r9 = size of decompressed image
|
||||
* r10 = end of this image, including bss/stack/malloc space if non XIP
|
||||
* We basically want:
|
||||
* r4 >= r10 -> OK
|
||||
* r4 + image length <= r5 -> OK
|
||||
*/
|
||||
cmp r4, r10
|
||||
bhs wont_overwrite
|
||||
add r10, r4, r9
|
||||
cmp r10, r5
|
||||
bls wont_overwrite
|
||||
|
||||
/*
|
||||
* Relocate ourselves past the end of the decompressed kernel.
|
||||
* r5 = start of this image
|
||||
* r6 = _edata
|
||||
* r10 = end of the decompressed kernel
|
||||
* Because we always copy ahead, we need to do it from the end and go
|
||||
* backward in case the source and destination overlap.
|
||||
*/
|
||||
/* Round up to next 256-byte boundary. */
|
||||
add r10, r10, #256
|
||||
bic r10, r10, #255
|
||||
|
||||
sub r9, r6, r5 @ size to copy
|
||||
add r9, r9, #31 @ rounded up to a multiple
|
||||
bic r9, r9, #31 @ ... of 32 bytes
|
||||
add r6, r9, r5
|
||||
add r9, r9, r10
|
||||
|
||||
1: ldmdb r6!, {r0 - r3, r10 - r12, lr}
|
||||
cmp r6, r5
|
||||
stmdb r9!, {r0 - r3, r10 - r12, lr}
|
||||
bhi 1b
|
||||
|
||||
/* Preserve offset to relocated code. */
|
||||
sub r6, r9, r6
|
||||
|
||||
bl cache_clean_flush
|
||||
|
||||
adr r0, BSYM(restart)
|
||||
add r0, r0, r6
|
||||
mov pc, r0
|
||||
|
||||
wont_overwrite:
|
||||
/*
|
||||
* If delta is zero, we are running at the address we were linked at.
|
||||
* r0 = delta
|
||||
* r2 = BSS start
|
||||
* r3 = BSS end
|
||||
* r4 = kernel execution address
|
||||
* r7 = architecture ID
|
||||
* r8 = atags pointer
|
||||
* r11 = GOT start
|
||||
* r12 = GOT end
|
||||
* sp = stack pointer
|
||||
*/
|
||||
teq r0, #0
|
||||
beq not_relocated
|
||||
add r11, r11, r0
|
||||
add ip, ip, r0
|
||||
add r12, r12, r0
|
||||
|
||||
#ifndef CONFIG_ZBOOT_ROM
|
||||
/*
|
||||
* If we're running fully PIC === CONFIG_ZBOOT_ROM = n,
|
||||
* we need to fix up pointers into the BSS region.
|
||||
* r2 - BSS start
|
||||
* r3 - BSS end
|
||||
* sp - stack pointer
|
||||
* Note that the stack pointer has already been fixed up.
|
||||
*/
|
||||
add r2, r2, r0
|
||||
add r3, r3, r0
|
||||
add sp, sp, r0
|
||||
|
||||
/*
|
||||
* Relocate all entries in the GOT table.
|
||||
@ -221,7 +292,7 @@ not_angel:
|
||||
1: ldr r1, [r11, #0] @ relocate entries in the GOT
|
||||
add r1, r1, r0 @ table. This fixes up the
|
||||
str r1, [r11], #4 @ C references.
|
||||
cmp r11, ip
|
||||
cmp r11, r12
|
||||
blo 1b
|
||||
#else
|
||||
|
||||
@ -234,7 +305,7 @@ not_angel:
|
||||
cmphs r3, r1 @ _end < entry
|
||||
addlo r1, r1, r0 @ table. This fixes up the
|
||||
str r1, [r11], #4 @ C references.
|
||||
cmp r11, ip
|
||||
cmp r11, r12
|
||||
blo 1b
|
||||
#endif
|
||||
|
||||
@ -246,76 +317,24 @@ not_relocated: mov r0, #0
|
||||
cmp r2, r3
|
||||
blo 1b
|
||||
|
||||
/*
|
||||
* The C runtime environment should now be setup
|
||||
* sufficiently. Turn the cache on, set up some
|
||||
* pointers, and start decompressing.
|
||||
*/
|
||||
bl cache_on
|
||||
|
||||
/*
|
||||
* The C runtime environment should now be setup sufficiently.
|
||||
* Set up some pointers, and start decompressing.
|
||||
* r4 = kernel execution address
|
||||
* r7 = architecture ID
|
||||
* r8 = atags pointer
|
||||
*/
|
||||
mov r0, r4
|
||||
mov r1, sp @ malloc space above stack
|
||||
add r2, sp, #0x10000 @ 64k max
|
||||
|
||||
/*
|
||||
* Check to see if we will overwrite ourselves.
|
||||
* r4 = final kernel address
|
||||
* r5 = start of this image
|
||||
* r6 = size of decompressed image
|
||||
* r2 = end of malloc space (and therefore this image)
|
||||
* We basically want:
|
||||
* r4 >= r2 -> OK
|
||||
* r4 + image length <= r5 -> OK
|
||||
*/
|
||||
cmp r4, r2
|
||||
bhs wont_overwrite
|
||||
add r0, r4, r6
|
||||
cmp r0, r5
|
||||
bls wont_overwrite
|
||||
|
||||
mov r5, r2 @ decompress after malloc space
|
||||
mov r0, r5
|
||||
mov r3, r7
|
||||
bl decompress_kernel
|
||||
|
||||
add r0, r0, #127 + 128 @ alignment + stack
|
||||
bic r0, r0, #127 @ align the kernel length
|
||||
/*
|
||||
* r0 = decompressed kernel length
|
||||
* r1-r3 = unused
|
||||
* r4 = kernel execution address
|
||||
* r5 = decompressed kernel start
|
||||
* r7 = architecture ID
|
||||
* r8 = atags pointer
|
||||
* r9-r12,r14 = corrupted
|
||||
*/
|
||||
add r1, r5, r0 @ end of decompressed kernel
|
||||
adr r2, reloc_start
|
||||
ldr r3, LC1
|
||||
add r3, r2, r3
|
||||
1: ldmia r2!, {r9 - r12, r14} @ copy relocation code
|
||||
stmia r1!, {r9 - r12, r14}
|
||||
ldmia r2!, {r9 - r12, r14}
|
||||
stmia r1!, {r9 - r12, r14}
|
||||
cmp r2, r3
|
||||
blo 1b
|
||||
mov sp, r1
|
||||
add sp, sp, #128 @ relocate the stack
|
||||
|
||||
bl cache_clean_flush
|
||||
ARM( add pc, r5, r0 ) @ call relocation code
|
||||
THUMB( add r12, r5, r0 )
|
||||
THUMB( mov pc, r12 ) @ call relocation code
|
||||
|
||||
/*
|
||||
* We're not in danger of overwriting ourselves. Do this the simple way.
|
||||
*
|
||||
* r4 = kernel execution address
|
||||
* r7 = architecture ID
|
||||
*/
|
||||
wont_overwrite: mov r0, r4
|
||||
mov r3, r7
|
||||
bl decompress_kernel
|
||||
b call_kernel
|
||||
bl cache_off
|
||||
mov r0, #0 @ must be zero
|
||||
mov r1, r7 @ restore architecture number
|
||||
mov r2, r8 @ restore atags pointer
|
||||
mov pc, r4 @ call kernel
|
||||
|
||||
.align 2
|
||||
.type LC0, #object
|
||||
@ -323,11 +342,11 @@ LC0: .word LC0 @ r1
|
||||
.word __bss_start @ r2
|
||||
.word _end @ r3
|
||||
.word _start @ r5
|
||||
.word _image_size @ r6
|
||||
.word _edata @ r6
|
||||
.word _image_size @ r9
|
||||
.word _got_start @ r11
|
||||
.word _got_end @ ip
|
||||
.word user_stack_end @ sp
|
||||
LC1: .word reloc_end - reloc_start
|
||||
.size LC0, . - LC0
|
||||
|
||||
#ifdef CONFIG_ARCH_RPC
|
||||
@ -353,7 +372,7 @@ params: ldr r0, =0x10000100 @ params_phys for RPC
|
||||
* On exit,
|
||||
* r0, r1, r2, r3, r9, r10, r12 corrupted
|
||||
* This routine must preserve:
|
||||
* r4, r5, r6, r7, r8
|
||||
* r4, r7, r8
|
||||
*/
|
||||
.align 5
|
||||
cache_on: mov r3, #8 @ cache_on function
|
||||
@ -550,43 +569,6 @@ __common_mmu_cache_on:
|
||||
sub pc, lr, r0, lsr #32 @ properly flush pipeline
|
||||
#endif
|
||||
|
||||
/*
|
||||
* All code following this line is relocatable. It is relocated by
|
||||
* the above code to the end of the decompressed kernel image and
|
||||
* executed there. During this time, we have no stacks.
|
||||
*
|
||||
* r0 = decompressed kernel length
|
||||
* r1-r3 = unused
|
||||
* r4 = kernel execution address
|
||||
* r5 = decompressed kernel start
|
||||
* r7 = architecture ID
|
||||
* r8 = atags pointer
|
||||
* r9-r12,r14 = corrupted
|
||||
*/
|
||||
.align 5
|
||||
reloc_start: add r9, r5, r0
|
||||
sub r9, r9, #128 @ do not copy the stack
|
||||
debug_reloc_start
|
||||
mov r1, r4
|
||||
1:
|
||||
.rept 4
|
||||
ldmia r5!, {r0, r2, r3, r10 - r12, r14} @ relocate kernel
|
||||
stmia r1!, {r0, r2, r3, r10 - r12, r14}
|
||||
.endr
|
||||
|
||||
cmp r5, r9
|
||||
blo 1b
|
||||
mov sp, r1
|
||||
add sp, sp, #128 @ relocate the stack
|
||||
debug_reloc_end
|
||||
|
||||
call_kernel: bl cache_clean_flush
|
||||
bl cache_off
|
||||
mov r0, #0 @ must be zero
|
||||
mov r1, r7 @ restore architecture number
|
||||
mov r2, r8 @ restore atags pointer
|
||||
mov pc, r4 @ call kernel
|
||||
|
||||
/*
|
||||
* Here follow the relocatable cache support functions for the
|
||||
* various processors. This is a generic hook for locating an
|
||||
@ -791,7 +773,7 @@ proc_types:
|
||||
* On exit,
|
||||
* r0, r1, r2, r3, r9, r12 corrupted
|
||||
* This routine must preserve:
|
||||
* r4, r6, r7
|
||||
* r4, r7, r8
|
||||
*/
|
||||
.align 5
|
||||
cache_off: mov r3, #12 @ cache_off function
|
||||
@ -866,7 +848,7 @@ __armv3_mmu_cache_off:
|
||||
* On exit,
|
||||
* r1, r2, r3, r9, r10, r11, r12 corrupted
|
||||
* This routine must preserve:
|
||||
* r0, r4, r5, r6, r7
|
||||
* r4, r6, r7, r8
|
||||
*/
|
||||
.align 5
|
||||
cache_clean_flush:
|
||||
@ -1088,7 +1070,6 @@ memdump: mov r12, r0
|
||||
#endif
|
||||
|
||||
.ltorg
|
||||
reloc_end:
|
||||
|
||||
.align
|
||||
.section ".stack", "aw", %nobits
|
||||
|
@ -36,7 +36,7 @@ extern void error(char *x);
|
||||
|
||||
#ifdef CONFIG_DEBUG_ICEDCC
|
||||
|
||||
#ifdef CONFIG_CPU_V6
|
||||
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
|
||||
|
||||
static void icedcc_putc(int ch)
|
||||
{
|
||||
|
87
arch/arm/boot/compressed/mmcif-sh7372.c
Normal file
87
arch/arm/boot/compressed/mmcif-sh7372.c
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* sh7372 MMCIF loader
|
||||
*
|
||||
* Copyright (C) 2010 Magnus Damm
|
||||
* Copyright (C) 2010 Simon Horman
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
#include <linux/mmc/sh_mmcif.h>
|
||||
#include <mach/mmcif.h>
|
||||
|
||||
#define MMCIF_BASE (void __iomem *)0xe6bd0000
|
||||
|
||||
#define PORT84CR (void __iomem *)0xe6050054
|
||||
#define PORT85CR (void __iomem *)0xe6050055
|
||||
#define PORT86CR (void __iomem *)0xe6050056
|
||||
#define PORT87CR (void __iomem *)0xe6050057
|
||||
#define PORT88CR (void __iomem *)0xe6050058
|
||||
#define PORT89CR (void __iomem *)0xe6050059
|
||||
#define PORT90CR (void __iomem *)0xe605005a
|
||||
#define PORT91CR (void __iomem *)0xe605005b
|
||||
#define PORT92CR (void __iomem *)0xe605005c
|
||||
#define PORT99CR (void __iomem *)0xe6050063
|
||||
|
||||
#define SMSTPCR3 (void __iomem *)0xe615013c
|
||||
|
||||
/* SH7372 specific MMCIF loader
|
||||
*
|
||||
* loads the zImage from an MMC card starting from block 1.
|
||||
*
|
||||
* The image must be start with a vrl4 header and
|
||||
* the zImage must start at offset 512 of the image. That is,
|
||||
* at block 2 (=byte 1024) on the media
|
||||
*
|
||||
* Use the following line to write the vrl4 formated zImage
|
||||
* to an MMC card
|
||||
* # dd if=vrl4.out of=/dev/sdx bs=512 seek=1
|
||||
*/
|
||||
asmlinkage void mmcif_loader(unsigned char *buf, unsigned long len)
|
||||
{
|
||||
mmcif_init_progress();
|
||||
mmcif_update_progress(MMCIF_PROGRESS_ENTER);
|
||||
|
||||
/* Initialise MMC
|
||||
* registers: PORT84CR-PORT92CR
|
||||
* (MMCD0_0-MMCD0_7,MMCCMD0 Control)
|
||||
* value: 0x04 - select function 4
|
||||
*/
|
||||
__raw_writeb(0x04, PORT84CR);
|
||||
__raw_writeb(0x04, PORT85CR);
|
||||
__raw_writeb(0x04, PORT86CR);
|
||||
__raw_writeb(0x04, PORT87CR);
|
||||
__raw_writeb(0x04, PORT88CR);
|
||||
__raw_writeb(0x04, PORT89CR);
|
||||
__raw_writeb(0x04, PORT90CR);
|
||||
__raw_writeb(0x04, PORT91CR);
|
||||
__raw_writeb(0x04, PORT92CR);
|
||||
|
||||
/* Initialise MMC
|
||||
* registers: PORT99CR (MMCCLK0 Control)
|
||||
* value: 0x10 | 0x04 - enable output | select function 4
|
||||
*/
|
||||
__raw_writeb(0x14, PORT99CR);
|
||||
|
||||
/* Enable clock to MMC hardware block */
|
||||
__raw_writel(__raw_readl(SMSTPCR3) & ~(1 << 12), SMSTPCR3);
|
||||
|
||||
mmcif_update_progress(MMCIF_PROGRESS_INIT);
|
||||
|
||||
/* setup MMCIF hardware */
|
||||
sh_mmcif_boot_init(MMCIF_BASE);
|
||||
|
||||
mmcif_update_progress(MMCIF_PROGRESS_LOAD);
|
||||
|
||||
/* load kernel via MMCIF interface */
|
||||
sh_mmcif_boot_do_read(MMCIF_BASE, 2, /* Kernel is at block 2 */
|
||||
(len + SH_MMCIF_BBS - 1) / SH_MMCIF_BBS, buf);
|
||||
|
||||
|
||||
/* Disable clock to MMC hardware block */
|
||||
__raw_writel(__raw_readl(SMSTPCR3) & (1 << 12), SMSTPCR3);
|
||||
|
||||
mmcif_update_progress(MMCIF_PROGRESS_DONE);
|
||||
}
|
@ -43,9 +43,6 @@ SECTIONS
|
||||
|
||||
_etext = .;
|
||||
|
||||
/* Assume size of decompressed image is 4x the compressed image */
|
||||
_image_size = (_etext - _text) * 4;
|
||||
|
||||
_got_start = .;
|
||||
.got : { *(.got) }
|
||||
_got_end = .;
|
||||
|
@ -44,6 +44,19 @@ struct gic_chip_data {
|
||||
void __iomem *cpu_base;
|
||||
};
|
||||
|
||||
/*
|
||||
* Supported arch specific GIC irq extension.
|
||||
* Default make them NULL.
|
||||
*/
|
||||
struct irq_chip gic_arch_extn = {
|
||||
.irq_ack = NULL,
|
||||
.irq_mask = NULL,
|
||||
.irq_unmask = NULL,
|
||||
.irq_retrigger = NULL,
|
||||
.irq_set_type = NULL,
|
||||
.irq_set_wake = NULL,
|
||||
};
|
||||
|
||||
#ifndef MAX_GIC_NR
|
||||
#define MAX_GIC_NR 1
|
||||
#endif
|
||||
@ -74,6 +87,8 @@ static inline unsigned int gic_irq(struct irq_data *d)
|
||||
static void gic_ack_irq(struct irq_data *d)
|
||||
{
|
||||
spin_lock(&irq_controller_lock);
|
||||
if (gic_arch_extn.irq_ack)
|
||||
gic_arch_extn.irq_ack(d);
|
||||
writel(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI);
|
||||
spin_unlock(&irq_controller_lock);
|
||||
}
|
||||
@ -84,6 +99,8 @@ static void gic_mask_irq(struct irq_data *d)
|
||||
|
||||
spin_lock(&irq_controller_lock);
|
||||
writel(mask, gic_dist_base(d) + GIC_DIST_ENABLE_CLEAR + (gic_irq(d) / 32) * 4);
|
||||
if (gic_arch_extn.irq_mask)
|
||||
gic_arch_extn.irq_mask(d);
|
||||
spin_unlock(&irq_controller_lock);
|
||||
}
|
||||
|
||||
@ -92,6 +109,8 @@ static void gic_unmask_irq(struct irq_data *d)
|
||||
u32 mask = 1 << (d->irq % 32);
|
||||
|
||||
spin_lock(&irq_controller_lock);
|
||||
if (gic_arch_extn.irq_unmask)
|
||||
gic_arch_extn.irq_unmask(d);
|
||||
writel(mask, gic_dist_base(d) + GIC_DIST_ENABLE_SET + (gic_irq(d) / 32) * 4);
|
||||
spin_unlock(&irq_controller_lock);
|
||||
}
|
||||
@ -116,6 +135,9 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
|
||||
|
||||
spin_lock(&irq_controller_lock);
|
||||
|
||||
if (gic_arch_extn.irq_set_type)
|
||||
gic_arch_extn.irq_set_type(d, type);
|
||||
|
||||
val = readl(base + GIC_DIST_CONFIG + confoff);
|
||||
if (type == IRQ_TYPE_LEVEL_HIGH)
|
||||
val &= ~confmask;
|
||||
@ -141,32 +163,54 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gic_retrigger(struct irq_data *d)
|
||||
{
|
||||
if (gic_arch_extn.irq_retrigger)
|
||||
return gic_arch_extn.irq_retrigger(d);
|
||||
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
static int
|
||||
gic_set_cpu(struct irq_data *d, const struct cpumask *mask_val, bool force)
|
||||
static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
|
||||
bool force)
|
||||
{
|
||||
void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
|
||||
unsigned int shift = (d->irq % 4) * 8;
|
||||
unsigned int cpu = cpumask_first(mask_val);
|
||||
u32 val;
|
||||
struct irq_desc *desc;
|
||||
u32 val, mask, bit;
|
||||
|
||||
if (cpu >= 8)
|
||||
return -EINVAL;
|
||||
|
||||
mask = 0xff << shift;
|
||||
bit = 1 << (cpu + shift);
|
||||
|
||||
spin_lock(&irq_controller_lock);
|
||||
desc = irq_to_desc(d->irq);
|
||||
if (desc == NULL) {
|
||||
spin_unlock(&irq_controller_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
d->node = cpu;
|
||||
val = readl(reg) & ~(0xff << shift);
|
||||
val |= 1 << (cpu + shift);
|
||||
writel(val, reg);
|
||||
val = readl(reg) & ~mask;
|
||||
writel(val | bit, reg);
|
||||
spin_unlock(&irq_controller_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int gic_set_wake(struct irq_data *d, unsigned int on)
|
||||
{
|
||||
int ret = -ENXIO;
|
||||
|
||||
if (gic_arch_extn.irq_set_wake)
|
||||
ret = gic_arch_extn.irq_set_wake(d, on);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else
|
||||
#define gic_set_wake NULL
|
||||
#endif
|
||||
|
||||
static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
|
||||
{
|
||||
struct gic_chip_data *chip_data = get_irq_data(irq);
|
||||
@ -202,9 +246,11 @@ static struct irq_chip gic_chip = {
|
||||
.irq_mask = gic_mask_irq,
|
||||
.irq_unmask = gic_unmask_irq,
|
||||
.irq_set_type = gic_set_type,
|
||||
.irq_retrigger = gic_retrigger,
|
||||
#ifdef CONFIG_SMP
|
||||
.irq_set_affinity = gic_set_cpu,
|
||||
.irq_set_affinity = gic_set_affinity,
|
||||
#endif
|
||||
.irq_set_wake = gic_set_wake,
|
||||
};
|
||||
|
||||
void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
|
||||
|
@ -1,68 +0,0 @@
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
# CONFIG_SWAP is not set
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_LOG_BUF_SHIFT=14
|
||||
CONFIG_EXPERT=y
|
||||
# CONFIG_HOTPLUG is not set
|
||||
# CONFIG_EPOLL is not set
|
||||
# CONFIG_IOSCHED_DEADLINE is not set
|
||||
CONFIG_ARCH_LH7A40X=y
|
||||
CONFIG_MACH_LPD7A400=y
|
||||
CONFIG_PREEMPT=y
|
||||
CONFIG_ZBOOT_ROM_TEXT=0x0
|
||||
CONFIG_ZBOOT_ROM_BSS=0x0
|
||||
CONFIG_FPE_NWFPE=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_PNP=y
|
||||
CONFIG_IP_PNP_DHCP=y
|
||||
CONFIG_IP_PNP_BOOTP=y
|
||||
CONFIG_IP_PNP_RARP=y
|
||||
# CONFIG_IPV6 is not set
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_PARTITIONS=y
|
||||
CONFIG_MTD_CMDLINE_PARTS=y
|
||||
CONFIG_MTD_CHAR=y
|
||||
CONFIG_MTD_BLOCK=y
|
||||
CONFIG_MTD_CFI=y
|
||||
CONFIG_MTD_CFI_INTELEXT=y
|
||||
CONFIG_MTD_PHYSMAP=y
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_IDE=y
|
||||
CONFIG_SCSI=y
|
||||
# CONFIG_SCSI_PROC_FS is not set
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_NET_ETHERNET=y
|
||||
CONFIG_SMC91X=y
|
||||
# CONFIG_INPUT_MOUSEDEV is not set
|
||||
CONFIG_INPUT_EVDEV=y
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
CONFIG_INPUT_TOUCHSCREEN=y
|
||||
# CONFIG_SERIO is not set
|
||||
CONFIG_SERIAL_LH7A40X=y
|
||||
CONFIG_SERIAL_LH7A40X_CONSOLE=y
|
||||
CONFIG_FB=y
|
||||
# CONFIG_VGA_CONSOLE is not set
|
||||
CONFIG_SOUND=y
|
||||
CONFIG_SND=y
|
||||
CONFIG_SND_MIXER_OSS=y
|
||||
CONFIG_SND_PCM_OSS=y
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT3_FS=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_JFFS2_FS=y
|
||||
CONFIG_CRAMFS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3=y
|
||||
CONFIG_ROOT_NFS=y
|
||||
CONFIG_PARTITION_ADVANCED=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_USER=y
|
||||
CONFIG_DEBUG_ERRORS=y
|
@ -1,81 +0,0 @@
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
# CONFIG_SWAP is not set
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_LOG_BUF_SHIFT=16
|
||||
CONFIG_EXPERT=y
|
||||
# CONFIG_HOTPLUG is not set
|
||||
# CONFIG_EPOLL is not set
|
||||
CONFIG_SLAB=y
|
||||
# CONFIG_IOSCHED_DEADLINE is not set
|
||||
CONFIG_ARCH_LH7A40X=y
|
||||
CONFIG_MACH_LPD7A404=y
|
||||
CONFIG_PREEMPT=y
|
||||
CONFIG_DISCONTIGMEM_MANUAL=y
|
||||
CONFIG_ZBOOT_ROM_TEXT=0x0
|
||||
CONFIG_ZBOOT_ROM_BSS=0x0
|
||||
CONFIG_FPE_NWFPE=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_PNP=y
|
||||
CONFIG_IP_PNP_DHCP=y
|
||||
CONFIG_IP_PNP_BOOTP=y
|
||||
CONFIG_IP_PNP_RARP=y
|
||||
# CONFIG_IPV6 is not set
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_PARTITIONS=y
|
||||
CONFIG_MTD_CMDLINE_PARTS=y
|
||||
CONFIG_MTD_CHAR=y
|
||||
CONFIG_MTD_BLOCK=y
|
||||
CONFIG_MTD_CFI=y
|
||||
CONFIG_MTD_CFI_INTELEXT=y
|
||||
CONFIG_MTD_PHYSMAP=y
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_IDE=y
|
||||
CONFIG_SCSI=y
|
||||
# CONFIG_SCSI_PROC_FS is not set
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_NET_ETHERNET=y
|
||||
CONFIG_SMC91X=y
|
||||
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
|
||||
CONFIG_INPUT_EVDEV=y
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
CONFIG_INPUT_TOUCHSCREEN=y
|
||||
# CONFIG_SERIO is not set
|
||||
CONFIG_SERIAL_LH7A40X=y
|
||||
CONFIG_SERIAL_LH7A40X_CONSOLE=y
|
||||
CONFIG_FB=y
|
||||
# CONFIG_VGA_CONSOLE is not set
|
||||
CONFIG_SOUND=y
|
||||
CONFIG_SND=y
|
||||
CONFIG_SND_MIXER_OSS=y
|
||||
CONFIG_SND_PCM_OSS=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_DEVICEFS=y
|
||||
CONFIG_USB_MON=y
|
||||
CONFIG_USB_OHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_STORAGE_DEBUG=y
|
||||
CONFIG_USB_STORAGE_DATAFAB=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_ZERO=y
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT3_FS=y
|
||||
CONFIG_INOTIFY=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_JFFS2_FS=y
|
||||
CONFIG_CRAMFS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3=y
|
||||
CONFIG_ROOT_NFS=y
|
||||
CONFIG_PARTITION_ADVANCED=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DEBUG_MUTEXES=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_USER=y
|
||||
CONFIG_DEBUG_ERRORS=y
|
123
arch/arm/configs/tegra_defconfig
Normal file
123
arch/arm/configs/tegra_defconfig
Normal file
@ -0,0 +1,123 @@
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_CGROUPS=y
|
||||
CONFIG_CGROUP_DEBUG=y
|
||||
CONFIG_CGROUP_FREEZER=y
|
||||
CONFIG_CGROUP_CPUACCT=y
|
||||
CONFIG_RESOURCE_COUNTERS=y
|
||||
CONFIG_CGROUP_SCHED=y
|
||||
CONFIG_RT_GROUP_SCHED=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_EMBEDDED=y
|
||||
# CONFIG_SYSCTL_SYSCALL is not set
|
||||
# CONFIG_ELF_CORE is not set
|
||||
CONFIG_SLAB=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
CONFIG_MODULE_FORCE_UNLOAD=y
|
||||
# CONFIG_BLK_DEV_BSG is not set
|
||||
# CONFIG_IOSCHED_DEADLINE is not set
|
||||
# CONFIG_IOSCHED_CFQ is not set
|
||||
CONFIG_ARCH_TEGRA=y
|
||||
CONFIG_MACH_HARMONY=y
|
||||
CONFIG_TEGRA_DEBUG_UARTD=y
|
||||
CONFIG_ARM_ERRATA_742230=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_NR_CPUS=2
|
||||
CONFIG_PREEMPT=y
|
||||
CONFIG_AEABI=y
|
||||
# CONFIG_OABI_COMPAT is not set
|
||||
CONFIG_HIGHMEM=y
|
||||
CONFIG_ZBOOT_ROM_TEXT=0x0
|
||||
CONFIG_ZBOOT_ROM_BSS=0x0
|
||||
CONFIG_VFP=y
|
||||
CONFIG_PM=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_NET_KEY=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_INET_ESP=y
|
||||
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
||||
# CONFIG_INET_XFRM_MODE_BEET is not set
|
||||
# CONFIG_INET_LRO is not set
|
||||
# CONFIG_INET_DIAG is not set
|
||||
CONFIG_IPV6=y
|
||||
CONFIG_IPV6_PRIVACY=y
|
||||
CONFIG_IPV6_ROUTER_PREF=y
|
||||
CONFIG_IPV6_OPTIMISTIC_DAD=y
|
||||
CONFIG_INET6_AH=y
|
||||
CONFIG_INET6_ESP=y
|
||||
CONFIG_INET6_IPCOMP=y
|
||||
CONFIG_IPV6_MIP6=y
|
||||
CONFIG_IPV6_TUNNEL=y
|
||||
CONFIG_IPV6_MULTIPLE_TABLES=y
|
||||
# CONFIG_WIRELESS is not set
|
||||
# CONFIG_FIRMWARE_IN_KERNEL is not set
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_MISC_DEVICES=y
|
||||
CONFIG_AD525X_DPOT=y
|
||||
CONFIG_AD525X_DPOT_I2C=y
|
||||
CONFIG_ICS932S401=y
|
||||
CONFIG_APDS9802ALS=y
|
||||
CONFIG_ISL29003=y
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_DUMMY=y
|
||||
# CONFIG_NETDEV_1000 is not set
|
||||
# CONFIG_NETDEV_10000 is not set
|
||||
# CONFIG_WLAN is not set
|
||||
# CONFIG_INPUT is not set
|
||||
# CONFIG_SERIO is not set
|
||||
# CONFIG_VT is not set
|
||||
# CONFIG_DEVKMEM is not set
|
||||
CONFIG_SERIAL_8250=y
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
# CONFIG_LEGACY_PTYS is not set
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
CONFIG_I2C=y
|
||||
# CONFIG_HWMON is not set
|
||||
# CONFIG_MFD_SUPPORT is not set
|
||||
# CONFIG_USB_SUPPORT is not set
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_PLTFM=y
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT2_FS_XATTR=y
|
||||
CONFIG_EXT2_FS_POSIX_ACL=y
|
||||
CONFIG_EXT2_FS_SECURITY=y
|
||||
CONFIG_EXT3_FS=y
|
||||
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
|
||||
CONFIG_EXT3_FS_POSIX_ACL=y
|
||||
CONFIG_EXT3_FS_SECURITY=y
|
||||
# CONFIG_DNOTIFY is not set
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_FS=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DETECT_HUNG_TASK=y
|
||||
CONFIG_SCHEDSTATS=y
|
||||
CONFIG_TIMER_STATS=y
|
||||
CONFIG_DEBUG_SLAB=y
|
||||
# CONFIG_DEBUG_PREEMPT is not set
|
||||
CONFIG_DEBUG_MUTEXES=y
|
||||
CONFIG_DEBUG_SPINLOCK_SLEEP=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_VM=y
|
||||
CONFIG_DEBUG_SG=y
|
||||
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
|
||||
CONFIG_DEBUG_LL=y
|
||||
CONFIG_EARLY_PRINTK=y
|
||||
CONFIG_CRYPTO_ECB=y
|
||||
CONFIG_CRYPTO_AES=y
|
||||
CONFIG_CRYPTO_ARC4=y
|
||||
CONFIG_CRYPTO_TWOFISH=y
|
||||
# CONFIG_CRYPTO_ANSI_CPRNG is not set
|
||||
CONFIG_CRC_CCITT=y
|
||||
CONFIG_CRC16=y
|
@ -32,11 +32,7 @@ static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
|
||||
dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT;
|
||||
dump->u_ssize = 0;
|
||||
|
||||
dump->u_debugreg[0] = tsk->thread.debug.bp[0].address;
|
||||
dump->u_debugreg[1] = tsk->thread.debug.bp[1].address;
|
||||
dump->u_debugreg[2] = tsk->thread.debug.bp[0].insn.arm;
|
||||
dump->u_debugreg[3] = tsk->thread.debug.bp[1].insn.arm;
|
||||
dump->u_debugreg[4] = tsk->thread.debug.nsaved;
|
||||
memset(dump->u_debugreg, 0, sizeof(dump->u_debugreg));
|
||||
|
||||
if (dump->start_stack < 0x04000000)
|
||||
dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT;
|
||||
|
@ -148,15 +148,19 @@ ____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
|
||||
* Note that bit 0 is defined to be 32-bit word bit 0, not byte 0 bit 0.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Native endian assembly bitops. nr = 0 -> word 0 bit 0.
|
||||
*/
|
||||
extern void _set_bit(int nr, volatile unsigned long * p);
|
||||
extern void _clear_bit(int nr, volatile unsigned long * p);
|
||||
extern void _change_bit(int nr, volatile unsigned long * p);
|
||||
extern int _test_and_set_bit(int nr, volatile unsigned long * p);
|
||||
extern int _test_and_clear_bit(int nr, volatile unsigned long * p);
|
||||
extern int _test_and_change_bit(int nr, volatile unsigned long * p);
|
||||
|
||||
/*
|
||||
* Little endian assembly bitops. nr = 0 -> byte 0 bit 0.
|
||||
*/
|
||||
extern void _set_bit_le(int nr, volatile unsigned long * p);
|
||||
extern void _clear_bit_le(int nr, volatile unsigned long * p);
|
||||
extern void _change_bit_le(int nr, volatile unsigned long * p);
|
||||
extern int _test_and_set_bit_le(int nr, volatile unsigned long * p);
|
||||
extern int _test_and_clear_bit_le(int nr, volatile unsigned long * p);
|
||||
extern int _test_and_change_bit_le(int nr, volatile unsigned long * p);
|
||||
extern int _find_first_zero_bit_le(const void * p, unsigned size);
|
||||
extern int _find_next_zero_bit_le(const void * p, int size, int offset);
|
||||
extern int _find_first_bit_le(const unsigned long *p, unsigned size);
|
||||
@ -165,12 +169,6 @@ extern int _find_next_bit_le(const unsigned long *p, int size, int offset);
|
||||
/*
|
||||
* Big endian assembly bitops. nr = 0 -> byte 3 bit 0.
|
||||
*/
|
||||
extern void _set_bit_be(int nr, volatile unsigned long * p);
|
||||
extern void _clear_bit_be(int nr, volatile unsigned long * p);
|
||||
extern void _change_bit_be(int nr, volatile unsigned long * p);
|
||||
extern int _test_and_set_bit_be(int nr, volatile unsigned long * p);
|
||||
extern int _test_and_clear_bit_be(int nr, volatile unsigned long * p);
|
||||
extern int _test_and_change_bit_be(int nr, volatile unsigned long * p);
|
||||
extern int _find_first_zero_bit_be(const void * p, unsigned size);
|
||||
extern int _find_next_zero_bit_be(const void * p, int size, int offset);
|
||||
extern int _find_first_bit_be(const unsigned long *p, unsigned size);
|
||||
@ -180,33 +178,26 @@ extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
|
||||
/*
|
||||
* The __* form of bitops are non-atomic and may be reordered.
|
||||
*/
|
||||
#define ATOMIC_BITOP_LE(name,nr,p) \
|
||||
(__builtin_constant_p(nr) ? \
|
||||
____atomic_##name(nr, p) : \
|
||||
_##name##_le(nr,p))
|
||||
|
||||
#define ATOMIC_BITOP_BE(name,nr,p) \
|
||||
(__builtin_constant_p(nr) ? \
|
||||
____atomic_##name(nr, p) : \
|
||||
_##name##_be(nr,p))
|
||||
#define ATOMIC_BITOP(name,nr,p) \
|
||||
(__builtin_constant_p(nr) ? ____atomic_##name(nr, p) : _##name(nr,p))
|
||||
#else
|
||||
#define ATOMIC_BITOP_LE(name,nr,p) _##name##_le(nr,p)
|
||||
#define ATOMIC_BITOP_BE(name,nr,p) _##name##_be(nr,p)
|
||||
#define ATOMIC_BITOP(name,nr,p) _##name(nr,p)
|
||||
#endif
|
||||
|
||||
#define NONATOMIC_BITOP(name,nr,p) \
|
||||
(____nonatomic_##name(nr, p))
|
||||
/*
|
||||
* Native endian atomic definitions.
|
||||
*/
|
||||
#define set_bit(nr,p) ATOMIC_BITOP(set_bit,nr,p)
|
||||
#define clear_bit(nr,p) ATOMIC_BITOP(clear_bit,nr,p)
|
||||
#define change_bit(nr,p) ATOMIC_BITOP(change_bit,nr,p)
|
||||
#define test_and_set_bit(nr,p) ATOMIC_BITOP(test_and_set_bit,nr,p)
|
||||
#define test_and_clear_bit(nr,p) ATOMIC_BITOP(test_and_clear_bit,nr,p)
|
||||
#define test_and_change_bit(nr,p) ATOMIC_BITOP(test_and_change_bit,nr,p)
|
||||
|
||||
#ifndef __ARMEB__
|
||||
/*
|
||||
* These are the little endian, atomic definitions.
|
||||
*/
|
||||
#define set_bit(nr,p) ATOMIC_BITOP_LE(set_bit,nr,p)
|
||||
#define clear_bit(nr,p) ATOMIC_BITOP_LE(clear_bit,nr,p)
|
||||
#define change_bit(nr,p) ATOMIC_BITOP_LE(change_bit,nr,p)
|
||||
#define test_and_set_bit(nr,p) ATOMIC_BITOP_LE(test_and_set_bit,nr,p)
|
||||
#define test_and_clear_bit(nr,p) ATOMIC_BITOP_LE(test_and_clear_bit,nr,p)
|
||||
#define test_and_change_bit(nr,p) ATOMIC_BITOP_LE(test_and_change_bit,nr,p)
|
||||
#define find_first_zero_bit(p,sz) _find_first_zero_bit_le(p,sz)
|
||||
#define find_next_zero_bit(p,sz,off) _find_next_zero_bit_le(p,sz,off)
|
||||
#define find_first_bit(p,sz) _find_first_bit_le(p,sz)
|
||||
@ -215,16 +206,9 @@ extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
|
||||
#define WORD_BITOFF_TO_LE(x) ((x))
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* These are the big endian, atomic definitions.
|
||||
*/
|
||||
#define set_bit(nr,p) ATOMIC_BITOP_BE(set_bit,nr,p)
|
||||
#define clear_bit(nr,p) ATOMIC_BITOP_BE(clear_bit,nr,p)
|
||||
#define change_bit(nr,p) ATOMIC_BITOP_BE(change_bit,nr,p)
|
||||
#define test_and_set_bit(nr,p) ATOMIC_BITOP_BE(test_and_set_bit,nr,p)
|
||||
#define test_and_clear_bit(nr,p) ATOMIC_BITOP_BE(test_and_clear_bit,nr,p)
|
||||
#define test_and_change_bit(nr,p) ATOMIC_BITOP_BE(test_and_change_bit,nr,p)
|
||||
#define find_first_zero_bit(p,sz) _find_first_zero_bit_be(p,sz)
|
||||
#define find_next_zero_bit(p,sz,off) _find_next_zero_bit_be(p,sz,off)
|
||||
#define find_first_bit(p,sz) _find_first_bit_be(p,sz)
|
||||
|
@ -12,130 +12,13 @@
|
||||
|
||||
#include <linux/mm.h>
|
||||
|
||||
#include <asm/glue.h>
|
||||
#include <asm/glue-cache.h>
|
||||
#include <asm/shmparam.h>
|
||||
#include <asm/cachetype.h>
|
||||
#include <asm/outercache.h>
|
||||
|
||||
#define CACHE_COLOUR(vaddr) ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT)
|
||||
|
||||
/*
|
||||
* Cache Model
|
||||
* ===========
|
||||
*/
|
||||
#undef _CACHE
|
||||
#undef MULTI_CACHE
|
||||
|
||||
#if defined(CONFIG_CPU_CACHE_V3)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE v3
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_CACHE_V4)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE v4
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \
|
||||
defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020) || \
|
||||
defined(CONFIG_CPU_ARM1026)
|
||||
# define MULTI_CACHE 1
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_FA526)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE fa
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_ARM926T)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE arm926
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_ARM940T)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE arm940
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_ARM946E)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE arm946
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_CACHE_V4WB)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE v4wb
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_XSCALE)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE xscale
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_XSC3)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE xsc3
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_MOHAWK)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE mohawk
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_FEROCEON)
|
||||
# define MULTI_CACHE 1
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_V6)
|
||||
//# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
//# else
|
||||
//# define _CACHE v6
|
||||
//# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_V7)
|
||||
//# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
//# else
|
||||
//# define _CACHE v7
|
||||
//# endif
|
||||
#endif
|
||||
|
||||
#if !defined(_CACHE) && !defined(MULTI_CACHE)
|
||||
#error Unknown cache maintainence model
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This flag is used to indicate that the page pointed to by a pte is clean
|
||||
* and does not require cleaning before returning it to the user.
|
||||
@ -249,19 +132,11 @@ extern struct cpu_cache_fns cpu_cache;
|
||||
* visible to the CPU.
|
||||
*/
|
||||
#define dmac_map_area cpu_cache.dma_map_area
|
||||
#define dmac_unmap_area cpu_cache.dma_unmap_area
|
||||
#define dmac_unmap_area cpu_cache.dma_unmap_area
|
||||
#define dmac_flush_range cpu_cache.dma_flush_range
|
||||
|
||||
#else
|
||||
|
||||
#define __cpuc_flush_icache_all __glue(_CACHE,_flush_icache_all)
|
||||
#define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all)
|
||||
#define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all)
|
||||
#define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
|
||||
#define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
|
||||
#define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
|
||||
#define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
|
||||
|
||||
extern void __cpuc_flush_icache_all(void);
|
||||
extern void __cpuc_flush_kern_all(void);
|
||||
extern void __cpuc_flush_user_all(void);
|
||||
@ -276,10 +151,6 @@ extern void __cpuc_flush_dcache_area(void *, size_t);
|
||||
* is visible to DMA, or data written by DMA to system memory is
|
||||
* visible to the CPU.
|
||||
*/
|
||||
#define dmac_map_area __glue(_CACHE,_dma_map_area)
|
||||
#define dmac_unmap_area __glue(_CACHE,_dma_unmap_area)
|
||||
#define dmac_flush_range __glue(_CACHE,_dma_flush_range)
|
||||
|
||||
extern void dmac_map_area(const void *, size_t, int);
|
||||
extern void dmac_unmap_area(const void *, size_t, int);
|
||||
extern void dmac_flush_range(const void *, const void *);
|
||||
@ -316,7 +187,8 @@ extern void copy_to_user_page(struct vm_area_struct *, struct page *,
|
||||
* Optimized __flush_icache_all for the common cases. Note that UP ARMv7
|
||||
* will fall through to use __flush_icache_all_generic.
|
||||
*/
|
||||
#if (defined(CONFIG_CPU_V7) && defined(CONFIG_CPU_V6)) || \
|
||||
#if (defined(CONFIG_CPU_V7) && \
|
||||
(defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K))) || \
|
||||
defined(CONFIG_SMP_ON_UP)
|
||||
#define __flush_icache_preferred __cpuc_flush_icache_all
|
||||
#elif __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP)
|
||||
|
@ -1,69 +0,0 @@
|
||||
/*
|
||||
* arch/arm/include/asm/cpu-multi32.h
|
||||
*
|
||||
* Copyright (C) 2000 Russell King
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <asm/page.h>
|
||||
|
||||
struct mm_struct;
|
||||
|
||||
/*
|
||||
* Don't change this structure - ASM code
|
||||
* relies on it.
|
||||
*/
|
||||
extern struct processor {
|
||||
/* MISC
|
||||
* get data abort address/flags
|
||||
*/
|
||||
void (*_data_abort)(unsigned long pc);
|
||||
/*
|
||||
* Retrieve prefetch fault address
|
||||
*/
|
||||
unsigned long (*_prefetch_abort)(unsigned long lr);
|
||||
/*
|
||||
* Set up any processor specifics
|
||||
*/
|
||||
void (*_proc_init)(void);
|
||||
/*
|
||||
* Disable any processor specifics
|
||||
*/
|
||||
void (*_proc_fin)(void);
|
||||
/*
|
||||
* Special stuff for a reset
|
||||
*/
|
||||
void (*reset)(unsigned long addr) __attribute__((noreturn));
|
||||
/*
|
||||
* Idle the processor
|
||||
*/
|
||||
int (*_do_idle)(void);
|
||||
/*
|
||||
* Processor architecture specific
|
||||
*/
|
||||
/*
|
||||
* clean a virtual address range from the
|
||||
* D-cache without flushing the cache.
|
||||
*/
|
||||
void (*dcache_clean_area)(void *addr, int size);
|
||||
|
||||
/*
|
||||
* Set the page table
|
||||
*/
|
||||
void (*switch_mm)(unsigned long pgd_phys, struct mm_struct *mm);
|
||||
/*
|
||||
* Set a possibly extended PTE. Non-extended PTEs should
|
||||
* ignore 'ext'.
|
||||
*/
|
||||
void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext);
|
||||
} processor;
|
||||
|
||||
#define cpu_proc_init() processor._proc_init()
|
||||
#define cpu_proc_fin() processor._proc_fin()
|
||||
#define cpu_reset(addr) processor.reset(addr)
|
||||
#define cpu_do_idle() processor._do_idle()
|
||||
#define cpu_dcache_clean_area(addr,sz) processor.dcache_clean_area(addr,sz)
|
||||
#define cpu_set_pte_ext(ptep,pte,ext) processor.set_pte_ext(ptep,pte,ext)
|
||||
#define cpu_do_switch_mm(pgd,mm) processor.switch_mm(pgd,mm)
|
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* arch/arm/include/asm/cpu-single.h
|
||||
*
|
||||
* Copyright (C) 2000 Russell King
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
/*
|
||||
* Single CPU
|
||||
*/
|
||||
#ifdef __STDC__
|
||||
#define __catify_fn(name,x) name##x
|
||||
#else
|
||||
#define __catify_fn(name,x) name/**/x
|
||||
#endif
|
||||
#define __cpu_fn(name,x) __catify_fn(name,x)
|
||||
|
||||
/*
|
||||
* If we are supporting multiple CPUs, then we must use a table of
|
||||
* function pointers for this lot. Otherwise, we can optimise the
|
||||
* table away.
|
||||
*/
|
||||
#define cpu_proc_init __cpu_fn(CPU_NAME,_proc_init)
|
||||
#define cpu_proc_fin __cpu_fn(CPU_NAME,_proc_fin)
|
||||
#define cpu_reset __cpu_fn(CPU_NAME,_reset)
|
||||
#define cpu_do_idle __cpu_fn(CPU_NAME,_do_idle)
|
||||
#define cpu_dcache_clean_area __cpu_fn(CPU_NAME,_dcache_clean_area)
|
||||
#define cpu_do_switch_mm __cpu_fn(CPU_NAME,_switch_mm)
|
||||
#define cpu_set_pte_ext __cpu_fn(CPU_NAME,_set_pte_ext)
|
||||
|
||||
#include <asm/page.h>
|
||||
|
||||
struct mm_struct;
|
||||
|
||||
/* declare all the functions as extern */
|
||||
extern void cpu_proc_init(void);
|
||||
extern void cpu_proc_fin(void);
|
||||
extern int cpu_do_idle(void);
|
||||
extern void cpu_dcache_clean_area(void *, int);
|
||||
extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
|
||||
extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext);
|
||||
extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
|
@ -23,6 +23,8 @@
|
||||
#define CPUID_EXT_ISAR4 "c2, 4"
|
||||
#define CPUID_EXT_ISAR5 "c2, 5"
|
||||
|
||||
extern unsigned int processor_id;
|
||||
|
||||
#ifdef CONFIG_CPU_CP15
|
||||
#define read_cpuid(reg) \
|
||||
({ \
|
||||
@ -43,7 +45,6 @@
|
||||
__val; \
|
||||
})
|
||||
#else
|
||||
extern unsigned int processor_id;
|
||||
#define read_cpuid(reg) (processor_id)
|
||||
#define read_cpuid_ext(reg) 0
|
||||
#endif
|
||||
|
94
arch/arm/include/asm/fncpy.h
Normal file
94
arch/arm/include/asm/fncpy.h
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* arch/arm/include/asm/fncpy.h - helper macros for function body copying
|
||||
*
|
||||
* Copyright (C) 2011 Linaro Limited
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* These macros are intended for use when there is a need to copy a low-level
|
||||
* function body into special memory.
|
||||
*
|
||||
* For example, when reconfiguring the SDRAM controller, the code doing the
|
||||
* reconfiguration may need to run from SRAM.
|
||||
*
|
||||
* NOTE: that the copied function body must be entirely self-contained and
|
||||
* position-independent in order for this to work properly.
|
||||
*
|
||||
* NOTE: in order for embedded literals and data to get referenced correctly,
|
||||
* the alignment of functions must be preserved when copying. To ensure this,
|
||||
* the source and destination addresses for fncpy() must be aligned to a
|
||||
* multiple of 8 bytes: you will be get a BUG() if this condition is not met.
|
||||
* You will typically need a ".align 3" directive in the assembler where the
|
||||
* function to be copied is defined, and ensure that your allocator for the
|
||||
* destination buffer returns 8-byte-aligned pointers.
|
||||
*
|
||||
* Typical usage example:
|
||||
*
|
||||
* extern int f(args);
|
||||
* extern uint32_t size_of_f;
|
||||
* int (*copied_f)(args);
|
||||
* void *sram_buffer;
|
||||
*
|
||||
* copied_f = fncpy(sram_buffer, &f, size_of_f);
|
||||
*
|
||||
* ... later, call the function: ...
|
||||
*
|
||||
* copied_f(args);
|
||||
*
|
||||
* The size of the function to be copied can't be determined from C:
|
||||
* this must be determined by other means, such as adding assmbler directives
|
||||
* in the file where f is defined.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_FNCPY_H
|
||||
#define __ASM_FNCPY_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#include <asm/bug.h>
|
||||
#include <asm/cacheflush.h>
|
||||
|
||||
/*
|
||||
* Minimum alignment requirement for the source and destination addresses
|
||||
* for function copying.
|
||||
*/
|
||||
#define FNCPY_ALIGN 8
|
||||
|
||||
#define fncpy(dest_buf, funcp, size) ({ \
|
||||
uintptr_t __funcp_address; \
|
||||
typeof(funcp) __result; \
|
||||
\
|
||||
asm("" : "=r" (__funcp_address) : "0" (funcp)); \
|
||||
\
|
||||
/* \
|
||||
* Ensure alignment of source and destination addresses, \
|
||||
* disregarding the function's Thumb bit: \
|
||||
*/ \
|
||||
BUG_ON((uintptr_t)(dest_buf) & (FNCPY_ALIGN - 1) || \
|
||||
(__funcp_address & ~(uintptr_t)1 & (FNCPY_ALIGN - 1))); \
|
||||
\
|
||||
memcpy(dest_buf, (void const *)(__funcp_address & ~1), size); \
|
||||
flush_icache_range((unsigned long)(dest_buf), \
|
||||
(unsigned long)(dest_buf) + (size)); \
|
||||
\
|
||||
asm("" : "=r" (__result) \
|
||||
: "0" ((uintptr_t)(dest_buf) | (__funcp_address & 1))); \
|
||||
\
|
||||
__result; \
|
||||
})
|
||||
|
||||
#endif /* !__ASM_FNCPY_H */
|
@ -35,7 +35,7 @@
|
||||
: "cc", "memory")
|
||||
|
||||
static inline int
|
||||
futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
|
||||
futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
|
||||
{
|
||||
int op = (encoded_op >> 28) & 7;
|
||||
int cmp = (encoded_op >> 24) & 15;
|
||||
@ -46,7 +46,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
|
||||
if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
|
||||
oparg = 1 << oparg;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
|
||||
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
|
||||
return -EFAULT;
|
||||
|
||||
pagefault_disable(); /* implies preempt_disable() */
|
||||
@ -88,36 +88,35 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
|
||||
}
|
||||
|
||||
static inline int
|
||||
futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
|
||||
futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
|
||||
u32 oldval, u32 newval)
|
||||
{
|
||||
int val;
|
||||
int ret = 0;
|
||||
u32 val;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
|
||||
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
|
||||
return -EFAULT;
|
||||
|
||||
pagefault_disable(); /* implies preempt_disable() */
|
||||
|
||||
__asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n"
|
||||
"1: " T(ldr) " %0, [%3]\n"
|
||||
" teq %0, %1\n"
|
||||
"1: " T(ldr) " %1, [%4]\n"
|
||||
" teq %1, %2\n"
|
||||
" it eq @ explicit IT needed for the 2b label\n"
|
||||
"2: " T(streq) " %2, [%3]\n"
|
||||
"2: " T(streq) " %3, [%4]\n"
|
||||
"3:\n"
|
||||
" .pushsection __ex_table,\"a\"\n"
|
||||
" .align 3\n"
|
||||
" .long 1b, 4f, 2b, 4f\n"
|
||||
" .popsection\n"
|
||||
" .pushsection .fixup,\"ax\"\n"
|
||||
"4: mov %0, %4\n"
|
||||
"4: mov %0, %5\n"
|
||||
" b 3b\n"
|
||||
" .popsection"
|
||||
: "=&r" (val)
|
||||
: "+r" (ret), "=&r" (val)
|
||||
: "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT)
|
||||
: "cc", "memory");
|
||||
|
||||
pagefault_enable(); /* subsumes preempt_enable() */
|
||||
|
||||
return val;
|
||||
*uval = val;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* !SMP */
|
||||
|
146
arch/arm/include/asm/glue-cache.h
Normal file
146
arch/arm/include/asm/glue-cache.h
Normal file
@ -0,0 +1,146 @@
|
||||
/*
|
||||
* arch/arm/include/asm/glue-cache.h
|
||||
*
|
||||
* Copyright (C) 1999-2002 Russell King
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef ASM_GLUE_CACHE_H
|
||||
#define ASM_GLUE_CACHE_H
|
||||
|
||||
#include <asm/glue.h>
|
||||
|
||||
/*
|
||||
* Cache Model
|
||||
* ===========
|
||||
*/
|
||||
#undef _CACHE
|
||||
#undef MULTI_CACHE
|
||||
|
||||
#if defined(CONFIG_CPU_CACHE_V3)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE v3
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_CACHE_V4)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE v4
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \
|
||||
defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020) || \
|
||||
defined(CONFIG_CPU_ARM1026)
|
||||
# define MULTI_CACHE 1
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_FA526)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE fa
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_ARM926T)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE arm926
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_ARM940T)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE arm940
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_ARM946E)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE arm946
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_CACHE_V4WB)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE v4wb
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_XSCALE)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE xscale
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_XSC3)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE xsc3
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_MOHAWK)
|
||||
# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
# else
|
||||
# define _CACHE mohawk
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_FEROCEON)
|
||||
# define MULTI_CACHE 1
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
|
||||
//# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
//# else
|
||||
//# define _CACHE v6
|
||||
//# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_V7)
|
||||
//# ifdef _CACHE
|
||||
# define MULTI_CACHE 1
|
||||
//# else
|
||||
//# define _CACHE v7
|
||||
//# endif
|
||||
#endif
|
||||
|
||||
#if !defined(_CACHE) && !defined(MULTI_CACHE)
|
||||
#error Unknown cache maintainence model
|
||||
#endif
|
||||
|
||||
#ifndef MULTI_CACHE
|
||||
#define __cpuc_flush_icache_all __glue(_CACHE,_flush_icache_all)
|
||||
#define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all)
|
||||
#define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all)
|
||||
#define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
|
||||
#define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
|
||||
#define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
|
||||
#define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
|
||||
|
||||
#define dmac_map_area __glue(_CACHE,_dma_map_area)
|
||||
#define dmac_unmap_area __glue(_CACHE,_dma_unmap_area)
|
||||
#define dmac_flush_range __glue(_CACHE,_dma_flush_range)
|
||||
#endif
|
||||
|
||||
#endif
|
110
arch/arm/include/asm/glue-df.h
Normal file
110
arch/arm/include/asm/glue-df.h
Normal file
@ -0,0 +1,110 @@
|
||||
/*
|
||||
* arch/arm/include/asm/glue-df.h
|
||||
*
|
||||
* Copyright (C) 1997-1999 Russell King
|
||||
* Copyright (C) 2000-2002 Deep Blue Solutions Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef ASM_GLUE_DF_H
|
||||
#define ASM_GLUE_DF_H
|
||||
|
||||
#include <asm/glue.h>
|
||||
|
||||
/*
|
||||
* Data Abort Model
|
||||
* ================
|
||||
*
|
||||
* We have the following to choose from:
|
||||
* arm6 - ARM6 style
|
||||
* arm7 - ARM7 style
|
||||
* v4_early - ARMv4 without Thumb early abort handler
|
||||
* v4t_late - ARMv4 with Thumb late abort handler
|
||||
* v4t_early - ARMv4 with Thumb early abort handler
|
||||
* v5tej_early - ARMv5 with Thumb and Java early abort handler
|
||||
* xscale - ARMv5 with Thumb with Xscale extensions
|
||||
* v6_early - ARMv6 generic early abort handler
|
||||
* v7_early - ARMv7 generic early abort handler
|
||||
*/
|
||||
#undef CPU_DABORT_HANDLER
|
||||
#undef MULTI_DABORT
|
||||
|
||||
#if defined(CONFIG_CPU_ARM610)
|
||||
# ifdef CPU_DABORT_HANDLER
|
||||
# define MULTI_DABORT 1
|
||||
# else
|
||||
# define CPU_DABORT_HANDLER cpu_arm6_data_abort
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_ARM710)
|
||||
# ifdef CPU_DABORT_HANDLER
|
||||
# define MULTI_DABORT 1
|
||||
# else
|
||||
# define CPU_DABORT_HANDLER cpu_arm7_data_abort
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ABRT_LV4T
|
||||
# ifdef CPU_DABORT_HANDLER
|
||||
# define MULTI_DABORT 1
|
||||
# else
|
||||
# define CPU_DABORT_HANDLER v4t_late_abort
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ABRT_EV4
|
||||
# ifdef CPU_DABORT_HANDLER
|
||||
# define MULTI_DABORT 1
|
||||
# else
|
||||
# define CPU_DABORT_HANDLER v4_early_abort
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ABRT_EV4T
|
||||
# ifdef CPU_DABORT_HANDLER
|
||||
# define MULTI_DABORT 1
|
||||
# else
|
||||
# define CPU_DABORT_HANDLER v4t_early_abort
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ABRT_EV5TJ
|
||||
# ifdef CPU_DABORT_HANDLER
|
||||
# define MULTI_DABORT 1
|
||||
# else
|
||||
# define CPU_DABORT_HANDLER v5tj_early_abort
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ABRT_EV5T
|
||||
# ifdef CPU_DABORT_HANDLER
|
||||
# define MULTI_DABORT 1
|
||||
# else
|
||||
# define CPU_DABORT_HANDLER v5t_early_abort
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ABRT_EV6
|
||||
# ifdef CPU_DABORT_HANDLER
|
||||
# define MULTI_DABORT 1
|
||||
# else
|
||||
# define CPU_DABORT_HANDLER v6_early_abort
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ABRT_EV7
|
||||
# ifdef CPU_DABORT_HANDLER
|
||||
# define MULTI_DABORT 1
|
||||
# else
|
||||
# define CPU_DABORT_HANDLER v7_early_abort
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CPU_DABORT_HANDLER
|
||||
#error Unknown data abort handler type
|
||||
#endif
|
||||
|
||||
#endif
|
57
arch/arm/include/asm/glue-pf.h
Normal file
57
arch/arm/include/asm/glue-pf.h
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* arch/arm/include/asm/glue-pf.h
|
||||
*
|
||||
* Copyright (C) 1997-1999 Russell King
|
||||
* Copyright (C) 2000-2002 Deep Blue Solutions Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef ASM_GLUE_PF_H
|
||||
#define ASM_GLUE_PF_H
|
||||
|
||||
#include <asm/glue.h>
|
||||
|
||||
/*
|
||||
* Prefetch Abort Model
|
||||
* ================
|
||||
*
|
||||
* We have the following to choose from:
|
||||
* legacy - no IFSR, no IFAR
|
||||
* v6 - ARMv6: IFSR, no IFAR
|
||||
* v7 - ARMv7: IFSR and IFAR
|
||||
*/
|
||||
|
||||
#undef CPU_PABORT_HANDLER
|
||||
#undef MULTI_PABORT
|
||||
|
||||
#ifdef CONFIG_CPU_PABRT_LEGACY
|
||||
# ifdef CPU_PABORT_HANDLER
|
||||
# define MULTI_PABORT 1
|
||||
# else
|
||||
# define CPU_PABORT_HANDLER legacy_pabort
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_PABRT_V6
|
||||
# ifdef CPU_PABORT_HANDLER
|
||||
# define MULTI_PABORT 1
|
||||
# else
|
||||
# define CPU_PABORT_HANDLER v6_pabort
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_PABRT_V7
|
||||
# ifdef CPU_PABORT_HANDLER
|
||||
# define MULTI_PABORT 1
|
||||
# else
|
||||
# define CPU_PABORT_HANDLER v7_pabort
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CPU_PABORT_HANDLER
|
||||
#error Unknown prefetch abort handler type
|
||||
#endif
|
||||
|
||||
#endif
|
264
arch/arm/include/asm/glue-proc.h
Normal file
264
arch/arm/include/asm/glue-proc.h
Normal file
@ -0,0 +1,264 @@
|
||||
/*
|
||||
* arch/arm/include/asm/glue-proc.h
|
||||
*
|
||||
* Copyright (C) 1997-1999 Russell King
|
||||
* Copyright (C) 2000 Deep Blue Solutions Ltd
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef ASM_GLUE_PROC_H
|
||||
#define ASM_GLUE_PROC_H
|
||||
|
||||
#include <asm/glue.h>
|
||||
|
||||
/*
|
||||
* Work out if we need multiple CPU support
|
||||
*/
|
||||
#undef MULTI_CPU
|
||||
#undef CPU_NAME
|
||||
|
||||
/*
|
||||
* CPU_NAME - the prefix for CPU related functions
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_CPU_ARM610
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm6
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM7TDMI
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm7tdmi
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM710
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm7
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM720T
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm720
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM740T
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm740
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM9TDMI
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm9tdmi
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM920T
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm920
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM922T
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm922
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_FA526
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_fa526
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM925T
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm925
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM926T
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm926
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM940T
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm940
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM946E
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm946
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_SA110
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_sa110
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_SA1100
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_sa1100
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM1020
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm1020
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM1020E
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm1020e
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM1022
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm1022
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_ARM1026
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_arm1026
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_XSCALE
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_xscale
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_XSC3
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_xsc3
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_MOHAWK
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_mohawk
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_FEROCEON
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_feroceon
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_v6
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_V7
|
||||
# ifdef CPU_NAME
|
||||
# undef MULTI_CPU
|
||||
# define MULTI_CPU
|
||||
# else
|
||||
# define CPU_NAME cpu_v7
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MULTI_CPU
|
||||
#define cpu_proc_init __glue(CPU_NAME,_proc_init)
|
||||
#define cpu_proc_fin __glue(CPU_NAME,_proc_fin)
|
||||
#define cpu_reset __glue(CPU_NAME,_reset)
|
||||
#define cpu_do_idle __glue(CPU_NAME,_do_idle)
|
||||
#define cpu_dcache_clean_area __glue(CPU_NAME,_dcache_clean_area)
|
||||
#define cpu_do_switch_mm __glue(CPU_NAME,_switch_mm)
|
||||
#define cpu_set_pte_ext __glue(CPU_NAME,_set_pte_ext)
|
||||
#define cpu_suspend_size __glue(CPU_NAME,_suspend_size)
|
||||
#define cpu_do_suspend __glue(CPU_NAME,_do_suspend)
|
||||
#define cpu_do_resume __glue(CPU_NAME,_do_resume)
|
||||
#endif
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user