mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-03 09:26:48 +07:00
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
This commit is contained in:
commit
f315ccb3e6
@ -59,7 +59,7 @@
|
||||
<title>Introduction</title>
|
||||
<para>
|
||||
This document describes the interfaces available for device drivers that
|
||||
drive s390 based channel attached devices. This includes interfaces for
|
||||
drive s390 based channel attached I/O devices. This includes interfaces for
|
||||
interaction with the hardware and interfaces for interacting with the
|
||||
common driver core. Those interfaces are provided by the s390 common I/O
|
||||
layer.
|
||||
@ -86,9 +86,10 @@
|
||||
The ccw bus typically contains the majority of devices available to
|
||||
a s390 system. Named after the channel command word (ccw), the basic
|
||||
command structure used to address its devices, the ccw bus contains
|
||||
so-called channel attached devices. They are addressed via subchannels,
|
||||
visible on the css bus. A device driver, however, will never interact
|
||||
with the subchannel directly, but only via the device on the ccw bus,
|
||||
so-called channel attached devices. They are addressed via I/O
|
||||
subchannels, visible on the css bus. A device driver for
|
||||
channel-attached devices, however, will never interact with the
|
||||
subchannel directly, but only via the I/O device on the ccw bus,
|
||||
the ccw device.
|
||||
</para>
|
||||
<sect1 id="channelIO">
|
||||
@ -116,7 +117,6 @@
|
||||
!Iinclude/asm-s390/ccwdev.h
|
||||
!Edrivers/s390/cio/device.c
|
||||
!Edrivers/s390/cio/device_ops.c
|
||||
!Edrivers/s390/cio/airq.c
|
||||
</sect1>
|
||||
<sect1 id="cmf">
|
||||
<title>The channel-measurement facility</title>
|
||||
@ -147,4 +147,15 @@
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
<chapter id="genericinterfaces">
|
||||
<title>Generic interfaces</title>
|
||||
<para>
|
||||
Some interfaces are available to other drivers that do not necessarily
|
||||
have anything to do with the busses described above, but still are
|
||||
indirectly using basic infrastructure in the common I/O layer.
|
||||
One example is the support for adapter interrupts.
|
||||
</para>
|
||||
!Edrivers/s390/cio/airq.c
|
||||
</chapter>
|
||||
|
||||
</book>
|
||||
|
493
Documentation/Smack.txt
Normal file
493
Documentation/Smack.txt
Normal file
@ -0,0 +1,493 @@
|
||||
|
||||
|
||||
"Good for you, you've decided to clean the elevator!"
|
||||
- The Elevator, from Dark Star
|
||||
|
||||
Smack is the the Simplified Mandatory Access Control Kernel.
|
||||
Smack is a kernel based implementation of mandatory access
|
||||
control that includes simplicity in its primary design goals.
|
||||
|
||||
Smack is not the only Mandatory Access Control scheme
|
||||
available for Linux. Those new to Mandatory Access Control
|
||||
are encouraged to compare Smack with the other mechanisms
|
||||
available to determine which is best suited to the problem
|
||||
at hand.
|
||||
|
||||
Smack consists of three major components:
|
||||
- The kernel
|
||||
- A start-up script and a few modified applications
|
||||
- Configuration data
|
||||
|
||||
The kernel component of Smack is implemented as a Linux
|
||||
Security Modules (LSM) module. It requires netlabel and
|
||||
works best with file systems that support extended attributes,
|
||||
although xattr support is not strictly required.
|
||||
It is safe to run a Smack kernel under a "vanilla" distribution.
|
||||
Smack kernels use the CIPSO IP option. Some network
|
||||
configurations are intolerant of IP options and can impede
|
||||
access to systems that use them as Smack does.
|
||||
|
||||
The startup script etc-init.d-smack should be installed
|
||||
in /etc/init.d/smack and should be invoked early in the
|
||||
start-up process. On Fedora rc5.d/S02smack is recommended.
|
||||
This script ensures that certain devices have the correct
|
||||
Smack attributes and loads the Smack configuration if
|
||||
any is defined. This script invokes two programs that
|
||||
ensure configuration data is properly formatted. These
|
||||
programs are /usr/sbin/smackload and /usr/sin/smackcipso.
|
||||
The system will run just fine without these programs,
|
||||
but it will be difficult to set access rules properly.
|
||||
|
||||
A version of "ls" that provides a "-M" option to display
|
||||
Smack labels on long listing is available.
|
||||
|
||||
A hacked version of sshd that allows network logins by users
|
||||
with specific Smack labels is available. This version does
|
||||
not work for scp. You must set the /etc/ssh/sshd_config
|
||||
line:
|
||||
UsePrivilegeSeparation no
|
||||
|
||||
The format of /etc/smack/usr is:
|
||||
|
||||
username smack
|
||||
|
||||
In keeping with the intent of Smack, configuration data is
|
||||
minimal and not strictly required. The most important
|
||||
configuration step is mounting the smackfs pseudo filesystem.
|
||||
|
||||
Add this line to /etc/fstab:
|
||||
|
||||
smackfs /smack smackfs smackfsdef=* 0 0
|
||||
|
||||
and create the /smack directory for mounting.
|
||||
|
||||
Smack uses extended attributes (xattrs) to store file labels.
|
||||
The command to set a Smack label on a file is:
|
||||
|
||||
# attr -S -s SMACK64 -V "value" path
|
||||
|
||||
NOTE: Smack labels are limited to 23 characters. The attr command
|
||||
does not enforce this restriction and can be used to set
|
||||
invalid Smack labels on files.
|
||||
|
||||
If you don't do anything special all users will get the floor ("_")
|
||||
label when they log in. If you do want to log in via the hacked ssh
|
||||
at other labels use the attr command to set the smack value on the
|
||||
home directory and it's contents.
|
||||
|
||||
You can add access rules in /etc/smack/accesses. They take the form:
|
||||
|
||||
subjectlabel objectlabel access
|
||||
|
||||
access is a combination of the letters rwxa which specify the
|
||||
kind of access permitted a subject with subjectlabel on an
|
||||
object with objectlabel. If there is no rule no access is allowed.
|
||||
|
||||
A process can see the smack label it is running with by
|
||||
reading /proc/self/attr/current. A privileged process can
|
||||
set the process smack by writing there.
|
||||
|
||||
Look for additional programs on http://schaufler-ca.com
|
||||
|
||||
From the Smack Whitepaper:
|
||||
|
||||
The Simplified Mandatory Access Control Kernel
|
||||
|
||||
Casey Schaufler
|
||||
casey@schaufler-ca.com
|
||||
|
||||
Mandatory Access Control
|
||||
|
||||
Computer systems employ a variety of schemes to constrain how information is
|
||||
shared among the people and services using the machine. Some of these schemes
|
||||
allow the program or user to decide what other programs or users are allowed
|
||||
access to pieces of data. These schemes are called discretionary access
|
||||
control mechanisms because the access control is specified at the discretion
|
||||
of the user. Other schemes do not leave the decision regarding what a user or
|
||||
program can access up to users or programs. These schemes are called mandatory
|
||||
access control mechanisms because you don't have a choice regarding the users
|
||||
or programs that have access to pieces of data.
|
||||
|
||||
Bell & LaPadula
|
||||
|
||||
From the middle of the 1980's until the turn of the century Mandatory Access
|
||||
Control (MAC) was very closely associated with the Bell & LaPadula security
|
||||
model, a mathematical description of the United States Department of Defense
|
||||
policy for marking paper documents. MAC in this form enjoyed a following
|
||||
within the Capital Beltway and Scandinavian supercomputer centers but was
|
||||
often sited as failing to address general needs.
|
||||
|
||||
Domain Type Enforcement
|
||||
|
||||
Around the turn of the century Domain Type Enforcement (DTE) became popular.
|
||||
This scheme organizes users, programs, and data into domains that are
|
||||
protected from each other. This scheme has been widely deployed as a component
|
||||
of popular Linux distributions. The administrative overhead required to
|
||||
maintain this scheme and the detailed understanding of the whole system
|
||||
necessary to provide a secure domain mapping leads to the scheme being
|
||||
disabled or used in limited ways in the majority of cases.
|
||||
|
||||
Smack
|
||||
|
||||
Smack is a Mandatory Access Control mechanism designed to provide useful MAC
|
||||
while avoiding the pitfalls of its predecessors. The limitations of Bell &
|
||||
LaPadula are addressed by providing a scheme whereby access can be controlled
|
||||
according to the requirements of the system and its purpose rather than those
|
||||
imposed by an arcane government policy. The complexity of Domain Type
|
||||
Enforcement and avoided by defining access controls in terms of the access
|
||||
modes already in use.
|
||||
|
||||
Smack Terminology
|
||||
|
||||
The jargon used to talk about Smack will be familiar to those who have dealt
|
||||
with other MAC systems and shouldn't be too difficult for the uninitiated to
|
||||
pick up. There are four terms that are used in a specific way and that are
|
||||
especially important:
|
||||
|
||||
Subject: A subject is an active entity on the computer system.
|
||||
On Smack a subject is a task, which is in turn the basic unit
|
||||
of execution.
|
||||
|
||||
Object: An object is a passive entity on the computer system.
|
||||
On Smack files of all types, IPC, and tasks can be objects.
|
||||
|
||||
Access: Any attempt by a subject to put information into or get
|
||||
information from an object is an access.
|
||||
|
||||
Label: Data that identifies the Mandatory Access Control
|
||||
characteristics of a subject or an object.
|
||||
|
||||
These definitions are consistent with the traditional use in the security
|
||||
community. There are also some terms from Linux that are likely to crop up:
|
||||
|
||||
Capability: A task that possesses a capability has permission to
|
||||
violate an aspect of the system security policy, as identified by
|
||||
the specific capability. A task that possesses one or more
|
||||
capabilities is a privileged task, whereas a task with no
|
||||
capabilities is an unprivileged task.
|
||||
|
||||
Privilege: A task that is allowed to violate the system security
|
||||
policy is said to have privilege. As of this writing a task can
|
||||
have privilege either by possessing capabilities or by having an
|
||||
effective user of root.
|
||||
|
||||
Smack Basics
|
||||
|
||||
Smack is an extension to a Linux system. It enforces additional restrictions
|
||||
on what subjects can access which objects, based on the labels attached to
|
||||
each of the subject and the object.
|
||||
|
||||
Labels
|
||||
|
||||
Smack labels are ASCII character strings, one to twenty-three characters in
|
||||
length. Single character labels using special characters, that being anything
|
||||
other than a letter or digit, are reserved for use by the Smack development
|
||||
team. Smack labels are unstructured, case sensitive, and the only operation
|
||||
ever performed on them is comparison for equality. Smack labels cannot
|
||||
contain unprintable characters or the "/" (slash) character.
|
||||
|
||||
There are some predefined labels:
|
||||
|
||||
_ Pronounced "floor", a single underscore character.
|
||||
^ Pronounced "hat", a single circumflex character.
|
||||
* Pronounced "star", a single asterisk character.
|
||||
? Pronounced "huh", a single question mark character.
|
||||
|
||||
Every task on a Smack system is assigned a label. System tasks, such as
|
||||
init(8) and systems daemons, are run with the floor ("_") label. User tasks
|
||||
are assigned labels according to the specification found in the
|
||||
/etc/smack/user configuration file.
|
||||
|
||||
Access Rules
|
||||
|
||||
Smack uses the traditional access modes of Linux. These modes are read,
|
||||
execute, write, and occasionally append. There are a few cases where the
|
||||
access mode may not be obvious. These include:
|
||||
|
||||
Signals: A signal is a write operation from the subject task to
|
||||
the object task.
|
||||
Internet Domain IPC: Transmission of a packet is considered a
|
||||
write operation from the source task to the destination task.
|
||||
|
||||
Smack restricts access based on the label attached to a subject and the label
|
||||
attached to the object it is trying to access. The rules enforced are, in
|
||||
order:
|
||||
|
||||
1. Any access requested by a task labeled "*" is denied.
|
||||
2. A read or execute access requested by a task labeled "^"
|
||||
is permitted.
|
||||
3. A read or execute access requested on an object labeled "_"
|
||||
is permitted.
|
||||
4. Any access requested on an object labeled "*" is permitted.
|
||||
5. Any access requested by a task on an object with the same
|
||||
label is permitted.
|
||||
6. Any access requested that is explicitly defined in the loaded
|
||||
rule set is permitted.
|
||||
7. Any other access is denied.
|
||||
|
||||
Smack Access Rules
|
||||
|
||||
With the isolation provided by Smack access separation is simple. There are
|
||||
many interesting cases where limited access by subjects to objects with
|
||||
different labels is desired. One example is the familiar spy model of
|
||||
sensitivity, where a scientist working on a highly classified project would be
|
||||
able to read documents of lower classifications and anything she writes will
|
||||
be "born" highly classified. To accommodate such schemes Smack includes a
|
||||
mechanism for specifying rules allowing access between labels.
|
||||
|
||||
Access Rule Format
|
||||
|
||||
The format of an access rule is:
|
||||
|
||||
subject-label object-label access
|
||||
|
||||
Where subject-label is the Smack label of the task, object-label is the Smack
|
||||
label of the thing being accessed, and access is a string specifying the sort
|
||||
of access allowed. The Smack labels are limited to 23 characters. The access
|
||||
specification is searched for letters that describe access modes:
|
||||
|
||||
a: indicates that append access should be granted.
|
||||
r: indicates that read access should be granted.
|
||||
w: indicates that write access should be granted.
|
||||
x: indicates that execute access should be granted.
|
||||
|
||||
Uppercase values for the specification letters are allowed as well.
|
||||
Access mode specifications can be in any order. Examples of acceptable rules
|
||||
are:
|
||||
|
||||
TopSecret Secret rx
|
||||
Secret Unclass R
|
||||
Manager Game x
|
||||
User HR w
|
||||
New Old rRrRr
|
||||
Closed Off -
|
||||
|
||||
Examples of unacceptable rules are:
|
||||
|
||||
Top Secret Secret rx
|
||||
Ace Ace r
|
||||
Odd spells waxbeans
|
||||
|
||||
Spaces are not allowed in labels. Since a subject always has access to files
|
||||
with the same label specifying a rule for that case is pointless. Only
|
||||
valid letters (rwxaRWXA) and the dash ('-') character are allowed in
|
||||
access specifications. The dash is a placeholder, so "a-r" is the same
|
||||
as "ar". A lone dash is used to specify that no access should be allowed.
|
||||
|
||||
Applying Access Rules
|
||||
|
||||
The developers of Linux rarely define new sorts of things, usually importing
|
||||
schemes and concepts from other systems. Most often, the other systems are
|
||||
variants of Unix. Unix has many endearing properties, but consistency of
|
||||
access control models is not one of them. Smack strives to treat accesses as
|
||||
uniformly as is sensible while keeping with the spirit of the underlying
|
||||
mechanism.
|
||||
|
||||
File system objects including files, directories, named pipes, symbolic links,
|
||||
and devices require access permissions that closely match those used by mode
|
||||
bit access. To open a file for reading read access is required on the file. To
|
||||
search a directory requires execute access. Creating a file with write access
|
||||
requires both read and write access on the containing directory. Deleting a
|
||||
file requires read and write access to the file and to the containing
|
||||
directory. It is possible that a user may be able to see that a file exists
|
||||
but not any of its attributes by the circumstance of having read access to the
|
||||
containing directory but not to the differently labeled file. This is an
|
||||
artifact of the file name being data in the directory, not a part of the file.
|
||||
|
||||
IPC objects, message queues, semaphore sets, and memory segments exist in flat
|
||||
namespaces and access requests are only required to match the object in
|
||||
question.
|
||||
|
||||
Process objects reflect tasks on the system and the Smack label used to access
|
||||
them is the same Smack label that the task would use for its own access
|
||||
attempts. Sending a signal via the kill() system call is a write operation
|
||||
from the signaler to the recipient. Debugging a process requires both reading
|
||||
and writing. Creating a new task is an internal operation that results in two
|
||||
tasks with identical Smack labels and requires no access checks.
|
||||
|
||||
Sockets are data structures attached to processes and sending a packet from
|
||||
one process to another requires that the sender have write access to the
|
||||
receiver. The receiver is not required to have read access to the sender.
|
||||
|
||||
Setting Access Rules
|
||||
|
||||
The configuration file /etc/smack/accesses contains the rules to be set at
|
||||
system startup. The contents are written to the special file /smack/load.
|
||||
Rules can be written to /smack/load at any time and take effect immediately.
|
||||
For any pair of subject and object labels there can be only one rule, with the
|
||||
most recently specified overriding any earlier specification.
|
||||
|
||||
The program smackload is provided to ensure data is formatted
|
||||
properly when written to /smack/load. This program reads lines
|
||||
of the form
|
||||
|
||||
subjectlabel objectlabel mode.
|
||||
|
||||
Task Attribute
|
||||
|
||||
The Smack label of a process can be read from /proc/<pid>/attr/current. A
|
||||
process can read its own Smack label from /proc/self/attr/current. A
|
||||
privileged process can change its own Smack label by writing to
|
||||
/proc/self/attr/current but not the label of another process.
|
||||
|
||||
File Attribute
|
||||
|
||||
The Smack label of a filesystem object is stored as an extended attribute
|
||||
named SMACK64 on the file. This attribute is in the security namespace. It can
|
||||
only be changed by a process with privilege.
|
||||
|
||||
Privilege
|
||||
|
||||
A process with CAP_MAC_OVERRIDE is privileged.
|
||||
|
||||
Smack Networking
|
||||
|
||||
As mentioned before, Smack enforces access control on network protocol
|
||||
transmissions. Every packet sent by a Smack process is tagged with its Smack
|
||||
label. This is done by adding a CIPSO tag to the header of the IP packet. Each
|
||||
packet received is expected to have a CIPSO tag that identifies the label and
|
||||
if it lacks such a tag the network ambient label is assumed. Before the packet
|
||||
is delivered a check is made to determine that a subject with the label on the
|
||||
packet has write access to the receiving process and if that is not the case
|
||||
the packet is dropped.
|
||||
|
||||
CIPSO Configuration
|
||||
|
||||
It is normally unnecessary to specify the CIPSO configuration. The default
|
||||
values used by the system handle all internal cases. Smack will compose CIPSO
|
||||
label values to match the Smack labels being used without administrative
|
||||
intervention. Unlabeled packets that come into the system will be given the
|
||||
ambient label.
|
||||
|
||||
Smack requires configuration in the case where packets from a system that is
|
||||
not smack that speaks CIPSO may be encountered. Usually this will be a Trusted
|
||||
Solaris system, but there are other, less widely deployed systems out there.
|
||||
CIPSO provides 3 important values, a Domain Of Interpretation (DOI), a level,
|
||||
and a category set with each packet. The DOI is intended to identify a group
|
||||
of systems that use compatible labeling schemes, and the DOI specified on the
|
||||
smack system must match that of the remote system or packets will be
|
||||
discarded. The DOI is 3 by default. The value can be read from /smack/doi and
|
||||
can be changed by writing to /smack/doi.
|
||||
|
||||
The label and category set are mapped to a Smack label as defined in
|
||||
/etc/smack/cipso.
|
||||
|
||||
A Smack/CIPSO mapping has the form:
|
||||
|
||||
smack level [category [category]*]
|
||||
|
||||
Smack does not expect the level or category sets to be related in any
|
||||
particular way and does not assume or assign accesses based on them. Some
|
||||
examples of mappings:
|
||||
|
||||
TopSecret 7
|
||||
TS:A,B 7 1 2
|
||||
SecBDE 5 2 4 6
|
||||
RAFTERS 7 12 26
|
||||
|
||||
The ":" and "," characters are permitted in a Smack label but have no special
|
||||
meaning.
|
||||
|
||||
The mapping of Smack labels to CIPSO values is defined by writing to
|
||||
/smack/cipso. Again, the format of data written to this special file
|
||||
is highly restrictive, so the program smackcipso is provided to
|
||||
ensure the writes are done properly. This program takes mappings
|
||||
on the standard input and sends them to /smack/cipso properly.
|
||||
|
||||
In addition to explicit mappings Smack supports direct CIPSO mappings. One
|
||||
CIPSO level is used to indicate that the category set passed in the packet is
|
||||
in fact an encoding of the Smack label. The level used is 250 by default. The
|
||||
value can be read from /smack/direct and changed by writing to /smack/direct.
|
||||
|
||||
Socket Attributes
|
||||
|
||||
There are two attributes that are associated with sockets. These attributes
|
||||
can only be set by privileged tasks, but any task can read them for their own
|
||||
sockets.
|
||||
|
||||
SMACK64IPIN: The Smack label of the task object. A privileged
|
||||
program that will enforce policy may set this to the star label.
|
||||
|
||||
SMACK64IPOUT: The Smack label transmitted with outgoing packets.
|
||||
A privileged program may set this to match the label of another
|
||||
task with which it hopes to communicate.
|
||||
|
||||
Writing Applications for Smack
|
||||
|
||||
There are three sorts of applications that will run on a Smack system. How an
|
||||
application interacts with Smack will determine what it will have to do to
|
||||
work properly under Smack.
|
||||
|
||||
Smack Ignorant Applications
|
||||
|
||||
By far the majority of applications have no reason whatever to care about the
|
||||
unique properties of Smack. Since invoking a program has no impact on the
|
||||
Smack label associated with the process the only concern likely to arise is
|
||||
whether the process has execute access to the program.
|
||||
|
||||
Smack Relevant Applications
|
||||
|
||||
Some programs can be improved by teaching them about Smack, but do not make
|
||||
any security decisions themselves. The utility ls(1) is one example of such a
|
||||
program.
|
||||
|
||||
Smack Enforcing Applications
|
||||
|
||||
These are special programs that not only know about Smack, but participate in
|
||||
the enforcement of system policy. In most cases these are the programs that
|
||||
set up user sessions. There are also network services that provide information
|
||||
to processes running with various labels.
|
||||
|
||||
File System Interfaces
|
||||
|
||||
Smack maintains labels on file system objects using extended attributes. The
|
||||
Smack label of a file, directory, or other file system object can be obtained
|
||||
using getxattr(2).
|
||||
|
||||
len = getxattr("/", "security.SMACK64", value, sizeof (value));
|
||||
|
||||
will put the Smack label of the root directory into value. A privileged
|
||||
process can set the Smack label of a file system object with setxattr(2).
|
||||
|
||||
len = strlen("Rubble");
|
||||
rc = setxattr("/foo", "security.SMACK64", "Rubble", len, 0);
|
||||
|
||||
will set the Smack label of /foo to "Rubble" if the program has appropriate
|
||||
privilege.
|
||||
|
||||
Socket Interfaces
|
||||
|
||||
The socket attributes can be read using fgetxattr(2).
|
||||
|
||||
A privileged process can set the Smack label of outgoing packets with
|
||||
fsetxattr(2).
|
||||
|
||||
len = strlen("Rubble");
|
||||
rc = fsetxattr(fd, "security.SMACK64IPOUT", "Rubble", len, 0);
|
||||
|
||||
will set the Smack label "Rubble" on packets going out from the socket if the
|
||||
program has appropriate privilege.
|
||||
|
||||
rc = fsetxattr(fd, "security.SMACK64IPIN, "*", strlen("*"), 0);
|
||||
|
||||
will set the Smack label "*" as the object label against which incoming
|
||||
packets will be checked if the program has appropriate privilege.
|
||||
|
||||
Administration
|
||||
|
||||
Smack supports some mount options:
|
||||
|
||||
smackfsdef=label: specifies the label to give files that lack
|
||||
the Smack label extended attribute.
|
||||
|
||||
smackfsroot=label: specifies the label to assign the root of the
|
||||
file system if it lacks the Smack extended attribute.
|
||||
|
||||
smackfshat=label: specifies a label that must have read access to
|
||||
all labels set on the filesystem. Not yet enforced.
|
||||
|
||||
smackfsfloor=label: specifies a label to which all labels set on the
|
||||
filesystem must have read access. Not yet enforced.
|
||||
|
||||
These mount options apply to all file system types.
|
||||
|
@ -1315,13 +1315,28 @@ for writeout by the pdflush daemons. It is expressed in 100'ths of a second.
|
||||
Data which has been dirty in-memory for longer than this interval will be
|
||||
written out next time a pdflush daemon wakes up.
|
||||
|
||||
highmem_is_dirtyable
|
||||
--------------------
|
||||
|
||||
Only present if CONFIG_HIGHMEM is set.
|
||||
|
||||
This defaults to 0 (false), meaning that the ratios set above are calculated
|
||||
as a percentage of lowmem only. This protects against excessive scanning
|
||||
in page reclaim, swapping and general VM distress.
|
||||
|
||||
Setting this to 1 can be useful on 32 bit machines where you want to make
|
||||
random changes within an MMAPed file that is larger than your available
|
||||
lowmem without causing large quantities of random IO. Is is safe if the
|
||||
behavior of all programs running on the machine is known and memory will
|
||||
not be otherwise stressed.
|
||||
|
||||
legacy_va_layout
|
||||
----------------
|
||||
|
||||
If non-zero, this sysctl disables the new 32-bit mmap mmap layout - the kernel
|
||||
will use the legacy (2.4) layout for all processes.
|
||||
|
||||
lower_zone_protection
|
||||
lowmem_reserve_ratio
|
||||
---------------------
|
||||
|
||||
For some specialised workloads on highmem machines it is dangerous for
|
||||
@ -1341,25 +1356,71 @@ captured into pinned user memory.
|
||||
mechanism will also defend that region from allocations which could use
|
||||
highmem or lowmem).
|
||||
|
||||
The `lower_zone_protection' tunable determines how aggressive the kernel is
|
||||
in defending these lower zones. The default value is zero - no
|
||||
protection at all.
|
||||
The `lowmem_reserve_ratio' tunable determines how aggressive the kernel is
|
||||
in defending these lower zones.
|
||||
|
||||
If you have a machine which uses highmem or ISA DMA and your
|
||||
applications are using mlock(), or if you are running with no swap then
|
||||
you probably should increase the lower_zone_protection setting.
|
||||
you probably should change the lowmem_reserve_ratio setting.
|
||||
|
||||
The units of this tunable are fairly vague. It is approximately equal
|
||||
to "megabytes," so setting lower_zone_protection=100 will protect around 100
|
||||
megabytes of the lowmem zone from user allocations. It will also make
|
||||
those 100 megabytes unavailable for use by applications and by
|
||||
pagecache, so there is a cost.
|
||||
The lowmem_reserve_ratio is an array. You can see them by reading this file.
|
||||
-
|
||||
% cat /proc/sys/vm/lowmem_reserve_ratio
|
||||
256 256 32
|
||||
-
|
||||
Note: # of this elements is one fewer than number of zones. Because the highest
|
||||
zone's value is not necessary for following calculation.
|
||||
|
||||
The effects of this tunable may be observed by monitoring
|
||||
/proc/meminfo:LowFree. Write a single huge file and observe the point
|
||||
at which LowFree ceases to fall.
|
||||
But, these values are not used directly. The kernel calculates # of protection
|
||||
pages for each zones from them. These are shown as array of protection pages
|
||||
in /proc/zoneinfo like followings. (This is an example of x86-64 box).
|
||||
Each zone has an array of protection pages like this.
|
||||
|
||||
A reasonable value for lower_zone_protection is 100.
|
||||
-
|
||||
Node 0, zone DMA
|
||||
pages free 1355
|
||||
min 3
|
||||
low 3
|
||||
high 4
|
||||
:
|
||||
:
|
||||
numa_other 0
|
||||
protection: (0, 2004, 2004, 2004)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
pagesets
|
||||
cpu: 0 pcp: 0
|
||||
:
|
||||
-
|
||||
These protections are added to score to judge whether this zone should be used
|
||||
for page allocation or should be reclaimed.
|
||||
|
||||
In this example, if normal pages (index=2) are required to this DMA zone and
|
||||
pages_high is used for watermark, the kernel judges this zone should not be
|
||||
used because pages_free(1355) is smaller than watermark + protection[2]
|
||||
(4 + 2004 = 2008). If this protection value is 0, this zone would be used for
|
||||
normal page requirement. If requirement is DMA zone(index=0), protection[0]
|
||||
(=0) is used.
|
||||
|
||||
zone[i]'s protection[j] is calculated by following exprssion.
|
||||
|
||||
(i < j):
|
||||
zone[i]->protection[j]
|
||||
= (total sums of present_pages from zone[i+1] to zone[j] on the node)
|
||||
/ lowmem_reserve_ratio[i];
|
||||
(i = j):
|
||||
(should not be protected. = 0;
|
||||
(i > j):
|
||||
(not necessary, but looks 0)
|
||||
|
||||
The default values of lowmem_reserve_ratio[i] are
|
||||
256 (if zone[i] means DMA or DMA32 zone)
|
||||
32 (others).
|
||||
As above expression, they are reciprocal number of ratio.
|
||||
256 means 1/256. # of protection pages becomes about "0.39%" of total present
|
||||
pages of higher zones on the node.
|
||||
|
||||
If you would like to protect more pages, smaller values are effective.
|
||||
The minimum value is 1 (1/1 -> 100%).
|
||||
|
||||
page-cluster
|
||||
------------
|
||||
|
@ -32,7 +32,7 @@ The exact capabilities of GPIOs vary between systems. Common options:
|
||||
- Input values are likewise readable (1, 0). Some chips support readback
|
||||
of pins configured as "output", which is very useful in such "wire-OR"
|
||||
cases (to support bidirectional signaling). GPIO controllers may have
|
||||
input de-glitch logic, sometimes with software controls.
|
||||
input de-glitch/debounce logic, sometimes with software controls.
|
||||
|
||||
- Inputs can often be used as IRQ signals, often edge triggered but
|
||||
sometimes level triggered. Such IRQs may be configurable as system
|
||||
@ -60,10 +60,13 @@ used on a board that's wired differently. Only least-common-denominator
|
||||
functionality can be very portable. Other features are platform-specific,
|
||||
and that can be critical for glue logic.
|
||||
|
||||
Plus, this doesn't define an implementation framework, just an interface.
|
||||
Plus, this doesn't require any implementation framework, just an interface.
|
||||
One platform might implement it as simple inline functions accessing chip
|
||||
registers; another might implement it by delegating through abstractions
|
||||
used for several very different kinds of GPIO controller.
|
||||
used for several very different kinds of GPIO controller. (There is some
|
||||
optional code supporting such an implementation strategy, described later
|
||||
in this document, but drivers acting as clients to the GPIO interface must
|
||||
not care how it's implemented.)
|
||||
|
||||
That said, if the convention is supported on their platform, drivers should
|
||||
use it when possible. Platforms should declare GENERIC_GPIO support in
|
||||
@ -121,6 +124,11 @@ before tasking is enabled, as part of early board setup.
|
||||
For output GPIOs, the value provided becomes the initial output value.
|
||||
This helps avoid signal glitching during system startup.
|
||||
|
||||
For compatibility with legacy interfaces to GPIOs, setting the direction
|
||||
of a GPIO implicitly requests that GPIO (see below) if it has not been
|
||||
requested already. That compatibility may be removed in the future;
|
||||
explicitly requesting GPIOs is strongly preferred.
|
||||
|
||||
Setting the direction can fail if the GPIO number is invalid, or when
|
||||
that particular GPIO can't be used in that mode. It's generally a bad
|
||||
idea to rely on boot firmware to have set the direction correctly, since
|
||||
@ -133,6 +141,7 @@ Spinlock-Safe GPIO access
|
||||
-------------------------
|
||||
Most GPIO controllers can be accessed with memory read/write instructions.
|
||||
That doesn't need to sleep, and can safely be done from inside IRQ handlers.
|
||||
(That includes hardirq contexts on RT kernels.)
|
||||
|
||||
Use these calls to access such GPIOs:
|
||||
|
||||
@ -145,7 +154,7 @@ Use these calls to access such GPIOs:
|
||||
The values are boolean, zero for low, nonzero for high. When reading the
|
||||
value of an output pin, the value returned should be what's seen on the
|
||||
pin ... that won't always match the specified output value, because of
|
||||
issues including wire-OR and output latencies.
|
||||
issues including open-drain signaling and output latencies.
|
||||
|
||||
The get/set calls have no error returns because "invalid GPIO" should have
|
||||
been reported earlier from gpio_direction_*(). However, note that not all
|
||||
@ -170,7 +179,8 @@ get to the head of a queue to transmit a command and get its response.
|
||||
This requires sleeping, which can't be done from inside IRQ handlers.
|
||||
|
||||
Platforms that support this type of GPIO distinguish them from other GPIOs
|
||||
by returning nonzero from this call:
|
||||
by returning nonzero from this call (which requires a valid GPIO number,
|
||||
either explicitly or implicitly requested):
|
||||
|
||||
int gpio_cansleep(unsigned gpio);
|
||||
|
||||
@ -209,8 +219,11 @@ before tasking is enabled, as part of early board setup.
|
||||
These calls serve two basic purposes. One is marking the signals which
|
||||
are actually in use as GPIOs, for better diagnostics; systems may have
|
||||
several hundred potential GPIOs, but often only a dozen are used on any
|
||||
given board. Another is to catch conflicts between drivers, reporting
|
||||
errors when drivers wrongly think they have exclusive use of that signal.
|
||||
given board. Another is to catch conflicts, identifying errors when
|
||||
(a) two or more drivers wrongly think they have exclusive use of that
|
||||
signal, or (b) something wrongly believes it's safe to remove drivers
|
||||
needed to manage a signal that's in active use. That is, requesting a
|
||||
GPIO can serve as a kind of lock.
|
||||
|
||||
These two calls are optional because not not all current Linux platforms
|
||||
offer such functionality in their GPIO support; a valid implementation
|
||||
@ -223,6 +236,9 @@ Note that requesting a GPIO does NOT cause it to be configured in any
|
||||
way; it just marks that GPIO as in use. Separate code must handle any
|
||||
pin setup (e.g. controlling which pin the GPIO uses, pullup/pulldown).
|
||||
|
||||
Also note that it's your responsibility to have stopped using a GPIO
|
||||
before you free it.
|
||||
|
||||
|
||||
GPIOs mapped to IRQs
|
||||
--------------------
|
||||
@ -238,7 +254,7 @@ map between them using calls like:
|
||||
|
||||
Those return either the corresponding number in the other namespace, or
|
||||
else a negative errno code if the mapping can't be done. (For example,
|
||||
some GPIOs can't used as IRQs.) It is an unchecked error to use a GPIO
|
||||
some GPIOs can't be used as IRQs.) It is an unchecked error to use a GPIO
|
||||
number that wasn't set up as an input using gpio_direction_input(), or
|
||||
to use an IRQ number that didn't originally come from gpio_to_irq().
|
||||
|
||||
@ -299,17 +315,110 @@ Related to multiplexing is configuration and enabling of the pullups or
|
||||
pulldowns integrated on some platforms. Not all platforms support them,
|
||||
or support them in the same way; and any given board might use external
|
||||
pullups (or pulldowns) so that the on-chip ones should not be used.
|
||||
(When a circuit needs 5 kOhm, on-chip 100 kOhm resistors won't do.)
|
||||
|
||||
There are other system-specific mechanisms that are not specified here,
|
||||
like the aforementioned options for input de-glitching and wire-OR output.
|
||||
Hardware may support reading or writing GPIOs in gangs, but that's usually
|
||||
configuration dependent: for GPIOs sharing the same bank. (GPIOs are
|
||||
commonly grouped in banks of 16 or 32, with a given SOC having several such
|
||||
banks.) Some systems can trigger IRQs from output GPIOs. Code relying on
|
||||
such mechanisms will necessarily be nonportable.
|
||||
banks.) Some systems can trigger IRQs from output GPIOs, or read values
|
||||
from pins not managed as GPIOs. Code relying on such mechanisms will
|
||||
necessarily be nonportable.
|
||||
|
||||
Dynamic definition of GPIOs is not currently supported; for example, as
|
||||
Dynamic definition of GPIOs is not currently standard; for example, as
|
||||
a side effect of configuring an add-on board with some GPIO expanders.
|
||||
|
||||
These calls are purely for kernel space, but a userspace API could be built
|
||||
on top of it.
|
||||
on top of them.
|
||||
|
||||
|
||||
GPIO implementor's framework (OPTIONAL)
|
||||
=======================================
|
||||
As noted earlier, there is an optional implementation framework making it
|
||||
easier for platforms to support different kinds of GPIO controller using
|
||||
the same programming interface.
|
||||
|
||||
As a debugging aid, if debugfs is available a /sys/kernel/debug/gpio file
|
||||
will be found there. That will list all the controllers registered through
|
||||
this framework, and the state of the GPIOs currently in use.
|
||||
|
||||
|
||||
Controller Drivers: gpio_chip
|
||||
-----------------------------
|
||||
In this framework each GPIO controller is packaged as a "struct gpio_chip"
|
||||
with information common to each controller of that type:
|
||||
|
||||
- methods to establish GPIO direction
|
||||
- methods used to access GPIO values
|
||||
- flag saying whether calls to its methods may sleep
|
||||
- optional debugfs dump method (showing extra state like pullup config)
|
||||
- label for diagnostics
|
||||
|
||||
There is also per-instance data, which may come from device.platform_data:
|
||||
the number of its first GPIO, and how many GPIOs it exposes.
|
||||
|
||||
The code implementing a gpio_chip should support multiple instances of the
|
||||
controller, possibly using the driver model. That code will configure each
|
||||
gpio_chip and issue gpiochip_add(). Removing a GPIO controller should be
|
||||
rare; use gpiochip_remove() when it is unavoidable.
|
||||
|
||||
Most often a gpio_chip is part of an instance-specific structure with state
|
||||
not exposed by the GPIO interfaces, such as addressing, power management,
|
||||
and more. Chips such as codecs will have complex non-GPIO state,
|
||||
|
||||
Any debugfs dump method should normally ignore signals which haven't been
|
||||
requested as GPIOs. They can use gpiochip_is_requested(), which returns
|
||||
either NULL or the label associated with that GPIO when it was requested.
|
||||
|
||||
|
||||
Platform Support
|
||||
----------------
|
||||
To support this framework, a platform's Kconfig will "select HAVE_GPIO_LIB"
|
||||
and arrange that its <asm/gpio.h> includes <asm-generic/gpio.h> and defines
|
||||
three functions: gpio_get_value(), gpio_set_value(), and gpio_cansleep().
|
||||
They may also want to provide a custom value for ARCH_NR_GPIOS.
|
||||
|
||||
Trivial implementations of those functions can directly use framework
|
||||
code, which always dispatches through the gpio_chip:
|
||||
|
||||
#define gpio_get_value __gpio_get_value
|
||||
#define gpio_set_value __gpio_set_value
|
||||
#define gpio_cansleep __gpio_cansleep
|
||||
|
||||
Fancier implementations could instead define those as inline functions with
|
||||
logic optimizing access to specific SOC-based GPIOs. For example, if the
|
||||
referenced GPIO is the constant "12", getting or setting its value could
|
||||
cost as little as two or three instructions, never sleeping. When such an
|
||||
optimization is not possible those calls must delegate to the framework
|
||||
code, costing at least a few dozen instructions. For bitbanged I/O, such
|
||||
instruction savings can be significant.
|
||||
|
||||
For SOCs, platform-specific code defines and registers gpio_chip instances
|
||||
for each bank of on-chip GPIOs. Those GPIOs should be numbered/labeled to
|
||||
match chip vendor documentation, and directly match board schematics. They
|
||||
may well start at zero and go up to a platform-specific limit. Such GPIOs
|
||||
are normally integrated into platform initialization to make them always be
|
||||
available, from arch_initcall() or earlier; they can often serve as IRQs.
|
||||
|
||||
|
||||
Board Support
|
||||
-------------
|
||||
For external GPIO controllers -- such as I2C or SPI expanders, ASICs, multi
|
||||
function devices, FPGAs or CPLDs -- most often board-specific code handles
|
||||
registering controller devices and ensures that their drivers know what GPIO
|
||||
numbers to use with gpiochip_add(). Their numbers often start right after
|
||||
platform-specific GPIOs.
|
||||
|
||||
For example, board setup code could create structures identifying the range
|
||||
of GPIOs that chip will expose, and passes them to each GPIO expander chip
|
||||
using platform_data. Then the chip driver's probe() routine could pass that
|
||||
data to gpiochip_add().
|
||||
|
||||
Initialization order can be important. For example, when a device relies on
|
||||
an I2C-based GPIO, its probe() routine should only be called after that GPIO
|
||||
becomes available. That may mean the device should not be registered until
|
||||
calls for that GPIO can work. One way to address such dependencies is for
|
||||
such gpio_chip controllers to provide setup() and teardown() callbacks to
|
||||
board specific code; those board specific callbacks would register devices
|
||||
once all the necessary resources are available.
|
||||
|
@ -1,6 +1,9 @@
|
||||
Kernel driver pca9539
|
||||
=====================
|
||||
|
||||
NOTE: this driver is deprecated and will be dropped soon, use
|
||||
drivers/gpio/pca9539.c instead.
|
||||
|
||||
Supported chips:
|
||||
* Philips PCA9539
|
||||
Prefix: 'pca9539'
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <fnmatch.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
@ -65,7 +66,7 @@ int scan_tree(char *path, char *file, off_t offset, size_t length, int touch)
|
||||
{
|
||||
struct dirent **namelist;
|
||||
char *name, *path2;
|
||||
int i, n, r, rc, result = 0;
|
||||
int i, n, r, rc = 0, result = 0;
|
||||
struct stat buf;
|
||||
|
||||
n = scandir(path, &namelist, 0, alphasort);
|
||||
@ -113,7 +114,7 @@ int scan_tree(char *path, char *file, off_t offset, size_t length, int touch)
|
||||
free(namelist[i]);
|
||||
}
|
||||
free(namelist);
|
||||
return rc;
|
||||
return result;
|
||||
}
|
||||
|
||||
char buf[1024];
|
||||
@ -149,7 +150,7 @@ int scan_rom(char *path, char *file)
|
||||
{
|
||||
struct dirent **namelist;
|
||||
char *name, *path2;
|
||||
int i, n, r, rc, result = 0;
|
||||
int i, n, r, rc = 0, result = 0;
|
||||
struct stat buf;
|
||||
|
||||
n = scandir(path, &namelist, 0, alphasort);
|
||||
@ -180,7 +181,7 @@ int scan_rom(char *path, char *file)
|
||||
* important thing is that no MCA happened.
|
||||
*/
|
||||
if (rc > 0)
|
||||
fprintf(stderr, "PASS: %s read %ld bytes\n", path2, rc);
|
||||
fprintf(stderr, "PASS: %s read %d bytes\n", path2, rc);
|
||||
else {
|
||||
fprintf(stderr, "PASS: %s not readable\n", path2);
|
||||
return rc;
|
||||
@ -201,10 +202,10 @@ int scan_rom(char *path, char *file)
|
||||
free(namelist[i]);
|
||||
}
|
||||
free(namelist);
|
||||
return rc;
|
||||
return result;
|
||||
}
|
||||
|
||||
int main()
|
||||
int main(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -256,4 +257,6 @@ int main()
|
||||
scan_tree("/proc/bus/pci", "??.?", 0xA0000, 0x20000, 0);
|
||||
scan_tree("/proc/bus/pci", "??.?", 0xC0000, 0x40000, 1);
|
||||
scan_tree("/proc/bus/pci", "??.?", 0, 1024*1024, 0);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@ -780,6 +780,9 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||
loop use the MONITOR/MWAIT idle loop anyways. Performance should be the same
|
||||
as idle=poll.
|
||||
|
||||
ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
|
||||
Claim all unknown PCI IDE storage controllers.
|
||||
|
||||
ignore_loglevel [KNL]
|
||||
Ignore loglevel setting - this will print /all/
|
||||
kernel messages to the console. Useful for debugging.
|
||||
|
@ -33,8 +33,8 @@ This file details changes in 2.6 which affect PCMCIA card driver authors:
|
||||
and can be used (e.g. for SET_NETDEV_DEV) by using
|
||||
handle_to_dev(client_handle_t * handle).
|
||||
|
||||
* Convert internal I/O port addresses to unsigned long (as of 2.6.11)
|
||||
ioaddr_t should be replaced by kio_addr_t in PCMCIA card drivers.
|
||||
* Convert internal I/O port addresses to unsigned int (as of 2.6.11)
|
||||
ioaddr_t should be replaced by unsigned int in PCMCIA card drivers.
|
||||
|
||||
* irq_mask and irq_list parameters (as of 2.6.11)
|
||||
The irq_mask and irq_list parameters should no longer be used in
|
||||
|
59
Documentation/pm_qos_interface.txt
Normal file
59
Documentation/pm_qos_interface.txt
Normal file
@ -0,0 +1,59 @@
|
||||
PM quality of Service interface.
|
||||
|
||||
This interface provides a kernel and user mode interface for registering
|
||||
performance expectations by drivers, subsystems and user space applications on
|
||||
one of the parameters.
|
||||
|
||||
Currently we have {cpu_dma_latency, network_latency, network_throughput} as the
|
||||
initial set of pm_qos parameters.
|
||||
|
||||
The infrastructure exposes multiple misc device nodes one per implemented
|
||||
parameter. The set of parameters implement is defined by pm_qos_power_init()
|
||||
and pm_qos_params.h. This is done because having the available parameters
|
||||
being runtime configurable or changeable from a driver was seen as too easy to
|
||||
abuse.
|
||||
|
||||
For each parameter a list of performance requirements is maintained along with
|
||||
an aggregated target value. The aggregated target value is updated with
|
||||
changes to the requirement list or elements of the list. Typically the
|
||||
aggregated target value is simply the max or min of the requirement values held
|
||||
in the parameter list elements.
|
||||
|
||||
From kernel mode the use of this interface is simple:
|
||||
pm_qos_add_requirement(param_id, name, target_value):
|
||||
Will insert a named element in the list for that identified PM_QOS parameter
|
||||
with the target value. Upon change to this list the new target is recomputed
|
||||
and any registered notifiers are called only if the target value is now
|
||||
different.
|
||||
|
||||
pm_qos_update_requirement(param_id, name, new_target_value):
|
||||
Will search the list identified by the param_id for the named list element and
|
||||
then update its target value, calling the notification tree if the aggregated
|
||||
target is changed. with that name is already registered.
|
||||
|
||||
pm_qos_remove_requirement(param_id, name):
|
||||
Will search the identified list for the named element and remove it, after
|
||||
removal it will update the aggregate target and call the notification tree if
|
||||
the target was changed as a result of removing the named requirement.
|
||||
|
||||
|
||||
From user mode:
|
||||
Only processes can register a pm_qos requirement. To provide for automatic
|
||||
cleanup for process the interface requires the process to register its
|
||||
parameter requirements in the following way:
|
||||
|
||||
To register the default pm_qos target for the specific parameter, the process
|
||||
must open one of /dev/[cpu_dma_latency, network_latency, network_throughput]
|
||||
|
||||
As long as the device node is held open that process has a registered
|
||||
requirement on the parameter. The name of the requirement is "process_<PID>"
|
||||
derived from the current->pid from within the open system call.
|
||||
|
||||
To change the requested target value the process needs to write a s32 value to
|
||||
the open device node. This translates to a pm_qos_update_requirement call.
|
||||
|
||||
To remove the user mode request for a target value simply close the device
|
||||
node.
|
||||
|
||||
|
||||
|
@ -22,6 +22,7 @@ Currently, these files are in /proc/sys/vm:
|
||||
- dirty_background_ratio
|
||||
- dirty_expire_centisecs
|
||||
- dirty_writeback_centisecs
|
||||
- highmem_is_dirtyable (only if CONFIG_HIGHMEM set)
|
||||
- max_map_count
|
||||
- min_free_kbytes
|
||||
- laptop_mode
|
||||
@ -40,9 +41,9 @@ Currently, these files are in /proc/sys/vm:
|
||||
==============================================================
|
||||
|
||||
dirty_ratio, dirty_background_ratio, dirty_expire_centisecs,
|
||||
dirty_writeback_centisecs, vfs_cache_pressure, laptop_mode,
|
||||
block_dump, swap_token_timeout, drop-caches,
|
||||
hugepages_treat_as_movable:
|
||||
dirty_writeback_centisecs, highmem_is_dirtyable,
|
||||
vfs_cache_pressure, laptop_mode, block_dump, swap_token_timeout,
|
||||
drop-caches, hugepages_treat_as_movable:
|
||||
|
||||
See Documentation/filesystems/proc.txt
|
||||
|
||||
|
19
MAINTAINERS
19
MAINTAINERS
@ -2249,6 +2249,15 @@ L: kvm-devel@lists.sourceforge.net
|
||||
W: kvm.sourceforge.net
|
||||
S: Supported
|
||||
|
||||
KERNEL VIRTUAL MACHINE For Itanium(KVM/IA64)
|
||||
P: Anthony Xu
|
||||
M: anthony.xu@intel.com
|
||||
P: Xiantao Zhang
|
||||
M: xiantao.zhang@intel.com
|
||||
L: kvm-ia64-devel@lists.sourceforge.net
|
||||
W: kvm.sourceforge.net
|
||||
S: Supported
|
||||
|
||||
KEXEC
|
||||
P: Eric Biederman
|
||||
M: ebiederm@xmission.com
|
||||
@ -2681,6 +2690,16 @@ M: James.Bottomley@HansenPartnership.com
|
||||
L: linux-scsi@vger.kernel.org
|
||||
S: Maintained
|
||||
|
||||
NETEFFECT IWARP RNIC DRIVER (IW_NES)
|
||||
P: Faisal Latif
|
||||
M: flatif@neteffect.com
|
||||
P: Glenn Streiff
|
||||
M: gstreiff@neteffect.com
|
||||
L: general@lists.openfabrics.org
|
||||
W: http://www.neteffect.com
|
||||
S: Supported
|
||||
F: drivers/infiniband/hw/nes/
|
||||
|
||||
NETEM NETWORK EMULATOR
|
||||
P: Stephen Hemminger
|
||||
M: shemminger@linux-foundation.org
|
||||
|
@ -165,7 +165,7 @@ dma_alloc_coherent(struct device *dev, size_t size,
|
||||
ret = (void *)__get_free_pages(gfp, get_order(size));
|
||||
if (ret) {
|
||||
memset(ret, 0, size);
|
||||
*dma_handle = virt_to_bus(ret);
|
||||
*dma_handle = virt_to_phys(ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -184,7 +184,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sgl, int nents,
|
||||
|
||||
BUG_ON(!sg_page(sg));
|
||||
va = sg_virt(sg);
|
||||
sg_dma_address(sg) = (dma_addr_t)virt_to_bus(va);
|
||||
sg_dma_address(sg) = (dma_addr_t)virt_to_phys(va);
|
||||
sg_dma_len(sg) = sg->length;
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <linux/bootmem.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <linux/log2.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/hwrpb.h>
|
||||
@ -470,22 +471,29 @@ EXPORT_SYMBOL(pci_free_consistent);
|
||||
#define SG_ENT_PHYS_ADDRESS(SG) __pa(SG_ENT_VIRT_ADDRESS(SG))
|
||||
|
||||
static void
|
||||
sg_classify(struct scatterlist *sg, struct scatterlist *end, int virt_ok)
|
||||
sg_classify(struct device *dev, struct scatterlist *sg, struct scatterlist *end,
|
||||
int virt_ok)
|
||||
{
|
||||
unsigned long next_paddr;
|
||||
struct scatterlist *leader;
|
||||
long leader_flag, leader_length;
|
||||
unsigned int max_seg_size;
|
||||
|
||||
leader = sg;
|
||||
leader_flag = 0;
|
||||
leader_length = leader->length;
|
||||
next_paddr = SG_ENT_PHYS_ADDRESS(leader) + leader_length;
|
||||
|
||||
/* we will not marge sg without device. */
|
||||
max_seg_size = dev ? dma_get_max_seg_size(dev) : 0;
|
||||
for (++sg; sg < end; ++sg) {
|
||||
unsigned long addr, len;
|
||||
addr = SG_ENT_PHYS_ADDRESS(sg);
|
||||
len = sg->length;
|
||||
|
||||
if (leader_length + len > max_seg_size)
|
||||
goto new_segment;
|
||||
|
||||
if (next_paddr == addr) {
|
||||
sg->dma_address = -1;
|
||||
leader_length += len;
|
||||
@ -494,6 +502,7 @@ sg_classify(struct scatterlist *sg, struct scatterlist *end, int virt_ok)
|
||||
leader_flag = 1;
|
||||
leader_length += len;
|
||||
} else {
|
||||
new_segment:
|
||||
leader->dma_address = leader_flag;
|
||||
leader->dma_length = leader_length;
|
||||
leader = sg;
|
||||
@ -512,7 +521,7 @@ sg_classify(struct scatterlist *sg, struct scatterlist *end, int virt_ok)
|
||||
in the blanks. */
|
||||
|
||||
static int
|
||||
sg_fill(struct scatterlist *leader, struct scatterlist *end,
|
||||
sg_fill(struct device *dev, struct scatterlist *leader, struct scatterlist *end,
|
||||
struct scatterlist *out, struct pci_iommu_arena *arena,
|
||||
dma_addr_t max_dma, int dac_allowed)
|
||||
{
|
||||
@ -562,8 +571,8 @@ sg_fill(struct scatterlist *leader, struct scatterlist *end,
|
||||
|
||||
/* Otherwise, break up the remaining virtually contiguous
|
||||
hunks into individual direct maps and retry. */
|
||||
sg_classify(leader, end, 0);
|
||||
return sg_fill(leader, end, out, arena, max_dma, dac_allowed);
|
||||
sg_classify(dev, leader, end, 0);
|
||||
return sg_fill(dev, leader, end, out, arena, max_dma, dac_allowed);
|
||||
}
|
||||
|
||||
out->dma_address = arena->dma_base + dma_ofs*PAGE_SIZE + paddr;
|
||||
@ -619,12 +628,15 @@ pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
|
||||
struct pci_iommu_arena *arena;
|
||||
dma_addr_t max_dma;
|
||||
int dac_allowed;
|
||||
struct device *dev;
|
||||
|
||||
if (direction == PCI_DMA_NONE)
|
||||
BUG();
|
||||
|
||||
dac_allowed = pdev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0;
|
||||
|
||||
dev = pdev ? &pdev->dev : NULL;
|
||||
|
||||
/* Fast path single entry scatterlists. */
|
||||
if (nents == 1) {
|
||||
sg->dma_length = sg->length;
|
||||
@ -638,7 +650,7 @@ pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
|
||||
end = sg + nents;
|
||||
|
||||
/* First, prepare information about the entries. */
|
||||
sg_classify(sg, end, alpha_mv.mv_pci_tbi != 0);
|
||||
sg_classify(dev, sg, end, alpha_mv.mv_pci_tbi != 0);
|
||||
|
||||
/* Second, figure out where we're going to map things. */
|
||||
if (alpha_mv.mv_pci_tbi) {
|
||||
@ -658,7 +670,7 @@ pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
|
||||
for (out = sg; sg < end; ++sg) {
|
||||
if ((int) sg->dma_address < 0)
|
||||
continue;
|
||||
if (sg_fill(sg, end, out, arena, max_dma, dac_allowed) < 0)
|
||||
if (sg_fill(dev, sg, end, out, arena, max_dma, dac_allowed) < 0)
|
||||
goto error;
|
||||
out++;
|
||||
}
|
||||
|
@ -58,7 +58,6 @@ static struct notifier_block alpha_panic_block = {
|
||||
#include <asm/system.h>
|
||||
#include <asm/hwrpb.h>
|
||||
#include <asm/dma.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/mmu_context.h>
|
||||
#include <asm/console.h>
|
||||
|
||||
|
@ -495,7 +495,7 @@ sys_call_table:
|
||||
.quad sys_epoll_pwait
|
||||
.quad sys_utimensat /* 475 */
|
||||
.quad sys_signalfd
|
||||
.quad sys_timerfd
|
||||
.quad sys_ni_syscall
|
||||
.quad sys_eventfd
|
||||
|
||||
.size sys_call_table, . - sys_call_table
|
||||
|
@ -385,6 +385,7 @@ config ARCH_PXA
|
||||
depends on MMU
|
||||
select ARCH_MTD_XIP
|
||||
select GENERIC_GPIO
|
||||
select HAVE_GPIO_LIB
|
||||
select GENERIC_TIME
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select TICK_ONESHOT
|
||||
@ -1122,6 +1123,8 @@ source "drivers/i2c/Kconfig"
|
||||
|
||||
source "drivers/spi/Kconfig"
|
||||
|
||||
source "drivers/gpio/Kconfig"
|
||||
|
||||
source "drivers/w1/Kconfig"
|
||||
|
||||
source "drivers/power/Kconfig"
|
||||
|
@ -359,7 +359,7 @@
|
||||
CALL(sys_kexec_load)
|
||||
CALL(sys_utimensat)
|
||||
CALL(sys_signalfd)
|
||||
/* 350 */ CALL(sys_timerfd)
|
||||
/* 350 */ CALL(sys_ni_syscall)
|
||||
CALL(sys_eventfd)
|
||||
CALL(sys_fallocate)
|
||||
#ifndef syscalls_counted
|
||||
|
@ -150,7 +150,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
|
||||
secondary_data.pgdir = 0;
|
||||
|
||||
*pmd_offset(pgd, PHYS_OFFSET) = __pmd(0);
|
||||
pgd_free(pgd);
|
||||
pgd_free(&init_mm, pgd);
|
||||
|
||||
if (ret) {
|
||||
printk(KERN_CRIT "CPU%u: processor failed to boot\n", cpu);
|
||||
|
@ -3,7 +3,8 @@
|
||||
#
|
||||
|
||||
# Common support (must be linked before board specific support)
|
||||
obj-y += clock.o devices.o generic.o irq.o dma.o time.o
|
||||
obj-y += clock.o devices.o generic.o irq.o dma.o \
|
||||
time.o gpio.o
|
||||
obj-$(CONFIG_PXA25x) += pxa25x.o
|
||||
obj-$(CONFIG_PXA27x) += pxa27x.o
|
||||
obj-$(CONFIG_PXA3xx) += pxa3xx.o mfp.o smemc.o
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include <asm/mach/map.h>
|
||||
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
|
||||
#include "generic.h"
|
||||
|
||||
@ -66,97 +65,6 @@ unsigned int get_memclk_frequency_10khz(void)
|
||||
}
|
||||
EXPORT_SYMBOL(get_memclk_frequency_10khz);
|
||||
|
||||
/*
|
||||
* Handy function to set GPIO alternate functions
|
||||
*/
|
||||
int pxa_last_gpio;
|
||||
|
||||
int pxa_gpio_mode(int gpio_mode)
|
||||
{
|
||||
unsigned long flags;
|
||||
int gpio = gpio_mode & GPIO_MD_MASK_NR;
|
||||
int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8;
|
||||
int gafr;
|
||||
|
||||
if (gpio > pxa_last_gpio)
|
||||
return -EINVAL;
|
||||
|
||||
local_irq_save(flags);
|
||||
if (gpio_mode & GPIO_DFLT_LOW)
|
||||
GPCR(gpio) = GPIO_bit(gpio);
|
||||
else if (gpio_mode & GPIO_DFLT_HIGH)
|
||||
GPSR(gpio) = GPIO_bit(gpio);
|
||||
if (gpio_mode & GPIO_MD_MASK_DIR)
|
||||
GPDR(gpio) |= GPIO_bit(gpio);
|
||||
else
|
||||
GPDR(gpio) &= ~GPIO_bit(gpio);
|
||||
gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2));
|
||||
GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2));
|
||||
local_irq_restore(flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(pxa_gpio_mode);
|
||||
|
||||
int gpio_direction_input(unsigned gpio)
|
||||
{
|
||||
unsigned long flags;
|
||||
u32 mask;
|
||||
|
||||
if (gpio > pxa_last_gpio)
|
||||
return -EINVAL;
|
||||
|
||||
mask = GPIO_bit(gpio);
|
||||
local_irq_save(flags);
|
||||
GPDR(gpio) &= ~mask;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(gpio_direction_input);
|
||||
|
||||
int gpio_direction_output(unsigned gpio, int value)
|
||||
{
|
||||
unsigned long flags;
|
||||
u32 mask;
|
||||
|
||||
if (gpio > pxa_last_gpio)
|
||||
return -EINVAL;
|
||||
|
||||
mask = GPIO_bit(gpio);
|
||||
local_irq_save(flags);
|
||||
if (value)
|
||||
GPSR(gpio) = mask;
|
||||
else
|
||||
GPCR(gpio) = mask;
|
||||
GPDR(gpio) |= mask;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(gpio_direction_output);
|
||||
|
||||
/*
|
||||
* Return GPIO level
|
||||
*/
|
||||
int pxa_gpio_get_value(unsigned gpio)
|
||||
{
|
||||
return __gpio_get_value(gpio);
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(pxa_gpio_get_value);
|
||||
|
||||
/*
|
||||
* Set output GPIO level
|
||||
*/
|
||||
void pxa_gpio_set_value(unsigned gpio, int value)
|
||||
{
|
||||
__gpio_set_value(gpio, value);
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(pxa_gpio_set_value);
|
||||
|
||||
/*
|
||||
* Routine to safely enable or disable a clock in the CKEN
|
||||
*/
|
||||
@ -172,7 +80,6 @@ void __pxa_set_cken(int clock, int enable)
|
||||
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(__pxa_set_cken);
|
||||
|
||||
/*
|
||||
|
@ -16,6 +16,7 @@ extern void __init pxa_init_irq_low(void);
|
||||
extern void __init pxa_init_irq_high(void);
|
||||
extern void __init pxa_init_irq_gpio(int gpio_nr);
|
||||
extern void __init pxa_init_irq_set_wake(int (*set_wake)(unsigned int, unsigned int));
|
||||
extern void __init pxa_init_gpio(int gpio_nr);
|
||||
extern void __init pxa25x_init_irq(void);
|
||||
extern void __init pxa27x_init_irq(void);
|
||||
extern void __init pxa3xx_init_irq(void);
|
||||
|
197
arch/arm/mach-pxa/gpio.c
Normal file
197
arch/arm/mach-pxa/gpio.c
Normal file
@ -0,0 +1,197 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-pxa/gpio.c
|
||||
*
|
||||
* Generic PXA GPIO handling
|
||||
*
|
||||
* Author: Nicolas Pitre
|
||||
* Created: Jun 15, 2001
|
||||
* Copyright: MontaVista Software Inc.
|
||||
*
|
||||
* 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 <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
|
||||
#include "generic.h"
|
||||
|
||||
|
||||
struct pxa_gpio_chip {
|
||||
struct gpio_chip chip;
|
||||
void __iomem *regbase;
|
||||
};
|
||||
|
||||
int pxa_last_gpio;
|
||||
|
||||
/*
|
||||
* Configure pins for GPIO or other functions
|
||||
*/
|
||||
int pxa_gpio_mode(int gpio_mode)
|
||||
{
|
||||
unsigned long flags;
|
||||
int gpio = gpio_mode & GPIO_MD_MASK_NR;
|
||||
int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8;
|
||||
int gafr;
|
||||
|
||||
if (gpio > pxa_last_gpio)
|
||||
return -EINVAL;
|
||||
|
||||
local_irq_save(flags);
|
||||
if (gpio_mode & GPIO_DFLT_LOW)
|
||||
GPCR(gpio) = GPIO_bit(gpio);
|
||||
else if (gpio_mode & GPIO_DFLT_HIGH)
|
||||
GPSR(gpio) = GPIO_bit(gpio);
|
||||
if (gpio_mode & GPIO_MD_MASK_DIR)
|
||||
GPDR(gpio) |= GPIO_bit(gpio);
|
||||
else
|
||||
GPDR(gpio) &= ~GPIO_bit(gpio);
|
||||
gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2));
|
||||
GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2));
|
||||
local_irq_restore(flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(pxa_gpio_mode);
|
||||
|
||||
static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
|
||||
{
|
||||
unsigned long flags;
|
||||
u32 mask = 1 << offset;
|
||||
u32 value;
|
||||
struct pxa_gpio_chip *pxa;
|
||||
void __iomem *gpdr;
|
||||
|
||||
pxa = container_of(chip, struct pxa_gpio_chip, chip);
|
||||
gpdr = pxa->regbase + GPDR_OFFSET;
|
||||
local_irq_save(flags);
|
||||
value = __raw_readl(gpdr);
|
||||
value &= ~mask;
|
||||
__raw_writel(value, gpdr);
|
||||
local_irq_restore(flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pxa_gpio_direction_output(struct gpio_chip *chip,
|
||||
unsigned offset, int value)
|
||||
{
|
||||
unsigned long flags;
|
||||
u32 mask = 1 << offset;
|
||||
u32 tmp;
|
||||
struct pxa_gpio_chip *pxa;
|
||||
void __iomem *gpdr;
|
||||
|
||||
pxa = container_of(chip, struct pxa_gpio_chip, chip);
|
||||
__raw_writel(mask,
|
||||
pxa->regbase + (value ? GPSR_OFFSET : GPCR_OFFSET));
|
||||
gpdr = pxa->regbase + GPDR_OFFSET;
|
||||
local_irq_save(flags);
|
||||
tmp = __raw_readl(gpdr);
|
||||
tmp |= mask;
|
||||
__raw_writel(tmp, gpdr);
|
||||
local_irq_restore(flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return GPIO level
|
||||
*/
|
||||
static int pxa_gpio_get(struct gpio_chip *chip, unsigned offset)
|
||||
{
|
||||
u32 mask = 1 << offset;
|
||||
struct pxa_gpio_chip *pxa;
|
||||
|
||||
pxa = container_of(chip, struct pxa_gpio_chip, chip);
|
||||
return __raw_readl(pxa->regbase + GPLR_OFFSET) & mask;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set output GPIO level
|
||||
*/
|
||||
static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
|
||||
{
|
||||
u32 mask = 1 << offset;
|
||||
struct pxa_gpio_chip *pxa;
|
||||
|
||||
pxa = container_of(chip, struct pxa_gpio_chip, chip);
|
||||
|
||||
if (value)
|
||||
__raw_writel(mask, pxa->regbase + GPSR_OFFSET);
|
||||
else
|
||||
__raw_writel(mask, pxa->regbase + GPCR_OFFSET);
|
||||
}
|
||||
|
||||
static struct pxa_gpio_chip pxa_gpio_chip[] = {
|
||||
[0] = {
|
||||
.regbase = GPIO0_BASE,
|
||||
.chip = {
|
||||
.label = "gpio-0",
|
||||
.direction_input = pxa_gpio_direction_input,
|
||||
.direction_output = pxa_gpio_direction_output,
|
||||
.get = pxa_gpio_get,
|
||||
.set = pxa_gpio_set,
|
||||
.base = 0,
|
||||
.ngpio = 32,
|
||||
},
|
||||
},
|
||||
[1] = {
|
||||
.regbase = GPIO1_BASE,
|
||||
.chip = {
|
||||
.label = "gpio-1",
|
||||
.direction_input = pxa_gpio_direction_input,
|
||||
.direction_output = pxa_gpio_direction_output,
|
||||
.get = pxa_gpio_get,
|
||||
.set = pxa_gpio_set,
|
||||
.base = 32,
|
||||
.ngpio = 32,
|
||||
},
|
||||
},
|
||||
[2] = {
|
||||
.regbase = GPIO2_BASE,
|
||||
.chip = {
|
||||
.label = "gpio-2",
|
||||
.direction_input = pxa_gpio_direction_input,
|
||||
.direction_output = pxa_gpio_direction_output,
|
||||
.get = pxa_gpio_get,
|
||||
.set = pxa_gpio_set,
|
||||
.base = 64,
|
||||
.ngpio = 32, /* 21 for PXA25x */
|
||||
},
|
||||
},
|
||||
#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
|
||||
[3] = {
|
||||
.regbase = GPIO3_BASE,
|
||||
.chip = {
|
||||
.label = "gpio-3",
|
||||
.direction_input = pxa_gpio_direction_input,
|
||||
.direction_output = pxa_gpio_direction_output,
|
||||
.get = pxa_gpio_get,
|
||||
.set = pxa_gpio_set,
|
||||
.base = 96,
|
||||
.ngpio = 32,
|
||||
},
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
void __init pxa_init_gpio(int gpio_nr)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* add a GPIO chip for each register bank.
|
||||
* the last PXA25x register only contains 21 GPIOs
|
||||
*/
|
||||
for (i = 0; i < gpio_nr; i += 32) {
|
||||
if (i+32 > gpio_nr)
|
||||
pxa_gpio_chip[i/32].chip.ngpio = gpio_nr - i;
|
||||
gpiochip_add(&pxa_gpio_chip[i/32].chip);
|
||||
}
|
||||
}
|
@ -311,6 +311,8 @@ void __init pxa_init_irq_gpio(int gpio_nr)
|
||||
/* Install handler for GPIO>=2 edge detect interrupts */
|
||||
set_irq_chip(IRQ_GPIO_2_x, &pxa_internal_chip_low);
|
||||
set_irq_chained_handler(IRQ_GPIO_2_x, pxa_gpio_demux_handler);
|
||||
|
||||
pxa_init_gpio(gpio_nr);
|
||||
}
|
||||
|
||||
void __init pxa_init_irq_set_wake(int (*set_wake)(unsigned int, unsigned int))
|
||||
|
@ -162,7 +162,7 @@ static void unmap_area_sections(unsigned long virt, unsigned long size)
|
||||
* Free the page table, if there was one.
|
||||
*/
|
||||
if ((pmd_val(pmd) & PMD_TYPE_MASK) == PMD_TYPE_TABLE)
|
||||
pte_free_kernel(pmd_page_vaddr(pmd));
|
||||
pte_free_kernel(&init_mm, pmd_page_vaddr(pmd));
|
||||
}
|
||||
|
||||
addr += PGDIR_SIZE;
|
||||
|
@ -65,14 +65,14 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
|
||||
return new_pgd;
|
||||
|
||||
no_pte:
|
||||
pmd_free(new_pmd);
|
||||
pmd_free(mm, new_pmd);
|
||||
no_pmd:
|
||||
free_pages((unsigned long)new_pgd, 2);
|
||||
no_pgd:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void free_pgd_slow(pgd_t *pgd)
|
||||
void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd)
|
||||
{
|
||||
pmd_t *pmd;
|
||||
struct page *pte;
|
||||
@ -94,8 +94,8 @@ void free_pgd_slow(pgd_t *pgd)
|
||||
pmd_clear(pmd);
|
||||
dec_zone_page_state(virt_to_page((unsigned long *)pgd), NR_PAGETABLE);
|
||||
pte_lock_deinit(pte);
|
||||
pte_free(pte);
|
||||
pmd_free(pmd);
|
||||
pte_free(mm, pte);
|
||||
pmd_free(mm, pmd);
|
||||
free:
|
||||
free_pages((unsigned long) pgd, 2);
|
||||
}
|
||||
|
@ -82,6 +82,7 @@ config PLATFORM_AT32AP
|
||||
select SUBARCH_AVR32B
|
||||
select MMU
|
||||
select PERFORMANCE_COUNTERS
|
||||
select HAVE_GPIO_LIB
|
||||
|
||||
#
|
||||
# CPU types
|
||||
|
@ -293,6 +293,6 @@ sys_call_table:
|
||||
.long sys_shmctl
|
||||
.long sys_utimensat
|
||||
.long sys_signalfd
|
||||
.long sys_timerfd /* 280 */
|
||||
.long sys_ni_syscall /* 280, was sys_timerfd */
|
||||
.long sys_eventfd
|
||||
.long sys_ni_syscall /* r8 is saturated at nr_syscalls */
|
||||
|
@ -24,11 +24,11 @@
|
||||
#define MAX_NR_PIO_DEVICES 8
|
||||
|
||||
struct pio_device {
|
||||
struct gpio_chip chip;
|
||||
void __iomem *regs;
|
||||
const struct platform_device *pdev;
|
||||
struct clk *clk;
|
||||
u32 pinmux_mask;
|
||||
u32 gpio_mask;
|
||||
char name[8];
|
||||
};
|
||||
|
||||
@ -64,7 +64,8 @@ void __init at32_select_periph(unsigned int pin, unsigned int periph,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (unlikely(test_and_set_bit(pin_index, &pio->pinmux_mask))) {
|
||||
if (unlikely(test_and_set_bit(pin_index, &pio->pinmux_mask)
|
||||
|| gpiochip_is_requested(&pio->chip, pin_index))) {
|
||||
printk("%s: pin %u is busy\n", pio->name, pin_index);
|
||||
goto fail;
|
||||
}
|
||||
@ -79,9 +80,6 @@ void __init at32_select_periph(unsigned int pin, unsigned int periph,
|
||||
if (!(flags & AT32_GPIOF_PULLUP))
|
||||
pio_writel(pio, PUDR, mask);
|
||||
|
||||
/* gpio_request NOT allowed */
|
||||
set_bit(pin_index, &pio->gpio_mask);
|
||||
|
||||
return;
|
||||
|
||||
fail:
|
||||
@ -130,9 +128,6 @@ void __init at32_select_gpio(unsigned int pin, unsigned long flags)
|
||||
|
||||
pio_writel(pio, PER, mask);
|
||||
|
||||
/* gpio_request now allowed */
|
||||
clear_bit(pin_index, &pio->gpio_mask);
|
||||
|
||||
return;
|
||||
|
||||
fail:
|
||||
@ -166,96 +161,50 @@ void __init at32_reserve_pin(unsigned int pin)
|
||||
|
||||
/* GPIO API */
|
||||
|
||||
int gpio_request(unsigned int gpio, const char *label)
|
||||
static int direction_input(struct gpio_chip *chip, unsigned offset)
|
||||
{
|
||||
struct pio_device *pio;
|
||||
unsigned int pin;
|
||||
struct pio_device *pio = container_of(chip, struct pio_device, chip);
|
||||
u32 mask = 1 << offset;
|
||||
|
||||
pio = gpio_to_pio(gpio);
|
||||
if (!pio)
|
||||
return -ENODEV;
|
||||
|
||||
pin = gpio & 0x1f;
|
||||
if (test_and_set_bit(pin, &pio->gpio_mask))
|
||||
return -EBUSY;
|
||||
if (!(pio_readl(pio, PSR) & mask))
|
||||
return -EINVAL;
|
||||
|
||||
pio_writel(pio, ODR, mask);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(gpio_request);
|
||||
|
||||
void gpio_free(unsigned int gpio)
|
||||
static int gpio_get(struct gpio_chip *chip, unsigned offset)
|
||||
{
|
||||
struct pio_device *pio;
|
||||
unsigned int pin;
|
||||
struct pio_device *pio = container_of(chip, struct pio_device, chip);
|
||||
|
||||
pio = gpio_to_pio(gpio);
|
||||
if (!pio) {
|
||||
printk(KERN_ERR
|
||||
"gpio: attempted to free invalid pin %u\n", gpio);
|
||||
return;
|
||||
}
|
||||
|
||||
pin = gpio & 0x1f;
|
||||
if (!test_and_clear_bit(pin, &pio->gpio_mask))
|
||||
printk(KERN_ERR "gpio: freeing free or non-gpio pin %s-%u\n",
|
||||
pio->name, pin);
|
||||
return (pio_readl(pio, PDSR) >> offset) & 1;
|
||||
}
|
||||
EXPORT_SYMBOL(gpio_free);
|
||||
|
||||
int gpio_direction_input(unsigned int gpio)
|
||||
static void gpio_set(struct gpio_chip *chip, unsigned offset, int value);
|
||||
|
||||
static int direction_output(struct gpio_chip *chip, unsigned offset, int value)
|
||||
{
|
||||
struct pio_device *pio;
|
||||
unsigned int pin;
|
||||
struct pio_device *pio = container_of(chip, struct pio_device, chip);
|
||||
u32 mask = 1 << offset;
|
||||
|
||||
pio = gpio_to_pio(gpio);
|
||||
if (!pio)
|
||||
return -ENODEV;
|
||||
|
||||
pin = gpio & 0x1f;
|
||||
pio_writel(pio, ODR, 1 << pin);
|
||||
if (!(pio_readl(pio, PSR) & mask))
|
||||
return -EINVAL;
|
||||
|
||||
gpio_set(chip, offset, value);
|
||||
pio_writel(pio, OER, mask);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(gpio_direction_input);
|
||||
|
||||
int gpio_direction_output(unsigned int gpio, int value)
|
||||
static void gpio_set(struct gpio_chip *chip, unsigned offset, int value)
|
||||
{
|
||||
struct pio_device *pio;
|
||||
unsigned int pin;
|
||||
struct pio_device *pio = container_of(chip, struct pio_device, chip);
|
||||
u32 mask = 1 << offset;
|
||||
|
||||
pio = gpio_to_pio(gpio);
|
||||
if (!pio)
|
||||
return -ENODEV;
|
||||
|
||||
gpio_set_value(gpio, value);
|
||||
|
||||
pin = gpio & 0x1f;
|
||||
pio_writel(pio, OER, 1 << pin);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(gpio_direction_output);
|
||||
|
||||
int gpio_get_value(unsigned int gpio)
|
||||
{
|
||||
struct pio_device *pio = &pio_dev[gpio >> 5];
|
||||
|
||||
return (pio_readl(pio, PDSR) >> (gpio & 0x1f)) & 1;
|
||||
}
|
||||
EXPORT_SYMBOL(gpio_get_value);
|
||||
|
||||
void gpio_set_value(unsigned int gpio, int value)
|
||||
{
|
||||
struct pio_device *pio = &pio_dev[gpio >> 5];
|
||||
u32 mask;
|
||||
|
||||
mask = 1 << (gpio & 0x1f);
|
||||
if (value)
|
||||
pio_writel(pio, SODR, mask);
|
||||
else
|
||||
pio_writel(pio, CODR, mask);
|
||||
}
|
||||
EXPORT_SYMBOL(gpio_set_value);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
@ -337,6 +286,63 @@ gpio_irq_setup(struct pio_device *pio, int irq, int gpio_irq)
|
||||
set_irq_chained_handler(irq, gpio_irq_handler);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
||||
#include <linux/seq_file.h>
|
||||
|
||||
/*
|
||||
* This shows more info than the generic gpio dump code:
|
||||
* pullups, deglitching, open drain drive.
|
||||
*/
|
||||
static void pio_bank_show(struct seq_file *s, struct gpio_chip *chip)
|
||||
{
|
||||
struct pio_device *pio = container_of(chip, struct pio_device, chip);
|
||||
u32 psr, osr, imr, pdsr, pusr, ifsr, mdsr;
|
||||
unsigned i;
|
||||
u32 mask;
|
||||
char bank;
|
||||
|
||||
psr = pio_readl(pio, PSR);
|
||||
osr = pio_readl(pio, OSR);
|
||||
imr = pio_readl(pio, IMR);
|
||||
pdsr = pio_readl(pio, PDSR);
|
||||
pusr = pio_readl(pio, PUSR);
|
||||
ifsr = pio_readl(pio, IFSR);
|
||||
mdsr = pio_readl(pio, MDSR);
|
||||
|
||||
bank = 'A' + pio->pdev->id;
|
||||
|
||||
for (i = 0, mask = 1; i < 32; i++, mask <<= 1) {
|
||||
const char *label;
|
||||
|
||||
label = gpiochip_is_requested(chip, i);
|
||||
if (!label)
|
||||
continue;
|
||||
|
||||
seq_printf(s, " gpio-%-3d P%c%-2d (%-12s) %s %s %s",
|
||||
chip->base + i, bank, i,
|
||||
label,
|
||||
(osr & mask) ? "out" : "in ",
|
||||
(mask & pdsr) ? "hi" : "lo",
|
||||
(mask & pusr) ? " " : "up");
|
||||
if (ifsr & mask)
|
||||
seq_printf(s, " deglitch");
|
||||
if ((osr & mdsr) & mask)
|
||||
seq_printf(s, " open-drain");
|
||||
if (imr & mask)
|
||||
seq_printf(s, " irq-%d edge-both",
|
||||
gpio_to_irq(chip->base + i));
|
||||
seq_printf(s, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
#define pio_bank_show NULL
|
||||
#endif
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
static int __init pio_probe(struct platform_device *pdev)
|
||||
@ -349,6 +355,18 @@ static int __init pio_probe(struct platform_device *pdev)
|
||||
pio = &pio_dev[pdev->id];
|
||||
BUG_ON(!pio->regs);
|
||||
|
||||
pio->chip.label = pio->name;
|
||||
pio->chip.base = pdev->id * 32;
|
||||
pio->chip.ngpio = 32;
|
||||
|
||||
pio->chip.direction_input = direction_input;
|
||||
pio->chip.get = gpio_get;
|
||||
pio->chip.direction_output = direction_output;
|
||||
pio->chip.set = gpio_set;
|
||||
pio->chip.dbg_show = pio_bank_show;
|
||||
|
||||
gpiochip_add(&pio->chip);
|
||||
|
||||
gpio_irq_setup(pio, irq, gpio_irq_base);
|
||||
|
||||
platform_set_drvdata(pdev, pio);
|
||||
@ -406,12 +424,6 @@ void __init at32_init_pio(struct platform_device *pdev)
|
||||
pio->pdev = pdev;
|
||||
pio->regs = ioremap(regs->start, regs->end - regs->start + 1);
|
||||
|
||||
/*
|
||||
* request_gpio() is only valid for pins that have been
|
||||
* explicitly configured as GPIO and not previously requested
|
||||
*/
|
||||
pio->gpio_mask = ~0UL;
|
||||
|
||||
/* start with irqs disabled and acked */
|
||||
pio_writel(pio, IDR, ~0UL);
|
||||
(void) pio_readl(pio, ISR);
|
||||
|
@ -19,7 +19,7 @@
|
||||
#define PIO_OSR 0x0018
|
||||
#define PIO_IFER 0x0020
|
||||
#define PIO_IFDR 0x0024
|
||||
#define PIO_ISFR 0x0028
|
||||
#define PIO_IFSR 0x0028
|
||||
#define PIO_SODR 0x0030
|
||||
#define PIO_CODR 0x0034
|
||||
#define PIO_ODSR 0x0038
|
||||
|
@ -1373,7 +1373,7 @@ ENTRY(_sys_call_table)
|
||||
.long _sys_epoll_pwait
|
||||
.long _sys_utimensat
|
||||
.long _sys_signalfd
|
||||
.long _sys_timerfd
|
||||
.long _sys_ni_syscall
|
||||
.long _sys_eventfd /* 350 */
|
||||
.long _sys_pread64
|
||||
.long _sys_pwrite64
|
||||
|
@ -150,6 +150,7 @@ config ETRAX_FLASH_BUSWIDTH
|
||||
Width in bytes of the Flash bus (1, 2 or 4). Is usually 2.
|
||||
|
||||
source arch/cris/arch-v10/Kconfig
|
||||
source arch/cris/arch-v32/Kconfig
|
||||
|
||||
endmenu
|
||||
|
||||
@ -157,8 +158,8 @@ source "net/Kconfig"
|
||||
|
||||
# bring in ETRAX built-in drivers
|
||||
menu "Drivers for built-in interfaces"
|
||||
# arch/cris/arch is a symlink to correct arch (arch-v10 or arch-v32)
|
||||
source arch/cris/arch/drivers/Kconfig
|
||||
source arch/cris/arch-v10/drivers/Kconfig
|
||||
source arch/cris/arch-v32/drivers/Kconfig
|
||||
|
||||
endmenu
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
if ETRAX_ARCH_V10
|
||||
|
||||
# ETRAX 100LX v1 has a MMU "feature" requiring a low mapping
|
||||
config CRIS_LOW_MAP
|
||||
bool
|
||||
@ -451,3 +453,5 @@ config ETRAX_POWERBUTTON_BIT
|
||||
default "25"
|
||||
help
|
||||
Configure where power button is connected.
|
||||
|
||||
endif
|
||||
|
@ -1,3 +1,5 @@
|
||||
if ETRAX_ARCH_V10
|
||||
|
||||
config ETRAX_ETHERNET
|
||||
bool "Ethernet support"
|
||||
depends on ETRAX_ARCH_V10
|
||||
@ -806,3 +808,5 @@ config ETRAX_DS1302_TRICKLE_CHARGE
|
||||
1 = 2kohm, 2 = 4kohm, 3 = 4kohm
|
||||
4 = 1 diode, 8 = 2 diodes
|
||||
Allowed values are (increasing current): 0, 11, 10, 9, 7, 6, 5
|
||||
|
||||
endif
|
||||
|
@ -1167,7 +1167,7 @@ sys_call_table:
|
||||
.long sys_epoll_pwait
|
||||
.long sys_utimensat /* 320 */
|
||||
.long sys_signalfd
|
||||
.long sys_timerfd
|
||||
.long sys_ni_syscall
|
||||
.long sys_eventfd
|
||||
.long sys_fallocate
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
if ETRAX_ARCH_V32
|
||||
|
||||
config ETRAX_DRAM_VIRTUAL_BASE
|
||||
hex
|
||||
depends on ETRAX_ARCH_V32
|
||||
@ -294,3 +296,5 @@ config ETRAX_DEF_GIO_PE_OUT
|
||||
help
|
||||
Configures the initial data for the general port E bits. Most
|
||||
products should use 00000 here.
|
||||
|
||||
endif
|
||||
|
@ -1,3 +1,5 @@
|
||||
if ETRAX_ARCH_V32
|
||||
|
||||
config ETRAX_ETHERNET
|
||||
bool "Ethernet support"
|
||||
depends on ETRAX_ARCH_V32
|
||||
@ -610,3 +612,5 @@ config ETRAX_STREAMCOPROC
|
||||
help
|
||||
This option enables a driver for the stream co-processor
|
||||
for cryptographic operations.
|
||||
|
||||
endif
|
||||
|
@ -93,7 +93,7 @@ int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
|
||||
|
||||
dev->dma_mem = kzalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
|
||||
if (!dev->dma_mem)
|
||||
goto out;
|
||||
goto iounmap_out;
|
||||
dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL);
|
||||
if (!dev->dma_mem->bitmap)
|
||||
goto free1_out;
|
||||
@ -110,6 +110,8 @@ int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
|
||||
|
||||
free1_out:
|
||||
kfree(dev->dma_mem);
|
||||
iounmap_out:
|
||||
iounmap(mem_base);
|
||||
out:
|
||||
return 0;
|
||||
}
|
||||
|
@ -138,6 +138,15 @@ config UCPAGE_OFFSET_C0000000
|
||||
|
||||
endchoice
|
||||
|
||||
config PAGE_OFFSET
|
||||
hex
|
||||
default 0x20000000 if UCPAGE_OFFSET_20000000
|
||||
default 0x40000000 if UCPAGE_OFFSET_40000000
|
||||
default 0x60000000 if UCPAGE_OFFSET_60000000
|
||||
default 0x80000000 if UCPAGE_OFFSET_80000000
|
||||
default 0xA0000000 if UCPAGE_OFFSET_A0000000
|
||||
default 0xC0000000
|
||||
|
||||
config PROTECT_KERNEL
|
||||
bool "Protect core kernel against userspace"
|
||||
depends on !MMU
|
||||
|
@ -1494,7 +1494,7 @@ sys_call_table:
|
||||
.long sys_epoll_pwait
|
||||
.long sys_utimensat /* 320 */
|
||||
.long sys_signalfd
|
||||
.long sys_timerfd
|
||||
.long sys_ni_syscall
|
||||
.long sys_eventfd
|
||||
.long sys_fallocate
|
||||
|
||||
|
@ -13,7 +13,7 @@ ENTRY(_start)
|
||||
|
||||
jiffies = jiffies_64 + 4;
|
||||
|
||||
__page_offset = 0xc0000000; /* start of area covered by struct pages */
|
||||
__page_offset = CONFIG_PAGE_OFFSET; /* start of area covered by struct pages */
|
||||
__kernel_image_start = __page_offset; /* address at which kernel image resides */
|
||||
|
||||
SECTIONS
|
||||
|
@ -181,7 +181,7 @@ int cxn_pin_by_pid(pid_t pid)
|
||||
|
||||
/* get a handle on the mm_struct */
|
||||
read_lock(&tasklist_lock);
|
||||
tsk = find_task_by_pid(pid);
|
||||
tsk = find_task_by_vpid(pid);
|
||||
if (tsk) {
|
||||
ret = -EINVAL;
|
||||
|
||||
|
@ -140,7 +140,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
|
||||
return pgd;
|
||||
}
|
||||
|
||||
void pgd_free(pgd_t *pgd)
|
||||
void pgd_free(struct mm_struct *mm, pgd_t *pgd)
|
||||
{
|
||||
/* in the non-PAE case, clear_page_tables() clears user pgd entries */
|
||||
quicklist_free(0, pgd_dtor, pgd);
|
||||
|
@ -1265,7 +1265,7 @@ sba_fill_pdir(
|
||||
* the sglist do both.
|
||||
*/
|
||||
static SBA_INLINE int
|
||||
sba_coalesce_chunks( struct ioc *ioc,
|
||||
sba_coalesce_chunks(struct ioc *ioc, struct device *dev,
|
||||
struct scatterlist *startsg,
|
||||
int nents)
|
||||
{
|
||||
@ -1275,6 +1275,7 @@ sba_coalesce_chunks( struct ioc *ioc,
|
||||
struct scatterlist *dma_sg; /* next DMA stream head */
|
||||
unsigned long dma_offset, dma_len; /* start/len of DMA stream */
|
||||
int n_mappings = 0;
|
||||
unsigned int max_seg_size = dma_get_max_seg_size(dev);
|
||||
|
||||
while (nents > 0) {
|
||||
unsigned long vaddr = (unsigned long) sba_sg_address(startsg);
|
||||
@ -1314,6 +1315,9 @@ sba_coalesce_chunks( struct ioc *ioc,
|
||||
> DMA_CHUNK_SIZE)
|
||||
break;
|
||||
|
||||
if (dma_len + startsg->length > max_seg_size)
|
||||
break;
|
||||
|
||||
/*
|
||||
** Then look for virtually contiguous blocks.
|
||||
**
|
||||
@ -1441,7 +1445,7 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di
|
||||
** w/o this association, we wouldn't have coherent DMA!
|
||||
** Access to the virtual address is what forces a two pass algorithm.
|
||||
*/
|
||||
coalesced = sba_coalesce_chunks(ioc, sglist, nents);
|
||||
coalesced = sba_coalesce_chunks(ioc, dev, sglist, nents);
|
||||
|
||||
/*
|
||||
** Program the I/O Pdir
|
||||
@ -1871,7 +1875,7 @@ ioc_show(struct seq_file *s, void *v)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct seq_operations ioc_seq_ops = {
|
||||
static const struct seq_operations ioc_seq_ops = {
|
||||
.start = ioc_start,
|
||||
.next = ioc_next,
|
||||
.stop = ioc_stop,
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
#include "ia32priv.h"
|
||||
|
||||
extern void die_if_kernel (char *str, struct pt_regs *regs, long err);
|
||||
extern int die_if_kernel (char *str, struct pt_regs *regs, long err);
|
||||
|
||||
struct exec_domain ia32_exec_domain;
|
||||
struct page *ia32_shared_page[NR_CPUS];
|
||||
@ -217,7 +217,8 @@ ia32_bad_interrupt (unsigned long int_num, struct pt_regs *regs)
|
||||
{
|
||||
siginfo_t siginfo;
|
||||
|
||||
die_if_kernel("Bad IA-32 interrupt", regs, int_num);
|
||||
if (die_if_kernel("Bad IA-32 interrupt", regs, int_num))
|
||||
return;
|
||||
|
||||
siginfo.si_signo = SIGTRAP;
|
||||
siginfo.si_errno = int_num; /* XXX is it OK to abuse si_errno like this? */
|
||||
|
@ -1,7 +1,8 @@
|
||||
/*
|
||||
* Extensible Firmware Interface
|
||||
*
|
||||
* Based on Extensible Firmware Interface Specification version 0.9 April 30, 1999
|
||||
* Based on Extensible Firmware Interface Specification version 0.9
|
||||
* April 30, 1999
|
||||
*
|
||||
* Copyright (C) 1999 VA Linux Systems
|
||||
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
|
||||
@ -48,145 +49,157 @@ static unsigned long mem_limit = ~0UL, max_addr = ~0UL, min_addr = 0UL;
|
||||
|
||||
#define efi_call_virt(f, args...) (*(f))(args)
|
||||
|
||||
#define STUB_GET_TIME(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_get_time (efi_time_t *tm, efi_time_cap_t *tc) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_time_cap_t *atc = NULL; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
if (tc) \
|
||||
atc = adjust_arg(tc); \
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix((efi_get_time_t *) __va(runtime->get_time), adjust_arg(tm), atc); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
#define STUB_GET_TIME(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_get_time (efi_time_t *tm, efi_time_cap_t *tc) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_time_cap_t *atc = NULL; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
if (tc) \
|
||||
atc = adjust_arg(tc); \
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix((efi_get_time_t *) __va(runtime->get_time), \
|
||||
adjust_arg(tm), atc); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define STUB_SET_TIME(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_set_time (efi_time_t *tm) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix((efi_set_time_t *) __va(runtime->set_time), adjust_arg(tm)); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
#define STUB_SET_TIME(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_set_time (efi_time_t *tm) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix((efi_set_time_t *) __va(runtime->set_time), \
|
||||
adjust_arg(tm)); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define STUB_GET_WAKEUP_TIME(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_get_wakeup_time (efi_bool_t *enabled, efi_bool_t *pending, efi_time_t *tm) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix((efi_get_wakeup_time_t *) __va(runtime->get_wakeup_time), \
|
||||
adjust_arg(enabled), adjust_arg(pending), adjust_arg(tm)); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
#define STUB_GET_WAKEUP_TIME(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_get_wakeup_time (efi_bool_t *enabled, efi_bool_t *pending, \
|
||||
efi_time_t *tm) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix( \
|
||||
(efi_get_wakeup_time_t *) __va(runtime->get_wakeup_time), \
|
||||
adjust_arg(enabled), adjust_arg(pending), adjust_arg(tm)); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define STUB_SET_WAKEUP_TIME(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_set_wakeup_time (efi_bool_t enabled, efi_time_t *tm) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_time_t *atm = NULL; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
if (tm) \
|
||||
atm = adjust_arg(tm); \
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix((efi_set_wakeup_time_t *) __va(runtime->set_wakeup_time), \
|
||||
enabled, atm); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
#define STUB_SET_WAKEUP_TIME(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_set_wakeup_time (efi_bool_t enabled, efi_time_t *tm) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_time_t *atm = NULL; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
if (tm) \
|
||||
atm = adjust_arg(tm); \
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix( \
|
||||
(efi_set_wakeup_time_t *) __va(runtime->set_wakeup_time), \
|
||||
enabled, atm); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define STUB_GET_VARIABLE(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_get_variable (efi_char16_t *name, efi_guid_t *vendor, u32 *attr, \
|
||||
unsigned long *data_size, void *data) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
u32 *aattr = NULL; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
if (attr) \
|
||||
aattr = adjust_arg(attr); \
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix((efi_get_variable_t *) __va(runtime->get_variable), \
|
||||
adjust_arg(name), adjust_arg(vendor), aattr, \
|
||||
adjust_arg(data_size), adjust_arg(data)); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
#define STUB_GET_VARIABLE(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_get_variable (efi_char16_t *name, efi_guid_t *vendor, u32 *attr, \
|
||||
unsigned long *data_size, void *data) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
u32 *aattr = NULL; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
if (attr) \
|
||||
aattr = adjust_arg(attr); \
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix( \
|
||||
(efi_get_variable_t *) __va(runtime->get_variable), \
|
||||
adjust_arg(name), adjust_arg(vendor), aattr, \
|
||||
adjust_arg(data_size), adjust_arg(data)); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define STUB_GET_NEXT_VARIABLE(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_get_next_variable (unsigned long *name_size, efi_char16_t *name, efi_guid_t *vendor) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix((efi_get_next_variable_t *) __va(runtime->get_next_variable), \
|
||||
adjust_arg(name_size), adjust_arg(name), adjust_arg(vendor)); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
#define STUB_GET_NEXT_VARIABLE(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_get_next_variable (unsigned long *name_size, efi_char16_t *name, \
|
||||
efi_guid_t *vendor) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix( \
|
||||
(efi_get_next_variable_t *) __va(runtime->get_next_variable), \
|
||||
adjust_arg(name_size), adjust_arg(name), adjust_arg(vendor)); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define STUB_SET_VARIABLE(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_set_variable (efi_char16_t *name, efi_guid_t *vendor, unsigned long attr, \
|
||||
unsigned long data_size, void *data) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix((efi_set_variable_t *) __va(runtime->set_variable), \
|
||||
adjust_arg(name), adjust_arg(vendor), attr, data_size, \
|
||||
adjust_arg(data)); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
#define STUB_SET_VARIABLE(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_set_variable (efi_char16_t *name, efi_guid_t *vendor, \
|
||||
unsigned long attr, unsigned long data_size, \
|
||||
void *data) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix( \
|
||||
(efi_set_variable_t *) __va(runtime->set_variable), \
|
||||
adjust_arg(name), adjust_arg(vendor), attr, data_size, \
|
||||
adjust_arg(data)); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define STUB_GET_NEXT_HIGH_MONO_COUNT(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_get_next_high_mono_count (u32 *count) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix((efi_get_next_high_mono_count_t *) \
|
||||
__va(runtime->get_next_high_mono_count), adjust_arg(count)); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
#define STUB_GET_NEXT_HIGH_MONO_COUNT(prefix, adjust_arg) \
|
||||
static efi_status_t \
|
||||
prefix##_get_next_high_mono_count (u32 *count) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_status_t ret; \
|
||||
\
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
ret = efi_call_##prefix((efi_get_next_high_mono_count_t *) \
|
||||
__va(runtime->get_next_high_mono_count), \
|
||||
adjust_arg(count)); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define STUB_RESET_SYSTEM(prefix, adjust_arg) \
|
||||
static void \
|
||||
prefix##_reset_system (int reset_type, efi_status_t status, \
|
||||
unsigned long data_size, efi_char16_t *data) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_char16_t *adata = NULL; \
|
||||
\
|
||||
if (data) \
|
||||
adata = adjust_arg(data); \
|
||||
\
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
efi_call_##prefix((efi_reset_system_t *) __va(runtime->reset_system), \
|
||||
reset_type, status, data_size, adata); \
|
||||
/* should not return, but just in case... */ \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
#define STUB_RESET_SYSTEM(prefix, adjust_arg) \
|
||||
static void \
|
||||
prefix##_reset_system (int reset_type, efi_status_t status, \
|
||||
unsigned long data_size, efi_char16_t *data) \
|
||||
{ \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
efi_char16_t *adata = NULL; \
|
||||
\
|
||||
if (data) \
|
||||
adata = adjust_arg(data); \
|
||||
\
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
efi_call_##prefix( \
|
||||
(efi_reset_system_t *) __va(runtime->reset_system), \
|
||||
reset_type, status, data_size, adata); \
|
||||
/* should not return, but just in case... */ \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
}
|
||||
|
||||
#define phys_ptr(arg) ((__typeof__(arg)) ia64_tpa(arg))
|
||||
@ -223,7 +236,8 @@ efi_gettimeofday (struct timespec *ts)
|
||||
return;
|
||||
}
|
||||
|
||||
ts->tv_sec = mktime(tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second);
|
||||
ts->tv_sec = mktime(tm.year, tm.month, tm.day,
|
||||
tm.hour, tm.minute, tm.second);
|
||||
ts->tv_nsec = tm.nanosecond;
|
||||
}
|
||||
|
||||
@ -297,8 +311,8 @@ walk (efi_freemem_callback_t callback, void *arg, u64 attr)
|
||||
}
|
||||
|
||||
/*
|
||||
* Walks the EFI memory map and calls CALLBACK once for each EFI memory descriptor that
|
||||
* has memory that is available for OS use.
|
||||
* Walk the EFI memory map and call CALLBACK once for each EFI memory
|
||||
* descriptor that has memory that is available for OS use.
|
||||
*/
|
||||
void
|
||||
efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
|
||||
@ -307,8 +321,8 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
|
||||
}
|
||||
|
||||
/*
|
||||
* Walks the EFI memory map and calls CALLBACK once for each EFI memory descriptor that
|
||||
* has memory that is available for uncached allocator.
|
||||
* Walk the EFI memory map and call CALLBACK once for each EFI memory
|
||||
* descriptor that has memory that is available for uncached allocator.
|
||||
*/
|
||||
void
|
||||
efi_memmap_walk_uc (efi_freemem_callback_t callback, void *arg)
|
||||
@ -317,11 +331,10 @@ efi_memmap_walk_uc (efi_freemem_callback_t callback, void *arg)
|
||||
}
|
||||
|
||||
/*
|
||||
* Look for the PAL_CODE region reported by EFI and maps it using an
|
||||
* Look for the PAL_CODE region reported by EFI and map it using an
|
||||
* ITR to enable safe PAL calls in virtual mode. See IA-64 Processor
|
||||
* Abstraction Layer chapter 11 in ADAG
|
||||
*/
|
||||
|
||||
void *
|
||||
efi_get_pal_addr (void)
|
||||
{
|
||||
@ -341,45 +354,47 @@ efi_get_pal_addr (void)
|
||||
continue;
|
||||
|
||||
if (++pal_code_count > 1) {
|
||||
printk(KERN_ERR "Too many EFI Pal Code memory ranges, dropped @ %lx\n",
|
||||
md->phys_addr);
|
||||
printk(KERN_ERR "Too many EFI Pal Code memory ranges, "
|
||||
"dropped @ %lx\n", md->phys_addr);
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* The only ITLB entry in region 7 that is used is the one installed by
|
||||
* __start(). That entry covers a 64MB range.
|
||||
* The only ITLB entry in region 7 that is used is the one
|
||||
* installed by __start(). That entry covers a 64MB range.
|
||||
*/
|
||||
mask = ~((1 << KERNEL_TR_PAGE_SHIFT) - 1);
|
||||
vaddr = PAGE_OFFSET + md->phys_addr;
|
||||
|
||||
/*
|
||||
* We must check that the PAL mapping won't overlap with the kernel
|
||||
* mapping.
|
||||
* We must check that the PAL mapping won't overlap with the
|
||||
* kernel mapping.
|
||||
*
|
||||
* PAL code is guaranteed to be aligned on a power of 2 between 4k and
|
||||
* 256KB and that only one ITR is needed to map it. This implies that the
|
||||
* PAL code is always aligned on its size, i.e., the closest matching page
|
||||
* size supported by the TLB. Therefore PAL code is guaranteed never to
|
||||
* cross a 64MB unless it is bigger than 64MB (very unlikely!). So for
|
||||
* now the following test is enough to determine whether or not we need a
|
||||
* dedicated ITR for the PAL code.
|
||||
* PAL code is guaranteed to be aligned on a power of 2 between
|
||||
* 4k and 256KB and that only one ITR is needed to map it. This
|
||||
* implies that the PAL code is always aligned on its size,
|
||||
* i.e., the closest matching page size supported by the TLB.
|
||||
* Therefore PAL code is guaranteed never to cross a 64MB unless
|
||||
* it is bigger than 64MB (very unlikely!). So for now the
|
||||
* following test is enough to determine whether or not we need
|
||||
* a dedicated ITR for the PAL code.
|
||||
*/
|
||||
if ((vaddr & mask) == (KERNEL_START & mask)) {
|
||||
printk(KERN_INFO "%s: no need to install ITR for PAL code\n",
|
||||
__FUNCTION__);
|
||||
printk(KERN_INFO "%s: no need to install ITR for "
|
||||
"PAL code\n", __FUNCTION__);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (efi_md_size(md) > IA64_GRANULE_SIZE)
|
||||
panic("Woah! PAL code size bigger than a granule!");
|
||||
panic("Whoa! PAL code size bigger than a granule!");
|
||||
|
||||
#if EFI_DEBUG
|
||||
mask = ~((1 << IA64_GRANULE_SHIFT) - 1);
|
||||
|
||||
printk(KERN_INFO "CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n",
|
||||
smp_processor_id(), md->phys_addr,
|
||||
md->phys_addr + efi_md_size(md),
|
||||
vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE);
|
||||
printk(KERN_INFO "CPU %d: mapping PAL code "
|
||||
"[0x%lx-0x%lx) into [0x%lx-0x%lx)\n",
|
||||
smp_processor_id(), md->phys_addr,
|
||||
md->phys_addr + efi_md_size(md),
|
||||
vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE);
|
||||
#endif
|
||||
return __va(md->phys_addr);
|
||||
}
|
||||
@ -401,11 +416,11 @@ efi_map_pal_code (void)
|
||||
* Cannot write to CRx with PSR.ic=1
|
||||
*/
|
||||
psr = ia64_clear_ic();
|
||||
ia64_itr(0x1, IA64_TR_PALCODE, GRANULEROUNDDOWN((unsigned long) pal_vaddr),
|
||||
ia64_itr(0x1, IA64_TR_PALCODE,
|
||||
GRANULEROUNDDOWN((unsigned long) pal_vaddr),
|
||||
pte_val(pfn_pte(__pa(pal_vaddr) >> PAGE_SHIFT, PAGE_KERNEL)),
|
||||
IA64_GRANULE_SHIFT);
|
||||
ia64_set_psr(psr); /* restore psr */
|
||||
ia64_srlz_i();
|
||||
}
|
||||
|
||||
void __init
|
||||
@ -418,7 +433,10 @@ efi_init (void)
|
||||
char *cp, vendor[100] = "unknown";
|
||||
int i;
|
||||
|
||||
/* it's too early to be able to use the standard kernel command line support... */
|
||||
/*
|
||||
* It's too early to be able to use the standard kernel command line
|
||||
* support...
|
||||
*/
|
||||
for (cp = boot_command_line; *cp; ) {
|
||||
if (memcmp(cp, "mem=", 4) == 0) {
|
||||
mem_limit = memparse(cp + 4, &cp);
|
||||
@ -434,9 +452,11 @@ efi_init (void)
|
||||
}
|
||||
}
|
||||
if (min_addr != 0UL)
|
||||
printk(KERN_INFO "Ignoring memory below %luMB\n", min_addr >> 20);
|
||||
printk(KERN_INFO "Ignoring memory below %luMB\n",
|
||||
min_addr >> 20);
|
||||
if (max_addr != ~0UL)
|
||||
printk(KERN_INFO "Ignoring memory above %luMB\n", max_addr >> 20);
|
||||
printk(KERN_INFO "Ignoring memory above %luMB\n",
|
||||
max_addr >> 20);
|
||||
|
||||
efi.systab = __va(ia64_boot_param->efi_systab);
|
||||
|
||||
@ -444,9 +464,9 @@ efi_init (void)
|
||||
* Verify the EFI Table
|
||||
*/
|
||||
if (efi.systab == NULL)
|
||||
panic("Woah! Can't find EFI system table.\n");
|
||||
panic("Whoa! Can't find EFI system table.\n");
|
||||
if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
|
||||
panic("Woah! EFI system table signature incorrect\n");
|
||||
panic("Whoa! EFI system table signature incorrect\n");
|
||||
if ((efi.systab->hdr.revision >> 16) == 0)
|
||||
printk(KERN_WARNING "Warning: EFI system table version "
|
||||
"%d.%02d, expected 1.00 or greater\n",
|
||||
@ -464,7 +484,8 @@ efi_init (void)
|
||||
}
|
||||
|
||||
printk(KERN_INFO "EFI v%u.%.02u by %s:",
|
||||
efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff, vendor);
|
||||
efi.systab->hdr.revision >> 16,
|
||||
efi.systab->hdr.revision & 0xffff, vendor);
|
||||
|
||||
efi.mps = EFI_INVALID_TABLE_ADDR;
|
||||
efi.acpi = EFI_INVALID_TABLE_ADDR;
|
||||
@ -519,9 +540,12 @@ efi_init (void)
|
||||
efi_memory_desc_t *md;
|
||||
void *p;
|
||||
|
||||
for (i = 0, p = efi_map_start; p < efi_map_end; ++i, p += efi_desc_size) {
|
||||
for (i = 0, p = efi_map_start; p < efi_map_end;
|
||||
++i, p += efi_desc_size)
|
||||
{
|
||||
md = p;
|
||||
printk("mem%02u: type=%u, attr=0x%lx, range=[0x%016lx-0x%016lx) (%luMB)\n",
|
||||
printk("mem%02u: type=%u, attr=0x%lx, "
|
||||
"range=[0x%016lx-0x%016lx) (%luMB)\n",
|
||||
i, md->type, md->attribute, md->phys_addr,
|
||||
md->phys_addr + efi_md_size(md),
|
||||
md->num_pages >> (20 - EFI_PAGE_SHIFT));
|
||||
@ -549,8 +573,8 @@ efi_enter_virtual_mode (void)
|
||||
md = p;
|
||||
if (md->attribute & EFI_MEMORY_RUNTIME) {
|
||||
/*
|
||||
* Some descriptors have multiple bits set, so the order of
|
||||
* the tests is relevant.
|
||||
* Some descriptors have multiple bits set, so the
|
||||
* order of the tests is relevant.
|
||||
*/
|
||||
if (md->attribute & EFI_MEMORY_WB) {
|
||||
md->virt_addr = (u64) __va(md->phys_addr);
|
||||
@ -558,21 +582,26 @@ efi_enter_virtual_mode (void)
|
||||
md->virt_addr = (u64) ioremap(md->phys_addr, 0);
|
||||
} else if (md->attribute & EFI_MEMORY_WC) {
|
||||
#if 0
|
||||
md->virt_addr = ia64_remap(md->phys_addr, (_PAGE_A | _PAGE_P
|
||||
| _PAGE_D
|
||||
| _PAGE_MA_WC
|
||||
| _PAGE_PL_0
|
||||
| _PAGE_AR_RW));
|
||||
md->virt_addr = ia64_remap(md->phys_addr,
|
||||
(_PAGE_A |
|
||||
_PAGE_P |
|
||||
_PAGE_D |
|
||||
_PAGE_MA_WC |
|
||||
_PAGE_PL_0 |
|
||||
_PAGE_AR_RW));
|
||||
#else
|
||||
printk(KERN_INFO "EFI_MEMORY_WC mapping\n");
|
||||
md->virt_addr = (u64) ioremap(md->phys_addr, 0);
|
||||
#endif
|
||||
} else if (md->attribute & EFI_MEMORY_WT) {
|
||||
#if 0
|
||||
md->virt_addr = ia64_remap(md->phys_addr, (_PAGE_A | _PAGE_P
|
||||
| _PAGE_D | _PAGE_MA_WT
|
||||
| _PAGE_PL_0
|
||||
| _PAGE_AR_RW));
|
||||
md->virt_addr = ia64_remap(md->phys_addr,
|
||||
(_PAGE_A |
|
||||
_PAGE_P |
|
||||
_PAGE_D |
|
||||
_PAGE_MA_WT |
|
||||
_PAGE_PL_0 |
|
||||
_PAGE_AR_RW));
|
||||
#else
|
||||
printk(KERN_INFO "EFI_MEMORY_WT mapping\n");
|
||||
md->virt_addr = (u64) ioremap(md->phys_addr, 0);
|
||||
@ -583,16 +612,18 @@ efi_enter_virtual_mode (void)
|
||||
|
||||
status = efi_call_phys(__va(runtime->set_virtual_address_map),
|
||||
ia64_boot_param->efi_memmap_size,
|
||||
efi_desc_size, ia64_boot_param->efi_memdesc_version,
|
||||
efi_desc_size,
|
||||
ia64_boot_param->efi_memdesc_version,
|
||||
ia64_boot_param->efi_memmap);
|
||||
if (status != EFI_SUCCESS) {
|
||||
printk(KERN_WARNING "warning: unable to switch EFI into virtual mode "
|
||||
"(status=%lu)\n", status);
|
||||
printk(KERN_WARNING "warning: unable to switch EFI into "
|
||||
"virtual mode (status=%lu)\n", status);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now that EFI is in virtual mode, we call the EFI functions more efficiently:
|
||||
* Now that EFI is in virtual mode, we call the EFI functions more
|
||||
* efficiently:
|
||||
*/
|
||||
efi.get_time = virt_get_time;
|
||||
efi.set_time = virt_set_time;
|
||||
@ -606,8 +637,8 @@ efi_enter_virtual_mode (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Walk the EFI memory map looking for the I/O port range. There can only be one entry of
|
||||
* this type, other I/O port ranges should be described via ACPI.
|
||||
* Walk the EFI memory map looking for the I/O port range. There can only be
|
||||
* one entry of this type, other I/O port ranges should be described via ACPI.
|
||||
*/
|
||||
u64
|
||||
efi_get_iobase (void)
|
||||
@ -678,7 +709,6 @@ efi_memmap_intersects (unsigned long phys_addr, unsigned long size)
|
||||
|
||||
for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
|
||||
md = p;
|
||||
|
||||
if (md->phys_addr < end && efi_md_end(md) > phys_addr)
|
||||
return 1;
|
||||
}
|
||||
@ -731,7 +761,7 @@ efi_mem_attribute (unsigned long phys_addr, unsigned long size)
|
||||
if (!md || (md->attribute & ~EFI_MEMORY_RUNTIME) != attr)
|
||||
return 0;
|
||||
} while (md);
|
||||
return 0;
|
||||
return 0; /* never reached */
|
||||
}
|
||||
|
||||
u64
|
||||
@ -767,7 +797,7 @@ kern_mem_attribute (unsigned long phys_addr, unsigned long size)
|
||||
if (!md || md->attribute != attr)
|
||||
return 0;
|
||||
} while (md);
|
||||
return 0;
|
||||
return 0; /* never reached */
|
||||
}
|
||||
EXPORT_SYMBOL(kern_mem_attribute);
|
||||
|
||||
@ -883,7 +913,7 @@ efi_uart_console_only(void)
|
||||
return 1;
|
||||
uart = 0;
|
||||
}
|
||||
hdr = (struct efi_generic_dev_path *) ((u8 *) hdr + hdr->length);
|
||||
hdr = (struct efi_generic_dev_path *)((u8 *) hdr + hdr->length);
|
||||
}
|
||||
printk(KERN_ERR "Malformed %s value\n", name);
|
||||
return 0;
|
||||
@ -921,10 +951,12 @@ find_memmap_space (void)
|
||||
if (!efi_wb(md)) {
|
||||
continue;
|
||||
}
|
||||
if (pmd == NULL || !efi_wb(pmd) || efi_md_end(pmd) != md->phys_addr) {
|
||||
if (pmd == NULL || !efi_wb(pmd) ||
|
||||
efi_md_end(pmd) != md->phys_addr) {
|
||||
contig_low = GRANULEROUNDUP(md->phys_addr);
|
||||
contig_high = efi_md_end(md);
|
||||
for (q = p + efi_desc_size; q < efi_map_end; q += efi_desc_size) {
|
||||
for (q = p + efi_desc_size; q < efi_map_end;
|
||||
q += efi_desc_size) {
|
||||
check_md = q;
|
||||
if (!efi_wb(check_md))
|
||||
break;
|
||||
@ -988,8 +1020,9 @@ efi_memmap_init(unsigned long *s, unsigned long *e)
|
||||
for (p = efi_map_start; p < efi_map_end; pmd = md, p += efi_desc_size) {
|
||||
md = p;
|
||||
if (!efi_wb(md)) {
|
||||
if (efi_uc(md) && (md->type == EFI_CONVENTIONAL_MEMORY ||
|
||||
md->type == EFI_BOOT_SERVICES_DATA)) {
|
||||
if (efi_uc(md) &&
|
||||
(md->type == EFI_CONVENTIONAL_MEMORY ||
|
||||
md->type == EFI_BOOT_SERVICES_DATA)) {
|
||||
k->attribute = EFI_MEMORY_UC;
|
||||
k->start = md->phys_addr;
|
||||
k->num_pages = md->num_pages;
|
||||
@ -997,10 +1030,12 @@ efi_memmap_init(unsigned long *s, unsigned long *e)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (pmd == NULL || !efi_wb(pmd) || efi_md_end(pmd) != md->phys_addr) {
|
||||
if (pmd == NULL || !efi_wb(pmd) ||
|
||||
efi_md_end(pmd) != md->phys_addr) {
|
||||
contig_low = GRANULEROUNDUP(md->phys_addr);
|
||||
contig_high = efi_md_end(md);
|
||||
for (q = p + efi_desc_size; q < efi_map_end; q += efi_desc_size) {
|
||||
for (q = p + efi_desc_size; q < efi_map_end;
|
||||
q += efi_desc_size) {
|
||||
check_md = q;
|
||||
if (!efi_wb(check_md))
|
||||
break;
|
||||
@ -1025,13 +1060,17 @@ efi_memmap_init(unsigned long *s, unsigned long *e)
|
||||
if (md->phys_addr < contig_low) {
|
||||
lim = min(efi_md_end(md), contig_low);
|
||||
if (efi_uc(md)) {
|
||||
if (k > kern_memmap && (k-1)->attribute == EFI_MEMORY_UC &&
|
||||
if (k > kern_memmap &&
|
||||
(k-1)->attribute == EFI_MEMORY_UC &&
|
||||
kmd_end(k-1) == md->phys_addr) {
|
||||
(k-1)->num_pages += (lim - md->phys_addr) >> EFI_PAGE_SHIFT;
|
||||
(k-1)->num_pages +=
|
||||
(lim - md->phys_addr)
|
||||
>> EFI_PAGE_SHIFT;
|
||||
} else {
|
||||
k->attribute = EFI_MEMORY_UC;
|
||||
k->start = md->phys_addr;
|
||||
k->num_pages = (lim - md->phys_addr) >> EFI_PAGE_SHIFT;
|
||||
k->num_pages = (lim - md->phys_addr)
|
||||
>> EFI_PAGE_SHIFT;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
@ -1049,7 +1088,8 @@ efi_memmap_init(unsigned long *s, unsigned long *e)
|
||||
} else {
|
||||
k->attribute = EFI_MEMORY_UC;
|
||||
k->start = lim;
|
||||
k->num_pages = (efi_md_end(md) - lim) >> EFI_PAGE_SHIFT;
|
||||
k->num_pages = (efi_md_end(md) - lim)
|
||||
>> EFI_PAGE_SHIFT;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
@ -1151,8 +1191,10 @@ efi_initialize_iomem_resources(struct resource *code_resource,
|
||||
break;
|
||||
}
|
||||
|
||||
if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) {
|
||||
printk(KERN_ERR "failed to alocate resource for iomem\n");
|
||||
if ((res = kzalloc(sizeof(struct resource),
|
||||
GFP_KERNEL)) == NULL) {
|
||||
printk(KERN_ERR
|
||||
"failed to allocate resource for iomem\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1187,44 +1229,44 @@ efi_initialize_iomem_resources(struct resource *code_resource,
|
||||
rsvd_regions are sorted
|
||||
*/
|
||||
unsigned long __init
|
||||
kdump_find_rsvd_region (unsigned long size,
|
||||
struct rsvd_region *r, int n)
|
||||
kdump_find_rsvd_region (unsigned long size, struct rsvd_region *r, int n)
|
||||
{
|
||||
int i;
|
||||
u64 start, end;
|
||||
u64 alignment = 1UL << _PAGE_SIZE_64M;
|
||||
void *efi_map_start, *efi_map_end, *p;
|
||||
efi_memory_desc_t *md;
|
||||
u64 efi_desc_size;
|
||||
int i;
|
||||
u64 start, end;
|
||||
u64 alignment = 1UL << _PAGE_SIZE_64M;
|
||||
void *efi_map_start, *efi_map_end, *p;
|
||||
efi_memory_desc_t *md;
|
||||
u64 efi_desc_size;
|
||||
|
||||
efi_map_start = __va(ia64_boot_param->efi_memmap);
|
||||
efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size;
|
||||
efi_desc_size = ia64_boot_param->efi_memdesc_size;
|
||||
efi_map_start = __va(ia64_boot_param->efi_memmap);
|
||||
efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size;
|
||||
efi_desc_size = ia64_boot_param->efi_memdesc_size;
|
||||
|
||||
for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
|
||||
md = p;
|
||||
if (!efi_wb(md))
|
||||
continue;
|
||||
start = ALIGN(md->phys_addr, alignment);
|
||||
end = efi_md_end(md);
|
||||
for (i = 0; i < n; i++) {
|
||||
if (__pa(r[i].start) >= start && __pa(r[i].end) < end) {
|
||||
if (__pa(r[i].start) > start + size)
|
||||
return start;
|
||||
start = ALIGN(__pa(r[i].end), alignment);
|
||||
if (i < n-1 && __pa(r[i+1].start) < start + size)
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
|
||||
md = p;
|
||||
if (!efi_wb(md))
|
||||
continue;
|
||||
start = ALIGN(md->phys_addr, alignment);
|
||||
end = efi_md_end(md);
|
||||
for (i = 0; i < n; i++) {
|
||||
if (__pa(r[i].start) >= start && __pa(r[i].end) < end) {
|
||||
if (__pa(r[i].start) > start + size)
|
||||
return start;
|
||||
start = ALIGN(__pa(r[i].end), alignment);
|
||||
if (i < n-1 &&
|
||||
__pa(r[i+1].start) < start + size)
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (end > start + size)
|
||||
return start;
|
||||
}
|
||||
if (end > start + size)
|
||||
return start;
|
||||
}
|
||||
|
||||
printk(KERN_WARNING "Cannot reserve 0x%lx byte of memory for crashdump\n",
|
||||
size);
|
||||
return ~0UL;
|
||||
printk(KERN_WARNING
|
||||
"Cannot reserve 0x%lx byte of memory for crashdump\n", size);
|
||||
return ~0UL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1586,7 +1586,7 @@ sys_call_table:
|
||||
data8 sys_epoll_pwait // 1305
|
||||
data8 sys_utimensat
|
||||
data8 sys_signalfd
|
||||
data8 sys_timerfd
|
||||
data8 sys_ni_syscall
|
||||
data8 sys_eventfd
|
||||
|
||||
.org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
|
||||
|
@ -14,10 +14,10 @@ struct fsyscall_gtod_data_t {
|
||||
u32 clk_shift;
|
||||
void *clk_fsys_mmio;
|
||||
cycle_t clk_cycle_last;
|
||||
} __attribute__ ((aligned (L1_CACHE_BYTES)));
|
||||
} ____cacheline_aligned;
|
||||
|
||||
struct itc_jitter_data_t {
|
||||
int itc_jitter;
|
||||
cycle_t itc_lastcycle;
|
||||
} __attribute__ ((aligned (L1_CACHE_BYTES)));
|
||||
} ____cacheline_aligned;
|
||||
|
||||
|
@ -12,6 +12,9 @@ EXPORT_SYMBOL(memset);
|
||||
EXPORT_SYMBOL(memcpy);
|
||||
EXPORT_SYMBOL(strlen);
|
||||
|
||||
#include<asm/pgtable.h>
|
||||
EXPORT_SYMBOL_GPL(empty_zero_page);
|
||||
|
||||
#include <asm/checksum.h>
|
||||
EXPORT_SYMBOL(ip_fast_csum); /* hand-coded assembly */
|
||||
EXPORT_SYMBOL(csum_ipv6_magic);
|
||||
|
@ -381,9 +381,10 @@ static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
|
||||
static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
|
||||
{
|
||||
unsigned int i;
|
||||
i = atomic_sub_return(1, &kcb->prev_kprobe_index);
|
||||
__get_cpu_var(current_kprobe) = kcb->prev_kprobe[i].kp;
|
||||
kcb->kprobe_status = kcb->prev_kprobe[i].status;
|
||||
i = atomic_read(&kcb->prev_kprobe_index);
|
||||
__get_cpu_var(current_kprobe) = kcb->prev_kprobe[i-1].kp;
|
||||
kcb->kprobe_status = kcb->prev_kprobe[i-1].status;
|
||||
atomic_sub(1, &kcb->prev_kprobe_index);
|
||||
}
|
||||
|
||||
static void __kprobes set_current_kprobe(struct kprobe *p,
|
||||
|
@ -2,61 +2,69 @@
|
||||
* File: mca.c
|
||||
* Purpose: Generic MCA handling layer
|
||||
*
|
||||
* Updated for latest kernel
|
||||
* Copyright (C) 2003 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*
|
||||
* Copyright (C) 2002 Dell Inc.
|
||||
* Copyright (C) Matt Domsch (Matt_Domsch@dell.com)
|
||||
* Copyright (C) Matt Domsch <Matt_Domsch@dell.com>
|
||||
*
|
||||
* Copyright (C) 2002 Intel
|
||||
* Copyright (C) Jenna Hall (jenna.s.hall@intel.com)
|
||||
* Copyright (C) Jenna Hall <jenna.s.hall@intel.com>
|
||||
*
|
||||
* Copyright (C) 2001 Intel
|
||||
* Copyright (C) Fred Lewis (frederick.v.lewis@intel.com)
|
||||
* Copyright (C) Fred Lewis <frederick.v.lewis@intel.com>
|
||||
*
|
||||
* Copyright (C) 2000 Intel
|
||||
* Copyright (C) Chuck Fleckenstein (cfleck@co.intel.com)
|
||||
* Copyright (C) Chuck Fleckenstein <cfleck@co.intel.com>
|
||||
*
|
||||
* Copyright (C) 1999, 2004 Silicon Graphics, Inc.
|
||||
* Copyright (C) Vijay Chander(vijay@engr.sgi.com)
|
||||
* Copyright (C) Vijay Chander <vijay@engr.sgi.com>
|
||||
*
|
||||
* 03/04/15 D. Mosberger Added INIT backtrace support.
|
||||
* 02/03/25 M. Domsch GUID cleanups
|
||||
* Copyright (C) 2006 FUJITSU LIMITED
|
||||
* Copyright (C) Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
|
||||
*
|
||||
* 02/01/04 J. Hall Aligned MCA stack to 16 bytes, added platform vs. CPU
|
||||
* error flag, set SAL default return values, changed
|
||||
* error record structure to linked list, added init call
|
||||
* to sal_get_state_info_size().
|
||||
* 2000-03-29 Chuck Fleckenstein <cfleck@co.intel.com>
|
||||
* Fixed PAL/SAL update issues, began MCA bug fixes, logging issues,
|
||||
* added min save state dump, added INIT handler.
|
||||
*
|
||||
* 01/01/03 F. Lewis Added setup of CMCI and CPEI IRQs, logging of corrected
|
||||
* platform errors, completed code for logging of
|
||||
* corrected & uncorrected machine check errors, and
|
||||
* updated for conformance with Nov. 2000 revision of the
|
||||
* SAL 3.0 spec.
|
||||
* 00/03/29 C. Fleckenstein Fixed PAL/SAL update issues, began MCA bug fixes, logging issues,
|
||||
* added min save state dump, added INIT handler.
|
||||
* 2001-01-03 Fred Lewis <frederick.v.lewis@intel.com>
|
||||
* Added setup of CMCI and CPEI IRQs, logging of corrected platform
|
||||
* errors, completed code for logging of corrected & uncorrected
|
||||
* machine check errors, and updated for conformance with Nov. 2000
|
||||
* revision of the SAL 3.0 spec.
|
||||
*
|
||||
* 2002-01-04 Jenna Hall <jenna.s.hall@intel.com>
|
||||
* Aligned MCA stack to 16 bytes, added platform vs. CPU error flag,
|
||||
* set SAL default return values, changed error record structure to
|
||||
* linked list, added init call to sal_get_state_info_size().
|
||||
*
|
||||
* 2002-03-25 Matt Domsch <Matt_Domsch@dell.com>
|
||||
* GUID cleanups.
|
||||
*
|
||||
* 2003-04-15 David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Added INIT backtrace support.
|
||||
*
|
||||
* 2003-12-08 Keith Owens <kaos@sgi.com>
|
||||
* smp_call_function() must not be called from interrupt context (can
|
||||
* deadlock on tasklist_lock). Use keventd to call smp_call_function().
|
||||
* smp_call_function() must not be called from interrupt context
|
||||
* (can deadlock on tasklist_lock).
|
||||
* Use keventd to call smp_call_function().
|
||||
*
|
||||
* 2004-02-01 Keith Owens <kaos@sgi.com>
|
||||
* Avoid deadlock when using printk() for MCA and INIT records.
|
||||
* Delete all record printing code, moved to salinfo_decode in user space.
|
||||
* Mark variables and functions static where possible.
|
||||
* Delete dead variables and functions.
|
||||
* Reorder to remove the need for forward declarations and to consolidate
|
||||
* related code.
|
||||
* Avoid deadlock when using printk() for MCA and INIT records.
|
||||
* Delete all record printing code, moved to salinfo_decode in user
|
||||
* space. Mark variables and functions static where possible.
|
||||
* Delete dead variables and functions. Reorder to remove the need
|
||||
* for forward declarations and to consolidate related code.
|
||||
*
|
||||
* 2005-08-12 Keith Owens <kaos@sgi.com>
|
||||
* Convert MCA/INIT handlers to use per event stacks and SAL/OS state.
|
||||
* Convert MCA/INIT handlers to use per event stacks and SAL/OS
|
||||
* state.
|
||||
*
|
||||
* 2005-10-07 Keith Owens <kaos@sgi.com>
|
||||
* Add notify_die() hooks.
|
||||
*
|
||||
* 2006-09-15 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
|
||||
* Add printing support for MCA/INIT.
|
||||
* Add printing support for MCA/INIT.
|
||||
*
|
||||
* 2007-04-27 Russ Anderson <rja@sgi.com>
|
||||
* Support multiple cpus going through OS_MCA in the same event.
|
||||
|
@ -1,24 +1,28 @@
|
||||
//
|
||||
// assembly portion of the IA64 MCA handling
|
||||
//
|
||||
// Mods by cfleck to integrate into kernel build
|
||||
// 00/03/15 davidm Added various stop bits to get a clean compile
|
||||
//
|
||||
// 00/03/29 cfleck Added code to save INIT handoff state in pt_regs format, switch to temp
|
||||
// kstack, switch modes, jump to C INIT handler
|
||||
//
|
||||
// 02/01/04 J.Hall <jenna.s.hall@intel.com>
|
||||
// Before entering virtual mode code:
|
||||
// 1. Check for TLB CPU error
|
||||
// 2. Restore current thread pointer to kr6
|
||||
// 3. Move stack ptr 16 bytes to conform to C calling convention
|
||||
//
|
||||
// 04/11/12 Russ Anderson <rja@sgi.com>
|
||||
// Added per cpu MCA/INIT stack save areas.
|
||||
//
|
||||
// 12/08/05 Keith Owens <kaos@sgi.com>
|
||||
// Use per cpu MCA/INIT stacks for all data.
|
||||
//
|
||||
/*
|
||||
* File: mca_asm.S
|
||||
* Purpose: assembly portion of the IA64 MCA handling
|
||||
*
|
||||
* Mods by cfleck to integrate into kernel build
|
||||
*
|
||||
* 2000-03-15 David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Added various stop bits to get a clean compile
|
||||
*
|
||||
* 2000-03-29 Chuck Fleckenstein <cfleck@co.intel.com>
|
||||
* Added code to save INIT handoff state in pt_regs format,
|
||||
* switch to temp kstack, switch modes, jump to C INIT handler
|
||||
*
|
||||
* 2002-01-04 J.Hall <jenna.s.hall@intel.com>
|
||||
* Before entering virtual mode code:
|
||||
* 1. Check for TLB CPU error
|
||||
* 2. Restore current thread pointer to kr6
|
||||
* 3. Move stack ptr 16 bytes to conform to C calling convention
|
||||
*
|
||||
* 2004-11-12 Russ Anderson <rja@sgi.com>
|
||||
* Added per cpu MCA/INIT stack save areas.
|
||||
*
|
||||
* 2005-12-08 Keith Owens <kaos@sgi.com>
|
||||
* Use per cpu MCA/INIT stacks for all data.
|
||||
*/
|
||||
#include <linux/threads.h>
|
||||
|
||||
#include <asm/asmmacro.h>
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Purpose: Generic MCA handling layer
|
||||
*
|
||||
* Copyright (C) 2004 FUJITSU LIMITED
|
||||
* Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com)
|
||||
* Copyright (C) 2004 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
|
||||
* Copyright (C) 2005 Silicon Graphics, Inc
|
||||
* Copyright (C) 2005 Keith Owens <kaos@sgi.com>
|
||||
* Copyright (C) 2006 Russ Anderson <rja@sgi.com>
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Purpose: Define helpers for Generic MCA handling
|
||||
*
|
||||
* Copyright (C) 2004 FUJITSU LIMITED
|
||||
* Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com)
|
||||
* Copyright (C) 2004 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
|
||||
*/
|
||||
/*
|
||||
* Processor error section:
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Purpose: Assembly portion of Generic MCA handling
|
||||
*
|
||||
* Copyright (C) 2004 FUJITSU LIMITED
|
||||
* Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com)
|
||||
* Copyright (C) 2004 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
|
||||
*/
|
||||
#include <linux/threads.h>
|
||||
|
||||
|
@ -2654,11 +2654,11 @@ pfm_get_task(pfm_context_t *ctx, pid_t pid, struct task_struct **task)
|
||||
/* XXX: need to add more checks here */
|
||||
if (pid < 2) return -EPERM;
|
||||
|
||||
if (pid != current->pid) {
|
||||
if (pid != task_pid_vnr(current)) {
|
||||
|
||||
read_lock(&tasklist_lock);
|
||||
|
||||
p = find_task_by_pid(pid);
|
||||
p = find_task_by_vpid(pid);
|
||||
|
||||
/* make sure task cannot go away while we operate on it */
|
||||
if (p) get_task_struct(p);
|
||||
@ -5795,7 +5795,7 @@ pfm_proc_show(struct seq_file *m, void *v)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct seq_operations pfm_seq_ops = {
|
||||
const struct seq_operations pfm_seq_ops = {
|
||||
.start = pfm_proc_start,
|
||||
.next = pfm_proc_next,
|
||||
.stop = pfm_proc_stop,
|
||||
|
@ -284,6 +284,7 @@ ia64_sal_cache_flush (u64 cache_type)
|
||||
SAL_CALL(isrv, SAL_CACHE_FLUSH, cache_type, 0, 0, 0, 0, 0, 0);
|
||||
return isrv.status;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ia64_sal_cache_flush);
|
||||
|
||||
void __init
|
||||
ia64_sal_init (struct ia64_sal_systab *systab)
|
||||
@ -372,3 +373,16 @@ ia64_sal_oemcall_reentrant(struct ia64_sal_retval *isrvp, u64 oemfunc,
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ia64_sal_oemcall_reentrant);
|
||||
|
||||
long
|
||||
ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
|
||||
unsigned long *drift_info)
|
||||
{
|
||||
struct ia64_sal_retval isrv;
|
||||
|
||||
SAL_CALL(isrv, SAL_FREQ_BASE, which, 0, 0, 0, 0, 0, 0);
|
||||
*ticks_per_second = isrv.v0;
|
||||
*drift_info = isrv.v1;
|
||||
return isrv.status;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ia64_sal_freq_base);
|
||||
|
@ -654,7 +654,7 @@ c_stop (struct seq_file *m, void *v)
|
||||
{
|
||||
}
|
||||
|
||||
struct seq_operations cpuinfo_op = {
|
||||
const struct seq_operations cpuinfo_op = {
|
||||
.start = c_start,
|
||||
.next = c_next,
|
||||
.stop = c_stop,
|
||||
|
@ -767,17 +767,6 @@ void __cpu_die(unsigned int cpu)
|
||||
}
|
||||
printk(KERN_ERR "CPU %u didn't die...\n", cpu);
|
||||
}
|
||||
#else /* !CONFIG_HOTPLUG_CPU */
|
||||
int __cpu_disable(void)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
void __cpu_die(unsigned int cpu)
|
||||
{
|
||||
/* We said "no" in __cpu_disable */
|
||||
BUG();
|
||||
}
|
||||
#endif /* CONFIG_HOTPLUG_CPU */
|
||||
|
||||
void
|
||||
|
@ -35,7 +35,7 @@ trap_init (void)
|
||||
fpswa_interface = __va(ia64_boot_param->fpswa);
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
die (const char *str, struct pt_regs *regs, long err)
|
||||
{
|
||||
static struct {
|
||||
@ -62,8 +62,11 @@ die (const char *str, struct pt_regs *regs, long err)
|
||||
if (++die.lock_owner_depth < 3) {
|
||||
printk("%s[%d]: %s %ld [%d]\n",
|
||||
current->comm, task_pid_nr(current), str, err, ++die_counter);
|
||||
(void) notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV);
|
||||
show_regs(regs);
|
||||
if (notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV)
|
||||
!= NOTIFY_STOP)
|
||||
show_regs(regs);
|
||||
else
|
||||
regs = NULL;
|
||||
} else
|
||||
printk(KERN_ERR "Recursive die() failure, output suppressed\n");
|
||||
|
||||
@ -72,17 +75,22 @@ die (const char *str, struct pt_regs *regs, long err)
|
||||
add_taint(TAINT_DIE);
|
||||
spin_unlock_irq(&die.lock);
|
||||
|
||||
if (!regs)
|
||||
return 1;
|
||||
|
||||
if (panic_on_oops)
|
||||
panic("Fatal exception");
|
||||
|
||||
do_exit(SIGSEGV);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
die_if_kernel (char *str, struct pt_regs *regs, long err)
|
||||
{
|
||||
if (!user_mode(regs))
|
||||
die(str, regs, err);
|
||||
return die(str, regs, err);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
@ -102,7 +110,8 @@ __kprobes ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
|
||||
if (notify_die(DIE_BREAK, "break 0", regs, break_num, TRAP_BRKPT, SIGTRAP)
|
||||
== NOTIFY_STOP)
|
||||
return;
|
||||
die_if_kernel("bugcheck!", regs, break_num);
|
||||
if (die_if_kernel("bugcheck!", regs, break_num))
|
||||
return;
|
||||
sig = SIGILL; code = ILL_ILLOPC;
|
||||
break;
|
||||
|
||||
@ -155,8 +164,9 @@ __kprobes ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
|
||||
break;
|
||||
|
||||
default:
|
||||
if (break_num < 0x40000 || break_num > 0x100000)
|
||||
die_if_kernel("Bad break", regs, break_num);
|
||||
if ((break_num < 0x40000 || break_num > 0x100000)
|
||||
&& die_if_kernel("Bad break", regs, break_num))
|
||||
return;
|
||||
|
||||
if (break_num < 0x80000) {
|
||||
sig = SIGILL; code = __ILL_BREAK;
|
||||
@ -402,14 +412,15 @@ ia64_illegal_op_fault (unsigned long ec, long arg1, long arg2, long arg3,
|
||||
#endif
|
||||
|
||||
sprintf(buf, "IA-64 Illegal operation fault");
|
||||
die_if_kernel(buf, ®s, 0);
|
||||
rv.fkt = 0;
|
||||
if (die_if_kernel(buf, ®s, 0))
|
||||
return rv;
|
||||
|
||||
memset(&si, 0, sizeof(si));
|
||||
si.si_signo = SIGILL;
|
||||
si.si_code = ILL_ILLOPC;
|
||||
si.si_addr = (void __user *) (regs.cr_iip + ia64_psr(®s)->ri);
|
||||
force_sig_info(SIGILL, &si, current);
|
||||
rv.fkt = 0;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -644,6 +655,6 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
|
||||
sprintf(buf, "Fault %lu", vector);
|
||||
break;
|
||||
}
|
||||
die_if_kernel(buf, ®s, error);
|
||||
force_sig(SIGILL, current);
|
||||
if (!die_if_kernel(buf, ®s, error))
|
||||
force_sig(SIGILL, current);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/unaligned.h>
|
||||
|
||||
extern void die_if_kernel(char *str, struct pt_regs *regs, long err);
|
||||
extern int die_if_kernel(char *str, struct pt_regs *regs, long err);
|
||||
|
||||
#undef DEBUG_UNALIGNED_TRAP
|
||||
|
||||
@ -675,8 +675,9 @@ emulate_load_updates (update_t type, load_store_t ld, struct pt_regs *regs, unsi
|
||||
*/
|
||||
if (ld.x6_op == 1 || ld.x6_op == 3) {
|
||||
printk(KERN_ERR "%s: register update on speculative load, error\n", __FUNCTION__);
|
||||
die_if_kernel("unaligned reference on speculative load with register update\n",
|
||||
regs, 30);
|
||||
if (die_if_kernel("unaligned reference on speculative load with register update\n",
|
||||
regs, 30))
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -1317,7 +1318,8 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
|
||||
|
||||
if (ia64_psr(regs)->be) {
|
||||
/* we don't support big-endian accesses */
|
||||
die_if_kernel("big-endian unaligned accesses are not supported", regs, 0);
|
||||
if (die_if_kernel("big-endian unaligned accesses are not supported", regs, 0))
|
||||
return;
|
||||
goto force_sigbus;
|
||||
}
|
||||
|
||||
@ -1534,7 +1536,8 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
|
||||
ia64_handle_exception(regs, eh);
|
||||
goto done;
|
||||
}
|
||||
die_if_kernel("error during unaligned kernel access\n", regs, ret);
|
||||
if (die_if_kernel("error during unaligned kernel access\n", regs, ret))
|
||||
return;
|
||||
/* NOT_REACHED */
|
||||
}
|
||||
force_sigbus:
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <asm/system.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
extern void die (char *, struct pt_regs *, long);
|
||||
extern int die(char *, struct pt_regs *, long);
|
||||
|
||||
#ifdef CONFIG_KPROBES
|
||||
static inline int notify_page_fault(struct pt_regs *regs, int trap)
|
||||
@ -267,9 +267,11 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
|
||||
else
|
||||
printk(KERN_ALERT "Unable to handle kernel paging request at "
|
||||
"virtual address %016lx\n", address);
|
||||
die("Oops", regs, isr);
|
||||
if (die("Oops", regs, isr))
|
||||
regs = NULL;
|
||||
bust_spinlocks(0);
|
||||
do_exit(SIGKILL);
|
||||
if (regs)
|
||||
do_exit(SIGKILL);
|
||||
return;
|
||||
|
||||
out_of_memory:
|
||||
|
@ -523,7 +523,7 @@ static ssize_t sn2_ptc_proc_write(struct file *file, const char __user *user, si
|
||||
return count;
|
||||
}
|
||||
|
||||
static struct seq_operations sn2_ptc_seq_ops = {
|
||||
static const struct seq_operations sn2_ptc_seq_ops = {
|
||||
.start = sn2_ptc_seq_start,
|
||||
.next = sn2_ptc_seq_next,
|
||||
.stop = sn2_ptc_seq_stop,
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/nodemask.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
#include <asm/processor.h>
|
||||
#include <asm/topology.h>
|
||||
@ -50,7 +51,7 @@ static void *sn_hwperf_salheap = NULL;
|
||||
static int sn_hwperf_obj_cnt = 0;
|
||||
static nasid_t sn_hwperf_master_nasid = INVALID_NASID;
|
||||
static int sn_hwperf_init(void);
|
||||
static DECLARE_MUTEX(sn_hwperf_init_mutex);
|
||||
static DEFINE_MUTEX(sn_hwperf_init_mutex);
|
||||
|
||||
#define cnode_possible(n) ((n) < num_cnodes)
|
||||
|
||||
@ -577,7 +578,7 @@ static void sn_topology_stop(struct seq_file *m, void *v)
|
||||
/*
|
||||
* /proc/sgi_sn/sn_topology, read-only using seq_file
|
||||
*/
|
||||
static struct seq_operations sn_topology_seq_ops = {
|
||||
static const struct seq_operations sn_topology_seq_ops = {
|
||||
.start = sn_topology_start,
|
||||
.next = sn_topology_next,
|
||||
.stop = sn_topology_stop,
|
||||
@ -884,10 +885,10 @@ static int sn_hwperf_init(void)
|
||||
int e = 0;
|
||||
|
||||
/* single threaded, once-only initialization */
|
||||
down(&sn_hwperf_init_mutex);
|
||||
mutex_lock(&sn_hwperf_init_mutex);
|
||||
|
||||
if (sn_hwperf_salheap) {
|
||||
up(&sn_hwperf_init_mutex);
|
||||
mutex_unlock(&sn_hwperf_init_mutex);
|
||||
return e;
|
||||
}
|
||||
|
||||
@ -936,7 +937,7 @@ static int sn_hwperf_init(void)
|
||||
sn_hwperf_salheap = NULL;
|
||||
sn_hwperf_obj_cnt = 0;
|
||||
}
|
||||
up(&sn_hwperf_init_mutex);
|
||||
mutex_unlock(&sn_hwperf_init_mutex);
|
||||
return e;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ static int puts(const char *s)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_OPSPUT)
|
||||
#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_OPSPUT)
|
||||
#include <asm/m32r.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
@ -52,7 +52,7 @@ static void putc(char c)
|
||||
}
|
||||
*BOOT_SIO0TXB = c;
|
||||
}
|
||||
#else /* !(CONFIG_PLAT_M32700UT_Alpha) && !(CONFIG_PLAT_M32700UT) */
|
||||
#else /* !(CONFIG_PLAT_M32700UT) */
|
||||
#if defined(CONFIG_PLAT_MAPPI2)
|
||||
#define SIO0STS (volatile unsigned short *)(0xa0efd000 + 14)
|
||||
#define SIO0TXB (volatile unsigned short *)(0xa0efd000 + 30)
|
||||
|
@ -321,6 +321,6 @@ ENTRY(sys_call_table)
|
||||
.long sys_epoll_pwait
|
||||
.long sys_utimensat /* 320 */
|
||||
.long sys_signalfd
|
||||
.long sys_timerfd
|
||||
.long sys_ni_syscall
|
||||
.long sys_eventfd
|
||||
.long sys_fallocate
|
||||
|
@ -577,20 +577,6 @@ config MAC_HID
|
||||
depends on INPUT_ADBHID
|
||||
default y
|
||||
|
||||
config MAC_ADBKEYCODES
|
||||
bool "Support for ADB raw keycodes"
|
||||
depends on INPUT_ADBHID
|
||||
help
|
||||
This provides support for sending raw ADB keycodes to console
|
||||
devices. This is the default up to 2.4.0, but in future this may be
|
||||
phased out in favor of generic Linux keycodes. If you say Y here,
|
||||
you can dynamically switch via the
|
||||
/proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
|
||||
sysctl and with the "keyboard_sends_linux_keycodes=" kernel
|
||||
argument.
|
||||
|
||||
If unsure, say Y here.
|
||||
|
||||
config ADB_KEYBOARD
|
||||
bool "Support for ADB keyboard (old driver)"
|
||||
depends on MAC && !INPUT_ADBHID
|
||||
|
@ -13,16 +13,15 @@
|
||||
# Copyright (C) 1994 by Hamish Macdonald
|
||||
#
|
||||
|
||||
# test for cross compiling
|
||||
COMPILE_ARCH = $(shell uname -m)
|
||||
|
||||
# override top level makefile
|
||||
AS += -m68020
|
||||
LDFLAGS := -m m68kelf
|
||||
LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
|
||||
ifneq ($(COMPILE_ARCH),$(ARCH))
|
||||
# prefix for cross-compiling binaries
|
||||
CROSS_COMPILE = m68k-linux-gnu-
|
||||
ifneq ($(SUBARCH),$(ARCH))
|
||||
ifeq ($(CROSS_COMPILE),)
|
||||
CROSS_COMPILE := $(call cc-cross-prefix, \
|
||||
m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_SUN3
|
||||
|
@ -2,6 +2,6 @@
|
||||
# Makefile for Linux arch/m68k/amiga source directory
|
||||
#
|
||||
|
||||
obj-y := config.o amiints.o cia.o chipram.o amisound.o amiga_ksyms.o
|
||||
obj-y := config.o amiints.o cia.o chipram.o amisound.o
|
||||
|
||||
obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o
|
||||
|
@ -1,33 +0,0 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/types.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/amigahw.h>
|
||||
#include <asm/amigaints.h>
|
||||
#include <asm/amipcmcia.h>
|
||||
|
||||
extern volatile u_short amiga_audio_min_period;
|
||||
extern u_short amiga_audio_period;
|
||||
|
||||
/*
|
||||
* Add things here when you find the need for it.
|
||||
*/
|
||||
EXPORT_SYMBOL(amiga_model);
|
||||
EXPORT_SYMBOL(amiga_chipset);
|
||||
EXPORT_SYMBOL(amiga_hw_present);
|
||||
EXPORT_SYMBOL(amiga_eclock);
|
||||
EXPORT_SYMBOL(amiga_colorclock);
|
||||
EXPORT_SYMBOL(amiga_chip_alloc);
|
||||
EXPORT_SYMBOL(amiga_chip_free);
|
||||
EXPORT_SYMBOL(amiga_chip_avail);
|
||||
EXPORT_SYMBOL(amiga_chip_size);
|
||||
EXPORT_SYMBOL(amiga_audio_period);
|
||||
EXPORT_SYMBOL(amiga_audio_min_period);
|
||||
|
||||
#ifdef CONFIG_AMIGA_PCMCIA
|
||||
EXPORT_SYMBOL(pcmcia_reset);
|
||||
EXPORT_SYMBOL(pcmcia_copy_tuple);
|
||||
EXPORT_SYMBOL(pcmcia_program_voltage);
|
||||
EXPORT_SYMBOL(pcmcia_access_speed);
|
||||
EXPORT_SYMBOL(pcmcia_write_enable);
|
||||
EXPORT_SYMBOL(pcmcia_write_disable);
|
||||
#endif
|
@ -12,6 +12,7 @@
|
||||
#include <linux/timer.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/system.h>
|
||||
#include <asm/amigahw.h>
|
||||
@ -21,7 +22,7 @@ static const signed char sine_data[] = {
|
||||
0, 39, 75, 103, 121, 127, 121, 103, 75, 39,
|
||||
0, -39, -75, -103, -121, -127, -121, -103, -75, -39
|
||||
};
|
||||
#define DATA_SIZE (sizeof(sine_data)/sizeof(sine_data[0]))
|
||||
#define DATA_SIZE ARRAY_SIZE(sine_data)
|
||||
|
||||
#define custom amiga_custom
|
||||
|
||||
@ -31,6 +32,7 @@ static const signed char sine_data[] = {
|
||||
*/
|
||||
|
||||
volatile unsigned short amiga_audio_min_period = 124; /* Default for pre-OCS */
|
||||
EXPORT_SYMBOL(amiga_audio_min_period);
|
||||
|
||||
#define MAX_PERIOD (65535)
|
||||
|
||||
@ -40,6 +42,7 @@ volatile unsigned short amiga_audio_min_period = 124; /* Default for pre-OCS */
|
||||
*/
|
||||
|
||||
unsigned short amiga_audio_period = MAX_PERIOD;
|
||||
EXPORT_SYMBOL(amiga_audio_period);
|
||||
|
||||
static unsigned long clock_constant;
|
||||
|
||||
|
@ -13,10 +13,13 @@
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/page.h>
|
||||
#include <asm/amigahw.h>
|
||||
|
||||
unsigned long amiga_chip_size;
|
||||
EXPORT_SYMBOL(amiga_chip_size);
|
||||
|
||||
static struct resource chipram_res = {
|
||||
.name = "Chip RAM", .start = CHIP_PHYSADDR
|
||||
@ -67,6 +70,7 @@ void *amiga_chip_alloc(unsigned long size, const char *name)
|
||||
#endif
|
||||
return (void *)ZTWO_VADDR(res->start);
|
||||
}
|
||||
EXPORT_SYMBOL(amiga_chip_alloc);
|
||||
|
||||
|
||||
/*
|
||||
@ -120,6 +124,7 @@ void amiga_chip_free(void *ptr)
|
||||
}
|
||||
printk("amiga_chip_free: trying to free nonexistent region at %p\n", ptr);
|
||||
}
|
||||
EXPORT_SYMBOL(amiga_chip_free);
|
||||
|
||||
|
||||
unsigned long amiga_chip_avail(void)
|
||||
@ -129,3 +134,5 @@ unsigned long amiga_chip_avail(void)
|
||||
#endif
|
||||
return chipavail;
|
||||
}
|
||||
EXPORT_SYMBOL(amiga_chip_avail);
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/zorro.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/setup.h>
|
||||
@ -36,13 +37,24 @@
|
||||
#include <asm/io.h>
|
||||
|
||||
unsigned long amiga_model;
|
||||
EXPORT_SYMBOL(amiga_model);
|
||||
|
||||
unsigned long amiga_eclock;
|
||||
EXPORT_SYMBOL(amiga_eclock);
|
||||
|
||||
unsigned long amiga_masterclock;
|
||||
|
||||
unsigned long amiga_colorclock;
|
||||
EXPORT_SYMBOL(amiga_colorclock);
|
||||
|
||||
unsigned long amiga_chipset;
|
||||
EXPORT_SYMBOL(amiga_chipset);
|
||||
|
||||
unsigned char amiga_vblank;
|
||||
unsigned char amiga_psfreq;
|
||||
|
||||
struct amiga_hw_present amiga_hw_present;
|
||||
EXPORT_SYMBOL(amiga_hw_present);
|
||||
|
||||
static char s_a500[] __initdata = "A500";
|
||||
static char s_a500p[] __initdata = "A500+";
|
||||
|
@ -15,6 +15,8 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/amigayle.h>
|
||||
#include <asm/amipcmcia.h>
|
||||
|
||||
@ -30,6 +32,7 @@ void pcmcia_reset(void)
|
||||
while (time_before(jiffies, reset_start_time + 1*HZ/100));
|
||||
b = gayle_reset;
|
||||
}
|
||||
EXPORT_SYMBOL(pcmcia_reset);
|
||||
|
||||
|
||||
/* copy a tuple, including tuple header. return nb bytes copied */
|
||||
@ -61,6 +64,7 @@ int pcmcia_copy_tuple(unsigned char tuple_id, void *tuple, int max_len)
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(pcmcia_copy_tuple);
|
||||
|
||||
void pcmcia_program_voltage(int voltage)
|
||||
{
|
||||
@ -84,6 +88,7 @@ void pcmcia_program_voltage(int voltage)
|
||||
gayle.config = cfg_byte;
|
||||
|
||||
}
|
||||
EXPORT_SYMBOL(pcmcia_program_voltage);
|
||||
|
||||
void pcmcia_access_speed(int speed)
|
||||
{
|
||||
@ -101,13 +106,17 @@ void pcmcia_access_speed(int speed)
|
||||
cfg_byte = (cfg_byte & 0xf3) | s;
|
||||
gayle.config = cfg_byte;
|
||||
}
|
||||
EXPORT_SYMBOL(pcmcia_access_speed);
|
||||
|
||||
void pcmcia_write_enable(void)
|
||||
{
|
||||
gayle.cardstatus = GAYLE_CS_WR|GAYLE_CS_DA;
|
||||
}
|
||||
EXPORT_SYMBOL(pcmcia_write_enable);
|
||||
|
||||
void pcmcia_write_disable(void)
|
||||
{
|
||||
gayle.cardstatus = 0;
|
||||
}
|
||||
EXPORT_SYMBOL(pcmcia_write_disable);
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
obj-y := config.o time.o debug.o ataints.o stdma.o \
|
||||
atasound.o stram.o atari_ksyms.o
|
||||
atasound.o stram.o
|
||||
|
||||
ifeq ($(CONFIG_PCI),y)
|
||||
obj-$(CONFIG_HADES) += hades-pci.o
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <linux/kernel_stat.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/system.h>
|
||||
#include <asm/traps.h>
|
||||
@ -446,6 +447,7 @@ unsigned long atari_register_vme_int(void)
|
||||
free_vme_vec_bitmap |= 1 << i;
|
||||
return VME_SOURCE_BASE + i;
|
||||
}
|
||||
EXPORT_SYMBOL(atari_register_vme_int);
|
||||
|
||||
|
||||
void atari_unregister_vme_int(unsigned long irq)
|
||||
@ -455,5 +457,6 @@ void atari_unregister_vme_int(unsigned long irq)
|
||||
free_vme_vec_bitmap &= ~(1 << irq);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(atari_unregister_vme_int);
|
||||
|
||||
|
||||
|
@ -1,35 +0,0 @@
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/traps.h>
|
||||
#include <asm/atarihw.h>
|
||||
#include <asm/atariints.h>
|
||||
#include <asm/atarikb.h>
|
||||
#include <asm/atari_joystick.h>
|
||||
#include <asm/atari_stdma.h>
|
||||
#include <asm/atari_stram.h>
|
||||
|
||||
extern void atari_microwire_cmd( int cmd );
|
||||
extern int atari_MFP_init_done;
|
||||
extern int atari_SCC_init_done;
|
||||
extern int atari_SCC_reset_done;
|
||||
|
||||
EXPORT_SYMBOL(atari_mch_cookie);
|
||||
EXPORT_SYMBOL(atari_mch_type);
|
||||
EXPORT_SYMBOL(atari_hw_present);
|
||||
EXPORT_SYMBOL(atari_switches);
|
||||
EXPORT_SYMBOL(atari_dont_touch_floppy_select);
|
||||
EXPORT_SYMBOL(atari_register_vme_int);
|
||||
EXPORT_SYMBOL(atari_unregister_vme_int);
|
||||
EXPORT_SYMBOL(stdma_lock);
|
||||
EXPORT_SYMBOL(stdma_release);
|
||||
EXPORT_SYMBOL(stdma_others_waiting);
|
||||
EXPORT_SYMBOL(stdma_islocked);
|
||||
EXPORT_SYMBOL(atari_stram_alloc);
|
||||
EXPORT_SYMBOL(atari_stram_free);
|
||||
|
||||
EXPORT_SYMBOL(atari_MFP_init_done);
|
||||
EXPORT_SYMBOL(atari_SCC_init_done);
|
||||
EXPORT_SYMBOL(atari_SCC_reset_done);
|
||||
|
||||
EXPORT_SYMBOL(atari_microwire_cmd);
|
@ -22,6 +22,7 @@
|
||||
#include <linux/fcntl.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/atarihw.h>
|
||||
#include <asm/system.h>
|
||||
@ -43,6 +44,7 @@ void atari_microwire_cmd (int cmd)
|
||||
while( tt_microwire.mask != 0x7ff)
|
||||
;
|
||||
}
|
||||
EXPORT_SYMBOL(atari_microwire_cmd);
|
||||
|
||||
|
||||
/* PSG base frequency */
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/vt_kern.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/setup.h>
|
||||
@ -43,10 +44,20 @@
|
||||
#include <asm/io.h>
|
||||
|
||||
u_long atari_mch_cookie;
|
||||
EXPORT_SYMBOL(atari_mch_cookie);
|
||||
|
||||
u_long atari_mch_type;
|
||||
EXPORT_SYMBOL(atari_mch_type);
|
||||
|
||||
struct atari_hw_present atari_hw_present;
|
||||
EXPORT_SYMBOL(atari_hw_present);
|
||||
|
||||
u_long atari_switches;
|
||||
EXPORT_SYMBOL(atari_switches);
|
||||
|
||||
int atari_dont_touch_floppy_select;
|
||||
EXPORT_SYMBOL(atari_dont_touch_floppy_select);
|
||||
|
||||
int atari_rtc_year_offset;
|
||||
|
||||
/* local function prototypes */
|
||||
|
@ -15,17 +15,23 @@
|
||||
#include <linux/console.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/atarihw.h>
|
||||
#include <asm/atariints.h>
|
||||
|
||||
/* Flag that Modem1 port is already initialized and used */
|
||||
int atari_MFP_init_done;
|
||||
EXPORT_SYMBOL(atari_MFP_init_done);
|
||||
|
||||
/* Flag that Modem1 port is already initialized and used */
|
||||
int atari_SCC_init_done;
|
||||
EXPORT_SYMBOL(atari_SCC_init_done);
|
||||
|
||||
/* Can be set somewhere, if a SCC master reset has already be done and should
|
||||
* not be repeated; used by kgdb */
|
||||
int atari_SCC_reset_done;
|
||||
EXPORT_SYMBOL(atari_SCC_reset_done);
|
||||
|
||||
static struct console atari_console_driver = {
|
||||
.name = "debug",
|
||||
|
@ -376,8 +376,8 @@ struct pci_bus_info * __init init_hades_pci(void)
|
||||
*/
|
||||
|
||||
bus = kzalloc(sizeof(struct pci_bus_info), GFP_KERNEL);
|
||||
if (!bus)
|
||||
return NULL;
|
||||
if (unlikely(!bus))
|
||||
goto iounmap_base_virt;
|
||||
|
||||
/*
|
||||
* Claim resources. The m68k has no separate I/O space, both
|
||||
@ -385,43 +385,25 @@ struct pci_bus_info * __init init_hades_pci(void)
|
||||
* the I/O resources are requested in memory space as well.
|
||||
*/
|
||||
|
||||
if (request_resource(&iomem_resource, &config_space) != 0)
|
||||
{
|
||||
kfree(bus);
|
||||
return NULL;
|
||||
}
|
||||
if (unlikely(request_resource(&iomem_resource, &config_space) != 0))
|
||||
goto free_bus;
|
||||
|
||||
if (request_resource(&iomem_resource, &io_space) != 0)
|
||||
{
|
||||
release_resource(&config_space);
|
||||
kfree(bus);
|
||||
return NULL;
|
||||
}
|
||||
if (unlikely(request_resource(&iomem_resource, &io_space) != 0))
|
||||
goto release_config_space;
|
||||
|
||||
bus->mem_space.start = HADES_MEM_BASE;
|
||||
bus->mem_space.end = HADES_MEM_BASE + HADES_MEM_SIZE - 1;
|
||||
bus->mem_space.name = pci_mem_name;
|
||||
#if 1
|
||||
if (request_resource(&iomem_resource, &bus->mem_space) != 0)
|
||||
{
|
||||
release_resource(&io_space);
|
||||
release_resource(&config_space);
|
||||
kfree(bus);
|
||||
return NULL;
|
||||
}
|
||||
if (unlikely(request_resource(&iomem_resource, &bus->mem_space) != 0))
|
||||
goto release_io_space;
|
||||
#endif
|
||||
bus->io_space.start = pci_io_base_virt;
|
||||
bus->io_space.end = pci_io_base_virt + HADES_VIRT_IO_SIZE - 1;
|
||||
bus->io_space.name = pci_io_name;
|
||||
#if 1
|
||||
if (request_resource(&ioport_resource, &bus->io_space) != 0)
|
||||
{
|
||||
release_resource(&bus->mem_space);
|
||||
release_resource(&io_space);
|
||||
release_resource(&config_space);
|
||||
kfree(bus);
|
||||
return NULL;
|
||||
}
|
||||
if (unlikely(request_resource(&ioport_resource, &bus->io_space) != 0))
|
||||
goto release_bus_mem_space;
|
||||
#endif
|
||||
/*
|
||||
* Set hardware dependent functions.
|
||||
@ -438,5 +420,21 @@ struct pci_bus_info * __init init_hades_pci(void)
|
||||
tt_mfp.active_edge &= ~0x27;
|
||||
|
||||
return bus;
|
||||
|
||||
release_bus_mem_space:
|
||||
release_resource(&bus->mem_space);
|
||||
release_io_space:
|
||||
release_resource(&io_space);
|
||||
release_config_space:
|
||||
release_resource(&config_space);
|
||||
free_bus:
|
||||
kfree(bus);
|
||||
iounmap_base_virt:
|
||||
iounmap((void *)pci_io_base_virt);
|
||||
|
||||
for (i = 0; i < N_SLOTS; i++)
|
||||
iounmap((void *)pci_conf_base_virt[i]);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/atari_stdma.h>
|
||||
#include <asm/atariints.h>
|
||||
@ -91,6 +92,7 @@ void stdma_lock(irq_handler_t handler, void *data)
|
||||
stdma_isr_data = data;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
EXPORT_SYMBOL(stdma_lock);
|
||||
|
||||
|
||||
/*
|
||||
@ -117,6 +119,7 @@ void stdma_release(void)
|
||||
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
EXPORT_SYMBOL(stdma_release);
|
||||
|
||||
|
||||
/*
|
||||
@ -134,6 +137,7 @@ int stdma_others_waiting(void)
|
||||
{
|
||||
return waitqueue_active(&stdma_wait);
|
||||
}
|
||||
EXPORT_SYMBOL(stdma_others_waiting);
|
||||
|
||||
|
||||
/*
|
||||
@ -155,6 +159,7 @@ int stdma_islocked(void)
|
||||
{
|
||||
return stdma_locked;
|
||||
}
|
||||
EXPORT_SYMBOL(stdma_islocked);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <linux/bootmem.h>
|
||||
#include <linux/mount.h>
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/machdep.h>
|
||||
@ -208,6 +209,7 @@ void *atari_stram_alloc(long size, const char *owner)
|
||||
}
|
||||
return( addr );
|
||||
}
|
||||
EXPORT_SYMBOL(atari_stram_alloc);
|
||||
|
||||
void atari_stram_free( void *addr )
|
||||
|
||||
@ -237,6 +239,7 @@ void atari_stram_free( void *addr )
|
||||
printk( KERN_ERR "atari_stram_free: cannot free block at %p "
|
||||
"(called from %p)\n", addr, __builtin_return_address(0) );
|
||||
}
|
||||
EXPORT_SYMBOL(atari_stram_free);
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
@ -678,7 +678,6 @@ CONFIG_LOGO_MAC_CLUT224=y
|
||||
#
|
||||
CONFIG_MAC_SCC=y
|
||||
CONFIG_MAC_HID=y
|
||||
CONFIG_MAC_ADBKEYCODES=y
|
||||
CONFIG_SERIAL_CONSOLE=y
|
||||
|
||||
#
|
||||
|
@ -2,4 +2,4 @@
|
||||
# Makefile for Linux arch/m68k/hp300 source directory
|
||||
#
|
||||
|
||||
obj-y := ksyms.o config.o time.o reboot.o
|
||||
obj-y := config.o time.o reboot.o
|
||||
|
@ -1,9 +0,0 @@
|
||||
/*
|
||||
* linux/arch/m68k/hp300/ksyms.c
|
||||
*
|
||||
* Copyright (C) 1998 Philip Blundell <philb@gnu.org>
|
||||
*
|
||||
* This file contains the HP300-specific kernel symbols. None yet. :-)
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
@ -742,7 +742,7 @@ sys_call_table:
|
||||
.long sys_epoll_pwait /* 315 */
|
||||
.long sys_utimensat
|
||||
.long sys_signalfd
|
||||
.long sys_timerfd
|
||||
.long sys_ni_syscall
|
||||
.long sys_eventfd
|
||||
.long sys_fallocate /* 320 */
|
||||
|
||||
|
@ -3,4 +3,4 @@
|
||||
#
|
||||
|
||||
obj-y := config.o bootparse.o macints.o iop.o via.o oss.o psc.o \
|
||||
baboon.o macboing.o debug.o misc.o mac_ksyms.o
|
||||
baboon.o macboing.o debug.o misc.o
|
||||
|
@ -58,8 +58,6 @@ extern struct mem_info m68k_memory[NUM_MEMINFO];
|
||||
|
||||
extern struct mem_info m68k_ramdisk;
|
||||
|
||||
extern char m68k_command_line[CL_SIZE];
|
||||
|
||||
void *mac_env; /* Loaded by the boot asm */
|
||||
|
||||
/* The phys. video addr. - might be bogus on some machines */
|
||||
|
@ -1,8 +0,0 @@
|
||||
#include <linux/module.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/traps.h>
|
||||
|
||||
/* Says whether we're using A/UX interrupts or not */
|
||||
extern int via_alt_mapping;
|
||||
|
||||
EXPORT_SYMBOL(via_alt_mapping);
|
@ -28,6 +28,7 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/ide.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/macintosh.h>
|
||||
@ -41,7 +42,9 @@ volatile __u8 *via1, *via2;
|
||||
/* See note in mac_via.h about how this is possibly not useful */
|
||||
volatile long *via_memory_bogon=(long *)&via_memory_bogon;
|
||||
#endif
|
||||
int rbv_present, via_alt_mapping;
|
||||
int rbv_present;
|
||||
int via_alt_mapping;
|
||||
EXPORT_SYMBOL(via_alt_mapping);
|
||||
__u8 rbv_clear;
|
||||
|
||||
/*
|
||||
|
@ -2,4 +2,4 @@
|
||||
# Makefile for Linux arch/m68k/mvme16x source directory
|
||||
#
|
||||
|
||||
obj-y := config.o rtc.o mvme16x_ksyms.o
|
||||
obj-y := config.o rtc.o
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <linux/genhd.h>
|
||||
#include <linux/rtc.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/system.h>
|
||||
@ -58,6 +59,7 @@ static irq_handler_t tick_handler;
|
||||
|
||||
|
||||
unsigned short mvme16x_config;
|
||||
EXPORT_SYMBOL(mvme16x_config);
|
||||
|
||||
|
||||
int mvme16x_parse_bootinfo(const struct bi_record *bi)
|
||||
|
@ -1,6 +0,0 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/types.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/mvme16xhw.h>
|
||||
|
||||
EXPORT_SYMBOL(mvme16x_config);
|
@ -21,13 +21,6 @@ config BOOTPARAM_STRING
|
||||
default 'console=ttyS0,19200'
|
||||
depends on BOOTPARAM
|
||||
|
||||
config DUMPTOFLASH
|
||||
bool "Panic/Dump to FLASH"
|
||||
depends on COLDFIRE
|
||||
help
|
||||
Dump any panic of trap output into a flash memory segment
|
||||
for later analysis.
|
||||
|
||||
config NO_KERNEL_MSG
|
||||
bool "Suppress Kernel BUG Messages"
|
||||
help
|
||||
|
@ -597,7 +597,6 @@ CONFIG_MSDOS_PARTITION=y
|
||||
# CONFIG_FULLDEBUG is not set
|
||||
# CONFIG_HIGHPROFILE is not set
|
||||
# CONFIG_BOOTPARAM is not set
|
||||
# CONFIG_DUMPTOFLASH is not set
|
||||
# CONFIG_NO_KERNEL_MSG is not set
|
||||
# CONFIG_BDM_DISABLE is not set
|
||||
|
||||
|
@ -24,14 +24,6 @@ extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
|
||||
EXPORT_SYMBOL(__ioremap);
|
||||
EXPORT_SYMBOL(iounmap);
|
||||
EXPORT_SYMBOL(dump_fpu);
|
||||
EXPORT_SYMBOL(strnlen);
|
||||
EXPORT_SYMBOL(strrchr);
|
||||
EXPORT_SYMBOL(strstr);
|
||||
EXPORT_SYMBOL(strchr);
|
||||
EXPORT_SYMBOL(strcat);
|
||||
EXPORT_SYMBOL(strlen);
|
||||
EXPORT_SYMBOL(strcmp);
|
||||
EXPORT_SYMBOL(strncmp);
|
||||
|
||||
EXPORT_SYMBOL(ip_fast_csum);
|
||||
|
||||
@ -46,9 +38,6 @@ EXPORT_SYMBOL(csum_partial_copy_nocheck);
|
||||
it's OK to leave it out of version control. */
|
||||
EXPORT_SYMBOL(memcpy);
|
||||
EXPORT_SYMBOL(memset);
|
||||
EXPORT_SYMBOL(memcmp);
|
||||
EXPORT_SYMBOL(memscan);
|
||||
EXPORT_SYMBOL(memmove);
|
||||
|
||||
EXPORT_SYMBOL(__down_failed);
|
||||
EXPORT_SYMBOL(__down_failed_interruptible);
|
||||
|
@ -64,9 +64,6 @@ void (*mach_power_off)(void);
|
||||
#ifdef CONFIG_M68VZ328
|
||||
#define CPU "MC68VZ328"
|
||||
#endif
|
||||
#ifdef CONFIG_M68332
|
||||
#define CPU "MC68332"
|
||||
#endif
|
||||
#ifdef CONFIG_M68360
|
||||
#define CPU "MC68360"
|
||||
#endif
|
||||
|
@ -336,7 +336,7 @@ ENTRY(sys_call_table)
|
||||
.long sys_epoll_pwait /* 315 */
|
||||
.long sys_utimensat
|
||||
.long sys_signalfd
|
||||
.long sys_timerfd
|
||||
.long sys_ni_syscall
|
||||
.long sys_eventfd
|
||||
.long sys_fallocate /* 320 */
|
||||
|
||||
|
@ -660,7 +660,7 @@ einval: li v0, -EINVAL
|
||||
sys sys_ioprio_get 2 /* 4315 */
|
||||
sys sys_utimensat 4
|
||||
sys sys_signalfd 3
|
||||
sys sys_timerfd 4
|
||||
sys sys_ni_syscall 0
|
||||
sys sys_eventfd 1
|
||||
sys sys_fallocate 6 /* 4320 */
|
||||
.endm
|
||||
|
@ -475,7 +475,7 @@ sys_call_table:
|
||||
PTR sys_ioprio_get
|
||||
PTR sys_utimensat /* 5275 */
|
||||
PTR sys_signalfd
|
||||
PTR sys_timerfd
|
||||
PTR sys_ni_syscall
|
||||
PTR sys_eventfd
|
||||
PTR sys_fallocate
|
||||
.size sys_call_table,.-sys_call_table
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user