Commit d6162f7e authored by Paul Mackerras's avatar Paul Mackerras

Merge samba.org:/home/paulus/kernel/linux-2.5

into samba.org:/home/paulus/kernel/for-linus-ppc
parents d0229603 ba3f8ae2
......@@ -1055,10 +1055,8 @@
Another common problem is deleting timers which restart
themselves (by calling <function>add_timer()</function> at the end
of their timer function). Because this is a fairly common case
which is prone to races, you can put a call to
<function>timer_exit()</function> at the very end of your timer function,
and user <function>del_timer_sync()</function>
(<filename class=headerfile>include/linux/timer.h</filename>)
which is prone to races, you should use <function>del_timer_sync()</function>
(<filename class=headerfile>include/linux/timer.h</filename>)
to handle this case. It returns the number of times the timer
had to be deleted before we finally stopped it from adding itself back
in.
......
......@@ -1175,7 +1175,7 @@ ide_map_buffer.
8.12. Multiple block-size transfers for faster raw i/o (Shailabh Nagar,
Badari)
8.13 Priority based i/o scheduler - prepatches (Arjan van de Ven)
8.14 IDE Taskfile i/o patch (Andre Hedrik)
8.14 IDE Taskfile i/o patch (Andre Hedrick)
8.15 Multi-page writeout and readahead patches (Andrew Morton)
8.16 Direct i/o patches for 2.5 using kvec and bio (Badari Pulavarthy)
......
......@@ -41,6 +41,7 @@ ldd
Debugging modules
The proc file system
Starting points for debugging scripting languages etc.
Dumptool & Lcrash
SysRq
References
Special Thanks
......@@ -237,10 +238,9 @@ they go to 64 Bit.
On 390 our limitations & strengths make us slightly different.
For backward compatibility ( because of the psw address hi bit which
indicates whether we are in 31 or 64 bit mode ) we are only allowed
use 31 bits (2GB) of our 32 bit addresses. However,
we use entirely separate address spaces for the user & kernel.
For backward compatibility we are only allowed use 31 bits (2GB)
of our 32 bit addresses,however, we use entirely separate address
spaces for the user & kernel.
This means we can support 2GB of non Extended RAM on s/390, & more
with the Extended memory managment swap device &
......@@ -1288,14 +1288,10 @@ this can make debugging a particular process under VM painful under normal
circumstances as the process may change when doing a
TR I R <address range>.
Thankfully after reading VM's online help I figured out how to debug
particular processes in 31 bit mode, however, according to the current
VM online help documentation the method described below uses
TR STO or STD which don't currently work on z/Series while in
64-bit mode.
I particular process.
Your first problem is to find the STD ( segment table designation )
of the program you wish to debug.
There are several ways you can do this here are a few
1) objdump --syms <program to be debugged> | grep main
To get the address of main in the program.
......@@ -1475,12 +1471,6 @@ Now display what gpr2 is pointing to
D 00014CB4.20
V00014CB4 2F646576 2F636F6E 736F6C65 00001BF5
V00014CC4 FC00014C B4001001 E0001000 B8070707
Alternatively you can do the more elegant
D 0.20;BASE2
BASE2 telling VM to use GPR2 as the base register.
Now copy the text till the first 00 hex ( which is the end of the string
to an xterm & do hex2ascii on it.
hex2ascii 2F646576 2F636F6E 736F6C65 00
......@@ -1517,7 +1507,7 @@ int main(int argc,char *argv[])
c=c-'0';
if(c>='A'&&c<='F')
c=c-'A'+10;
if(c>='a'&&c<='F')
if(c>='a'&&c<='f')
c=c-'a'+10;
switch(toggle)
{
......@@ -2131,12 +2121,6 @@ now do
p/x (*(**$sp+56))&0x7fffffff
& so on.
Another good trick to look at addresses on the stack if you've somehow lost
the backchain is.
x/500xa $sp
This displays anything the name of any known functions above the stack pointer
for 500 bytes.
Disassembling instructions without debug info
---------------------------------------------
gdb typically compains if there is a lack of debugging
......@@ -2472,12 +2456,48 @@ jdb <filename> another fully interactive gdb style debugger.
Dumptool & Lcrash ( lkcd )
==========================
Michael Holzheu & others here at IBM have a fairly mature port of
SGI's lcrash tool which allows one to look at kernel structures in a
running kernel.
It also complements a tool called dumptool which dumps all the kernels
memory pages & registers to either a tape or a disk.
This can be used by tech support or an ambitous end user do
post mortem debugging of a machine like gdb core dumps.
Going into how to use this tool in detail will be explained
in other documentation supplied by IBM with the patches & the
lcrash homepage http://oss.sgi.com/projects/lkcd/ & the lcrash manpage.
How they work
-------------
Lcrash is a perfectly normal program,however, it requires 2
additional files, Kerntypes which is built using a patch to the
linux kernel sources in the linux root directory & the System.map.
Kerntypes is an an objectfile whose sole purpose in life
is to provide stabs debug info to lcrash, to do this
Kerntypes is built from kerntypes.c which just includes the most commonly
referenced header files used when debugging, lcrash can then read the
.stabs section of this file.
Debugging a live system it uses /dev/mem
alternatively for post mortem debugging it uses the data
collected by dumptool.
SysRq
=====
This is now supported by linux for s/390 & z/Architecture.
To enable it do compile the kernel with
Kernel Hacking -> Magic SysRq Key Enabled
echo "1" > /proc/sys/kernel/sysrq.
echo "1" > /proc/sys/kernel/sysrq
also type
echo "8" >/proc/sys/kernel/printk
To make printk output go to console.
On 390 all commands are prefixed with
^-
e.g.
......@@ -2513,4 +2533,4 @@ Special Thanks
Special thanks to Neale Ferguson who maintains a much
prettier HTML version of this page at
http://penguinvm.princeton.edu/notes.html#Debug390
Bob Grainger Stefan Bader & others for reporting bugs
This diff is collapsed.
This diff is collapsed.
S/390 driver model interfaces
-----------------------------
1. CCW devices
--------------
All devices which can be addressed by means of ccws are called 'CCW devices' -
even if they aren't actually driven by ccws.
All ccw devices are accessed via a subchannel, this is reflected in the
structures under root/:
root/
- sys
- legacy
- css0/
- 0:0000/0:0815/
- 0:0001/0:4711/
- 0:0002/
...
In this example, device 0815 is accessed via subchannel 0, device 4711 via
subchannel 1, and subchannel 2 is a non-I/O subchannel.
You should address a ccw device via its bus id (e.g. 0:4711); the device can
be found under bus/ccw/devices/.
All ccw devices export some data via sysfs additional to the standard 'name'
and 'power' entries.
cutype: The control unit type / model.
devtype: The device type / model, if applicable.
online: An interface to set the device online and offline.
The device drivers can add entries to export per-device data and interfaces.
There is also some data exported on a per-subchannel basis (see under
bus/css/devices/):
chpids: Via which chpids the device is connected.
pimpampom: The path installed, path available and path operational masks.
There also might be additional data, for example for block devices.
1.1 Bringing up a ccw device
----------------------------
This is done in several steps.
a. Some drivers need several ccw devices to make up one device. This drivers
provide a 'chaining' interface (driver dependend) which allows to specify
which ccw devices form a device.
b. Each driver provides one or more parameter interfaces where parameters can
be specified. These interfaces are also in the driver's responsibility.
c. After a. and b. have been performed, if neccessary, the device is finally
brought up via the 'online' interface.
1.2 Writing a driver for ccw devices
------------------------------------
The basic struct ccw_device and struct ccw_driver data structures can be found
under include/asm/ccwdev.h.
struct ccw_device {
spinlock_t *ccwlock;
struct ccw_device_private *private;
struct ccw_device_id id;
struct ccw_driver *drv;
struct device dev;
int online;
void (*handler) (struct ccw_device *dev, unsigned long intparm,
struct irb *irb);
};
struct ccw_driver {
struct module *owner;
struct ccw_device_id *ids;
int (*probe) (struct ccw_device *);
int (*remove) (struct ccw_device *);
void (*release) (struct ccw_driver *);
int (*set_online) (struct ccw_device *);
int (*set_offline) (struct ccw_device *);
struct device_driver driver;
char *name;
};
The 'private' field contains data needed for internal i/o operation only, and
is not available to the device driver.
Each driver should declare in a MODULE_DEVICE_TABLE into which CU types/models
and/or device types/models it is interested. This information can later be found
found in the struct ccw_device_id fields:
struct ccw_device_id {
__u16 match_flags;
__u16 cu_type;
__u16 dev_type;
__u8 cu_model;
__u8 dev_model;
unsigned long driver_info;
};
The functions in ccw_driver should be used in the following way:
probe: This function is called by the device layer for each device the driver
is interested in. The driver should only allocate private structures
to put in dev->driver_data and create attributes (if needed). Also,
the interrupt handler (see below) should be set here.
int (*probe) (struct ccw_device *cdev);
Parameters: cdev - the device to be probed.
remove: This function is called by the device layer upon removal of the driver,
the device or the module. The driver should perform cleanups here.
int (*remove) (struct ccw_device *cdev);
Parameters: cdev - the device to be removed.
set_online: This function is called by the common I/O layer when the device is
activated via the 'online' attribute. The driver should finally
setup and activate the device here.
int (*set_online) (struct ccw_device *);
Parameters: cdev - the device to be activated. The common layer has
verified that the device is not already online.
set_offline: This function is called by the common I/O layer when the device is
de-activated via the 'online' attribute. The driver should shut
down the device, but not de-allocate its private data.
int (*set_offline) (struct ccw_device *);
Parameters: cdev - the device to be deactivated. The common layer has
verified that the device is online.
The handler field of the struct ccw_device is meant to be set to the interrupt
handler for the device. In order to accomodate drivers which use several
distinct handlers (e.g. multi subchannel devices), this is a member of ccw_device
instead of ccw_driver.
The handler is registered with the common layer during set_online() processing
before the driver is called, and is deregistered during set_offline() after the
driver has been called. Also, after registering / before deregistering, path
grouping resp. disbanding of the path group (if applicable) are performed.
void (*handler) (struct ccw_device *dev, unsigned long intparm, struct irb *irb);
Parameters: dev - the device the handler is called for
intparm - the intparm which allows the device driver to identify
the i/o the interrupt is associated with, or to recognize
the interrupt as unsolicited.
irb - interruption response block which contains the accumulated
status.
The device driver is called from the common ccw_device layer and can retrieve
information about the interrupt from the irb parameter.
2. System devices
-----------------
2.1 Channel paths
-----------------
Every channel path is represented under sys/ as channel_path<nr>. (Unfortunately,
<nr> is in decimal, which may look unfamiliar.)
status - Can be 'online', 'logically offline' or 'n/a'.
Piping 'on' or 'off' sets the chpid logically online/offline.
2.2 xpram
---------
xpram shows up under sys/ as 'xpram'.
3. 'Legacy' devices
-------------------
The 'legacy' bus is for devices not detected, but specified by the user.
3.1 Netiucv
-----------
Netiucv connections show up under legacy/ as "netiucv<ifnum>". The interface
number is assigned sequentially at module load.
user - the user the connection goes to.
buffer - maximum buffer size.
Pipe to it to change buffer size.
......@@ -789,8 +789,6 @@ endmenu
menu "Power management options (ACPI, APM)"
source "drivers/acpi/Kconfig"
config PM
bool "Power Management support"
---help---
......@@ -811,6 +809,37 @@ config PM
will issue the hlt instruction if nothing is to be done, thereby
sending the processor to sleep and saving power.
config SOFTWARE_SUSPEND
bool "Software Suspend (EXPERIMENTAL)"
depends on EXPERIMENTAL && PM
---help---
Enable the possibilty of suspendig machine. It doesn't need APM.
You may suspend your machine by 'swsusp' or 'shutdown -z <time>'
(patch for sysvinit needed).
It creates an image which is saved in your active swaps. By the next
booting the, pass 'resume=/path/to/your/swap/file' and kernel will
detect the saved image, restore the memory from
it and then it continues to run as before you've suspended.
If you don't want the previous state to continue use the 'noresume'
kernel option. However note that your partitions will be fsck'd and
you must re-mkswap your swap partitions/files.
Right now you may boot without resuming and then later resume but
in meantime you cannot use those swap partitions/files which were
involved in suspending. Also in this case there is a risk that buffers
on disk won't match with saved ones.
SMP is supported ``as-is''. There's a code for it but doesn't work.
There have been problems reported relating SCSI.
This option is about getting stable. However there is still some
absence of features.
For more information take a look at Documentation/swsusp.txt.
source "drivers/acpi/Kconfig"
config APM
tristate "Advanced Power Management BIOS support"
depends on PM
......@@ -1516,35 +1545,6 @@ source "arch/i386/oprofile/Kconfig"
menu "Kernel hacking"
config SOFTWARE_SUSPEND
bool "Software Suspend (EXPERIMENTAL)"
depends on EXPERIMENTAL && PM
---help---
Enable the possibilty of suspendig machine. It doesn't need APM.
You may suspend your machine by 'swsusp' or 'shutdown -z <time>'
(patch for sysvinit needed).
It creates an image which is saved in your active swaps. By the next
booting the, pass 'resume=/path/to/your/swap/file' and kernel will
detect the saved image, restore the memory from
it and then it continues to run as before you've suspended.
If you don't want the previous state to continue use the 'noresume'
kernel option. However note that your partitions will be fsck'd and
you must re-mkswap your swap partitions/files.
Right now you may boot without resuming and then later resume but
in meantime you cannot use those swap partitions/files which were
involved in suspending. Also in this case there is a risk that buffers
on disk won't match with saved ones.
SMP is supported ``as-is''. There's a code for it but doesn't work.
There have been problems reported relating SCSI.
This option is about getting stable. However there is still some
absence of features.
For more information take a look at Documentation/swsusp.txt.
config DEBUG_KERNEL
bool "Kernel debugging"
help
......
......@@ -446,72 +446,19 @@ acpi_boot_init (
#ifdef CONFIG_ACPI_SLEEP
#define DEBUG
#ifdef DEBUG
#include <linux/serial.h>
#endif
/* address in low memory of the wakeup routine. */
unsigned long acpi_wakeup_address = 0;
/* new page directory that we will be using */
static pmd_t *pmd;
/* saved page directory */
static pmd_t saved_pmd;
/* page which we'll use for the new page directory */
static pte_t *ptep;
extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
/*
* acpi_create_identity_pmd
*
* Create a new, identity mapped pmd.
*
* Do this by creating new page directory, and marking all the pages as R/W
* Then set it as the new Page Middle Directory.
* And, of course, flush the TLB so it takes effect.
*
* We save the address of the old one, for later restoration.
*/
static void acpi_create_identity_pmd (void)
static void init_low_mapping(pgd_t *pgd, int pgd_ofs, int pgd_limit)
{
pgd_t *pgd;
int i;
ptep = (pte_t*)__get_free_page(GFP_KERNEL);
/* fill page with low mapping */
for (i = 0; i < PTRS_PER_PTE; i++)
set_pte(ptep + i, pfn_pte(i, PAGE_SHARED));
int pgd_ofs = 0;
pgd = pgd_offset(current->active_mm, 0);
pmd = pmd_alloc(current->mm,pgd, 0);
/* save the old pmd */
saved_pmd = *pmd;
/* set the new one */
set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(ptep)));
/* flush the TLB */
local_flush_tlb();
}
/*
* acpi_restore_pmd
*
* Restore the old pmd saved by acpi_create_identity_pmd and
* free the page that said function alloc'd
*/
static void acpi_restore_pmd (void)
{
set_pmd(pmd, saved_pmd);
local_flush_tlb();
free_page((unsigned long)ptep);
while ((pgd_ofs < pgd_limit) && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) {
set_pgd(pgd, *(pgd+USER_PTRS_PER_PGD));
pgd_ofs++, pgd++;
}
}
/**
......@@ -522,7 +469,11 @@ static void acpi_restore_pmd (void)
*/
int acpi_save_state_mem (void)
{
acpi_create_identity_pmd();
#if CONFIG_X86_PAE
panic("S3 and PAE do not like each other for now.");
return 1;
#endif
init_low_mapping(swapper_pg_dir, 0, USER_PTRS_PER_PGD);
acpi_copy_wakeup_routine(acpi_wakeup_address);
return 0;
......@@ -542,7 +493,7 @@ int acpi_save_state_disk (void)
*/
void acpi_restore_state_mem (void)
{
acpi_restore_pmd();
zap_low_mappings();
}
/**
......@@ -555,7 +506,10 @@ void acpi_restore_state_mem (void)
*/
void __init acpi_reserve_bootmem(void)
{
extern char wakeup_start, wakeup_end;
acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE);
if ((&wakeup_end - &wakeup_start) > PAGE_SIZE)
printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address);
}
......
.text
#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/page.h>
# Do we need to deal with A20?
#
# wakeup_code runs in real mode, and at unknown address (determined at run-time).
# Therefore it must only use relative jumps/calls.
#
# Do we need to deal with A20? It is okay: ACPI specs says A20 must be enabled
#
# If physical address of wakeup_code is 0x12345, BIOS should call us with
# cs = 0x1234, eip = 0x05
#
ALIGN
wakeup_start:
.align 4096
ENTRY(wakeup_start)
wakeup_code:
wakeup_code_start = .
.code16
......@@ -14,49 +23,70 @@ wakeup_code:
movw $0xb800, %ax
movw %ax,%fs
movw $0x0e00 + 'L', %fs:(0x10)
cli
cld
# setup data segment
movw %cs, %ax
addw $(wakeup_data - wakeup_code) >> 4, %ax
movw %ax, %ds
movw %ax, %ds # Make ds:0 point to wakeup_start
movw %ax, %ss
mov $(wakeup_stack - wakeup_data), %sp # Private stack is needed for ASUS board
movw $0x0e00 + 'S', %fs:(0x12)
mov wakeup_stack - wakeup_code, %sp # Private stack is needed for ASUS board
movw $0x0e00 + 'S', %fs:(0x12)
movl real_magic - wakeup_data, %eax
pushl $0 # Kill any dangerous flags
popfl
movl real_magic - wakeup_code, %eax
cmpl $0x12345678, %eax
jne bogus_real_magic
mov video_mode - wakeup_data, %ax
#if 1
lcall $0xc000,$3
#endif
#if 0
mov video_mode - wakeup_code, %ax
call mode_set
#endif
# set up page table
movl (real_save_cr3 - wakeup_data), %eax
#if 1
movl $swapper_pg_dir-__PAGE_OFFSET, %eax
#else
movl (real_save_cr3 - wakeup_data), %eax
#endif
movl %eax, %cr3
# make sure %cr4 is set correctly (features, etc)
movl (real_save_cr4 - wakeup_data), %eax
movl real_save_cr4 - wakeup_code, %eax
movl %eax, %cr4
movw $0xb800, %ax
movw %ax,%fs
movw $0x0e00 + 'i', %fs:(0x12)
# need a gdt
lgdt real_save_gdt - wakeup_data
lgdt real_save_gdt - wakeup_code
movl (real_save_cr0 - wakeup_data), %eax
movl real_save_cr0 - wakeup_code, %eax
movl %eax, %cr0
jmp 1f
1:
movw $0x0e00 + 'n', %fs:(0x14)
movl real_magic - wakeup_data, %eax
movl real_magic - wakeup_code, %eax
cmpl $0x12345678, %eax
jne bogus_real_magic
ljmpl $__KERNEL_CS,$wakeup_pmode_return
real_save_gdt: .word 0
.long 0
real_save_cr0: .long 0
real_save_cr3: .long 0
real_save_cr4: .long 0
real_magic: .long 0
video_mode: .long 0
bogus_real_magic:
movw $0x0e00 + 'B', %fs:(0x12)
jmp bogus_real_magic
......@@ -129,20 +159,12 @@ _setbad: jmp setbad
.code32
ALIGN
.org 0x300
wakeup_data:
.word 0
real_save_gdt: .word 0
.long 0
real_save_cr0: .long 0
real_save_cr3: .long 0
real_save_cr4: .long 0
real_magic: .long 0
video_mode: .long 0
.org 0x500
.org 0x2000
wakeup_stack:
wakeup_end:
.org 0x3000
ENTRY(wakeup_end)
.org 0x4000
wakeup_pmode_return:
movl $__KERNEL_DS, %eax
......@@ -205,7 +227,6 @@ bogus_magic2:
movw $0x0e00 + '2', %ds:(0xb8018)
jmp bogus_magic2
##
# acpi_copy_wakeup_routine
#
......@@ -228,7 +249,7 @@ ENTRY(acpi_copy_wakeup_routine)
movl %eax, %edi
leal wakeup_start, %esi
movl $(wakeup_end - wakeup_start) >> 2, %ecx
movl $(wakeup_end - wakeup_start + 3) >> 2, %ecx
rep ; movsl
......@@ -290,8 +311,8 @@ ENTRY(do_suspend_lowlevel)
ret
.p2align 4,,7
.L1432:
movl $104,%eax
movw %eax, %ds
movl $__KERNEL_DS,%eax
movw %ax, %ds
movl saved_context_esp, %esp
movl saved_context_ebp, %ebp
movl saved_context_eax, %eax
......@@ -310,5 +331,4 @@ saved_gdt: .long 0,0
saved_idt: .long 0,0
saved_ldt: .long 0
saved_tss: .long 0
saved_cr0: .long 0
......@@ -3,8 +3,9 @@
#include <linux/string.h>
#include <linux/bitops.h>
#include <linux/smp.h>
#include <linux/thread_info.h>
#include <asm/processor.h>
#include <asm/thread_info.h>
#include <asm/msr.h>
#include <asm/uaccess.h>
......
......@@ -7,9 +7,10 @@
#include <linux/kernel.h>
#include <linux/config.h>
#include <linux/smp.h>
#include <linux/thread_info.h>
#include <asm/processor.h>
#include <asm/system.h>
#include <asm/thread_info.h>
#include "mce.h"
......
......@@ -698,10 +698,9 @@ edd_match_scsidev(struct edd_device *edev, struct scsi_device *sd)
static struct scsi_device *
edd_find_matching_scsi_device(struct edd_device *edev)
{
struct list_head *shost_node, *sdev_node;
struct list_head *sdev_node;
int rc = 1;
struct scsi_device *sd = NULL;
struct device *shost_dev, *sdev_dev;
struct pci_dev *pci_dev;
rc = edd_dev_is_type(edev, "SCSI");
......@@ -714,28 +713,18 @@ edd_find_matching_scsi_device(struct edd_device *edev)
get_device(&pci_dev->dev);
list_for_each(shost_node, &pci_dev->dev.children) {
shost_dev = children_to_dev(shost_node);
get_device(shost_dev);
list_for_each(sdev_node, &shost_dev->children) {
sdev_dev = children_to_dev(sdev_node);
get_device(sdev_dev);
sd = to_scsi_device(sdev_dev);
rc = edd_match_scsidev(edev, sd);
put_device(sdev_dev);
if (!rc)
break;
}
put_device(shost_dev);
list_for_each(sdev_node, &pci_dev->dev.children) {
struct device *sdev_dev = children_to_dev(sdev_node);
get_device(sdev_dev);
sd = to_scsi_device(sdev_dev);
rc = edd_match_scsidev(edev, sd);
put_device(sdev_dev);
if (!rc)
break;
}
put_device(&pci_dev->dev);
if (!rc)
return sd;
return NULL;
return rc ? NULL : sd;
}
static int
......
......@@ -484,7 +484,7 @@ ENTRY(spurious_interrupt_bug)
.data
ENTRY(sys_call_table)
.long sys_ni_syscall /* 0 - old "setup()" system call*/
.long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */
.long sys_exit
.long sys_fork
.long sys_read
......
/*
* linux/arch/i386/head.S -- the 32-bit startup code.
* linux/arch/i386/kernel/head.S -- the 32-bit startup code.
*
* Copyright (C) 1991, 1992 Linus Torvalds
*
......
......@@ -139,6 +139,7 @@ static int __init microcode_init(void)
&microcode_fops, NULL);
if (devfs_handle == NULL && error) {
printk(KERN_ERR "microcode: failed to devfs_register()\n");
misc_deregister(&microcode_dev);
goto out;
}
error = 0;
......
......@@ -506,6 +506,8 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset,
if (regs->orig_eax >= 0) {
/* If so, check system call restarting.. */
switch (regs->eax) {
case -ERESTART_RESTARTBLOCK:
current_thread_info()->restart_block.fn = do_no_restart_syscall;
case -ERESTARTNOHAND:
regs->eax = -EINTR;
break;
......@@ -591,6 +593,10 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
regs->eax = regs->orig_eax;
regs->eip -= 2;
}
if (regs->eax == -ERESTART_RESTARTBLOCK){
regs->eax = __NR_restart_syscall;
regs->eip -= 2;
}
}
return 0;
}
......
......@@ -125,10 +125,3 @@ void fix_processor_context(void)
}
}
#ifdef CONFIG_SOFTWARE_SUSPEND
/* Local variables for do_magic */
int loop __nosavedata = 0;
int loop2 __nosavedata = 0;
#endif
.text
/* Originally gcc generated, modified by hand */
#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/page.h>
......@@ -78,3 +81,11 @@ ENTRY(do_magic):
.L1449:
popl %ebx
ret
.section .data.nosave
loop:
.quad 0
loop2:
.quad 0
.previous
\ No newline at end of file
......@@ -299,7 +299,7 @@ static void __init pagetable_init (void)
#endif
}
void __init zap_low_mappings (void)
void zap_low_mappings (void)
{
int i;
/*
......
......@@ -13,7 +13,7 @@
#include <linux/smp.h>
#include <linux/oprofile.h>
#include <linux/pm.h>
#include <asm/thread_info.h>
#include <linux/thread_info.h>
#include <asm/nmi.h>
#include <asm/ptrace.h>
#include <asm/msr.h>
......
......@@ -42,7 +42,7 @@ MODEL := $(model-y)
#
# Some code support is grouped together for a common cpu-subclass (for
# example all ColdFire cpu's are very similar). Determine the sub-class
# for the selected cpu. ONLY need to define this for the non-core member
# for the selected cpu. ONLY need to define this for the non-base member
# of the family.
#
cpuclass-$(CONFIG_M5206) := 5307
......@@ -53,7 +53,10 @@ cpuclass-$(CONFIG_M5407) := 5307
cpuclass-$(CONFIG_M68EZ328) := 68328
cpuclass-$(CONFIG_M68VZ328) := 68328
CPUCLASS := $(cpuclass-y)
ifneq ($(CPUCLASS),)
CLASSDIR := arch/m68knommu/platform/$(cpuclass-y)/
endif
export PLATFORM BOARD MODEL CPUCLASS
......@@ -79,9 +82,11 @@ CFLAGS += -O2 -g
CFLAGS += -D__linux__
CFLAGS += -DUTS_SYSNAME=\"uClinux\"
LDFLAGS_BLOB := --format binary --oformat elf32-m68k
HEAD := arch/m68knommu/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o
clean-files := include/asm-$(ARCH)/asm-offsets.h.tmp \
CLEAN_FILES := include/asm-$(ARCH)/asm-offsets.h.tmp \
include/asm-$(ARCH)/asm-offsets.h \
arch/$(ARCH)/kernel/asm-offsets.s
......
......@@ -32,6 +32,9 @@ int main(void)
DEFINE(TASK_MM, offsetof(struct task_struct, mm));
DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
/* offsets into the kernel_stat struct */
DEFINE(STAT_IRQ, offsetof(struct kernel_stat, irqs));
/* offsets into the irq_cpustat_t struct */
DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t, __softirq_pending));
......
......@@ -21,7 +21,7 @@
#include <asm/current.h>
extern void dump_thread(struct pt_regs *, struct user *);
extern int dump_fpu(elf_fpregset_t *);
extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
/* platform dependent support */
......
......@@ -145,10 +145,10 @@ ENTRY(sys_call_table)
.long sys_adjtimex
.long sys_ni_syscall /* 125 */ /* sys_mprotect */
.long sys_sigprocmask
.long sys_create_module
.long sys_ni_syscall /* old "creat_module" */
.long sys_init_module
.long sys_delete_module
.long sys_get_kernel_syms /* 130 */
.long sys_ni_syscall /* 130: old "get_kernel_syms" */
.long sys_quotactl
.long sys_getpgid
.long sys_fchdir
......@@ -185,9 +185,9 @@ ENTRY(sys_call_table)
.long sys_setresuid16
.long sys_getresuid16 /* 165 */
.long sys_ni_syscall /* for vm86 */
.long sys_query_module
.long sys_ni_syscall /* old "query_module" */
.long sys_poll
.long sys_ni_syscall /*sys_nfsservctl*/
.long sys_ni_syscall /* sys_nfsservctl */
.long sys_setresgid16 /* 170 */
.long sys_getresgid16
.long sys_prctl
......@@ -236,7 +236,7 @@ ENTRY(sys_call_table)
.long sys_setfsuid /* 215 */
.long sys_setfsgid
.long sys_pivot_root
.long sys_mincore
.long sys_ni_syscall /* sys_mincore */
.long sys_ni_syscall /* sys_madvise */
.long sys_getdents64 /* 220 */
.long sys_fcntl64
......
......@@ -7,7 +7,7 @@ obj-$(CONFIG_M68EZ328) += entry.o ints.o
obj-$(CONFIG_M68VZ328) += entry.o ints.o
ifeq ($(CONFIG_M68328),y)
EXTRA_TARGETS := $(BOARD)/bootlogo.rh $(BOARD/crt0_$(MODEL).o
EXTRA_TARGETS := $(BOARD)/bootlogo.rh $(BOARD)/crt0_$(MODEL).o
endif
include $(TOPDIR)/Rules.make
......
......@@ -287,11 +287,15 @@ source "fs/Kconfig"
menu "Kernel hacking"
#if [ "$CONFIG_CTC" = "y" ]; then
# bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG
#fi
config DEBUG_KERNEL
bool "Kernel debugging"
help
Say Y here if you are developing drivers or trying to debug and
identify kernel problems.
config MAGIC_SYSRQ
bool "Magic SysRq key"
depends on DEBUG_KERNEL
help
If you say Y here, you will have some control over the system even
if the system crashes for example during kernel debugging (e.g., you
......@@ -303,6 +307,28 @@ config MAGIC_SYSRQ
keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
unless you really know what this hack does.
config DEBUG_SLAB
bool "Debug memory allocations"
depends on DEBUG_KERNEL
help
Say Y here to have the kernel do limited verification on memory
allocation as well as poisoning memory on free to catch use of freed
memory.
config KALLSYMS
bool "Load all symbols for debugging/kksymoops"
depends on DEBUG_KERNEL
help
Say Y here to let the kernel print out symbolic crash information and
symbolic stack backtraces. This increases the size of the kernel
somewhat, as all symbols have to be loaded into the kernel image.
config DEBUG_SPINLOCK_SLEEP
bool "Sleep-inside-spinlock checking"
help
If you say Y here, various routines which may sleep will become very
noisy if they are called with a spinlock held.
endmenu
source "security/Kconfig"
......
......@@ -11,7 +11,6 @@ CONFIG_ARCH_S390=y
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_CONFIDENTIAL=y
#
# General setup
......@@ -80,6 +79,7 @@ CONFIG_BLK_DEV_XPRAM=m
# S/390 block device drivers
#
CONFIG_DASD=y
# CONFIG_DASD_PROFILE is not set
CONFIG_DASD_ECKD=y
CONFIG_DASD_FBA=y
CONFIG_DASD_DIAG=y
......@@ -108,6 +108,7 @@ CONFIG_UNIX98_PTY_COUNT=2048
# CONFIG_TN3270 is not set
CONFIG_TN3215=y
CONFIG_TN3215_CONSOLE=y
CONFIG_CCW_CONSOLE=y
CONFIG_SCLP=y
CONFIG_SCLP_TTY=y
CONFIG_SCLP_CONSOLE=y
......@@ -143,6 +144,7 @@ CONFIG_HOTPLUG=y
CONFIG_LCS=m
CONFIG_CTC=m
CONFIG_IUCV=m
CONFIG_CCWGROUP=m
#
# Networking options
......@@ -296,18 +298,23 @@ CONFIG_IBM_PARTITION=y
#
# Kernel hacking
#
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=y
# CONFIG_DEBUG_SLAB is not set
# CONFIG_KALLSYMS is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
#
# Security options
#
CONFIG_SECURITY_CAPABILITIES=y
# CONFIG_SECURITY is not set
#
# Cryptographic options
#
CONFIG_CRYPTO=y
# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_SHA1 is not set
......
......@@ -654,8 +654,10 @@ void debug_set_level(debug_info_t* id, int new_level)
id->name, new_level, 0, DEBUG_MAX_LEVEL);
} else {
id->level = new_level;
#ifdef DEBUG
printk(KERN_INFO
"debug: %s: new level %i\n",id->name,id->level);
#endif
}
spin_unlock_irqrestore(&id->lock,flags);
}
......
......@@ -465,6 +465,18 @@ startup:basr %r13,0 # get base
# move IPL device to lowcore
mvc __LC_IPLDEV(4),IPL_DEVICE-PARMAREA(%r12)
#
# clear bss memory
#
l %r2,.Lbss_bgn-.LPG1(%r13) # start of bss
l %r3,.Lbss_end-.LPG1(%r13) # end of bss
sr %r3,%r2 # length of bss
sr %r4,%r4 #
sr %r5,%r5 # set src,length and pad to zero
sr %r0,%r0 #
mvcle %r2,%r4,0 # clear mem
jo .-4 # branch back, if not finish
#
# find memory chunks.
#
......@@ -579,6 +591,8 @@ startup:basr %r13,0 # get base
.Lmemsize:.long memory_size
.Lmchunk:.long memory_chunk
.Lmflags:.long machine_flags
.Lbss_bgn: .long __bss_start
.Lbss_end: .long _end
.org PARMAREA-64
.Lduct: .long 0,0,0,0,0,0,0,0
......@@ -620,17 +634,6 @@ _stext: basr %r13,0 # get base
ahi %r15,-96
xc 0(4,%r15),0(%r15) # set backchain to zero
#
# clear bss memory
#
l %r2,.Lbss_bgn-.LPG2(%r13) # start of bss
l %r3,.Lbss_end-.LPG2(%r13) # end of bss
sr %r3,%r2 # length of bss
sr %r4,%r4 #
sr %r5,%r5 # set src,length and pad to zero
sr %r0,%r0 #
mvcle %r2,%r4,0 # clear mem
jo .-4 # branch back, if not finish
# check control registers
stctl %c0,%c15,0(%r15)
oi 2(%r15),0x20 # enable sigp external interrupts
......@@ -651,7 +654,5 @@ _stext: basr %r13,0 # get base
.Ldw: .long 0x000a0000,0x00000000
.Linittu: .long init_thread_union
.Lstart: .long start_kernel
.Lbss_bgn: .long __bss_start
.Lbss_end: .long _end
.Laregs: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
......@@ -146,7 +146,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
regs.orig_gpr2 = -1;
/* Ok, create the new process.. */
p = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL);
p = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
......@@ -188,6 +188,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
frame = ((struct stack_frame *)
(THREAD_SIZE + (unsigned long) p->thread_info)) - 1;
p->thread.ksp = (unsigned long) frame;
p->set_child_tid = p->clear_child_tid = NULL;
frame->childregs = *regs;
frame->childregs.gprs[2] = 0; /* child returns 0 on fork. */
frame->childregs.gprs[15] = new_stackp;
......@@ -218,7 +219,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
asmlinkage int sys_fork(struct pt_regs regs)
{
struct task_struct *p;
p = do_fork(SIGCHLD, regs.gprs[15], &regs, 0, NULL);
p = do_fork(SIGCHLD, regs.gprs[15], &regs, 0, NULL, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
......@@ -227,14 +228,16 @@ asmlinkage int sys_clone(struct pt_regs regs)
unsigned long clone_flags;
unsigned long newsp;
struct task_struct *p;
int *user_tid;
int *parent_tidptr, *child_tidptr;
clone_flags = regs.gprs[3];
newsp = regs.orig_gpr2;
user_tid = (int *) regs.gprs[4];
parent_tidptr = (int *) regs.gprs[4];
child_tidptr = (int *) regs.gprs[5];
if (!newsp)
newsp = regs.gprs[15];
p = do_fork(clone_flags & ~CLONE_IDLETASK, newsp, &regs, 0, user_tid);
p = do_fork(clone_flags & ~CLONE_IDLETASK, newsp, &regs, 0,
parent_tidptr, child_tidptr);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
......@@ -252,7 +255,7 @@ asmlinkage int sys_vfork(struct pt_regs regs)
{
struct task_struct *p;
p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD,
regs.gprs[15], &regs, 0, NULL);
regs.gprs[15], &regs, 0, NULL, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
......
......@@ -30,6 +30,7 @@
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/user.h>
#include <linux/security.h>
#include <asm/segment.h>
#include <asm/page.h>
......
......@@ -47,6 +47,7 @@
*/
unsigned int console_mode = 0;
unsigned int console_device = -1;
unsigned int console_irq = -1;
unsigned long memory_size = 0;
unsigned long machine_flags = 0;
struct { unsigned long addr, size, type; } memory_chunk[16] = { { 0 } };
......@@ -187,6 +188,10 @@ static void __init conmode_default(void)
char *ptr;
if (MACHINE_IS_VM) {
cpcmd("QUERY CONSOLE", query_buffer, 1024);
console_device = simple_strtoul(query_buffer + 5, NULL, 16);
ptr = strstr(query_buffer, "SUBCHANNEL =");
console_irq = simple_strtoul(ptr + 13, NULL, 16);
cpcmd("QUERY TERM", query_buffer, 1024);
ptr = strstr(query_buffer, "CONMODE");
/*
......@@ -245,9 +250,13 @@ void (*_machine_power_off)(void) = machine_power_off_smp;
/*
* Reboot, halt and power_off routines for non SMP.
*/
extern void do_reipl(unsigned long devno);
static void do_machine_restart_nonsmp(char * __unused)
{
reipl(S390_lowcore.ipl_device);
if (MACHINE_IS_VM)
cpcmd ("IPL", NULL, 0);
else
do_reipl (0x10000 | S390_lowcore.ipl_device);
}
static void do_machine_halt_nonsmp(void)
......
......@@ -61,7 +61,7 @@ unsigned long cache_decay_ticks = 0;
extern char vmhalt_cmd[];
extern char vmpoff_cmd[];
extern void reipl(unsigned long devno);
extern void do_reipl(unsigned long devno);
static sigp_ccode smp_ext_bitcall(int, ec_bit_sig);
static void smp_ext_bitcall_others(ec_bit_sig);
......@@ -217,7 +217,10 @@ static void do_machine_restart(void * __unused)
* interrupted by an external interrupt and s390irq
* locks are always held disabled).
*/
reipl(S390_lowcore.ipl_device);
if (MACHINE_IS_VM)
cpcmd ("IPL", NULL, 0);
else
do_reipl (0x10000 | S390_lowcore.ipl_device);
}
signal_processor(smp_processor_id(), sigp_stop);
}
......@@ -477,7 +480,7 @@ static struct task_struct *__devinit fork_by_hand(void)
/* don't care about the psw and regs settings since we'll never
reschedule the forked task. */
memset(&regs,0,sizeof(struct pt_regs));
return do_fork(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL);
return do_fork(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL);
}
int __cpu_up(unsigned int cpu)
......
......@@ -296,11 +296,15 @@ source "fs/Kconfig"
menu "Kernel hacking"
#if [ "$CONFIG_CTC" = "y" ]; then
# bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG
#fi
config DEBUG_KERNEL
bool "Kernel debugging"
help
Say Y here if you are developing drivers or trying to debug and
identify kernel problems.
config MAGIC_SYSRQ
bool "Magic SysRq key"
depends on DEBUG_KERNEL
help
If you say Y here, you will have some control over the system even
if the system crashes for example during kernel debugging (e.g., you
......@@ -312,6 +316,28 @@ config MAGIC_SYSRQ
keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
unless you really know what this hack does.
config DEBUG_SLAB
bool "Debug memory allocations"
depends on DEBUG_KERNEL
help
Say Y here to have the kernel do limited verification on memory
allocation as well as poisoning memory on free to catch use of freed
memory.
config KALLSYMS
bool "Load all symbols for debugging/kksymoops"
depends on DEBUG_KERNEL
help
Say Y here to let the kernel print out symbolic crash information and
symbolic stack backtraces. This increases the size of the kernel
somewhat, as all symbols have to be loaded into the kernel image.
config DEBUG_SPINLOCK_SLEEP
bool "Sleep-inside-spinlock checking"
help
If you say Y here, various routines which may sleep will become very
noisy if they are called with a spinlock held.
endmenu
source "security/Kconfig"
......
......@@ -11,7 +11,6 @@ CONFIG_ARCH_S390X=y
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_CONFIDENTIAL=y
#
# General setup
......@@ -138,6 +137,7 @@ CONFIG_BLK_DEV_XPRAM=m
# S/390 block device drivers
#
CONFIG_DASD=y
# CONFIG_DASD_PROFILE is not set
CONFIG_DASD_ECKD=y
CONFIG_DASD_FBA=y
# CONFIG_DASD_DIAG is not set
......@@ -166,6 +166,7 @@ CONFIG_UNIX98_PTY_COUNT=2048
# CONFIG_TN3270 is not set
CONFIG_TN3215=y
CONFIG_TN3215_CONSOLE=y
CONFIG_CCW_CONSOLE=y
CONFIG_SCLP=y
CONFIG_SCLP_TTY=y
CONFIG_SCLP_CONSOLE=y
......@@ -201,6 +202,7 @@ CONFIG_HOTPLUG=y
CONFIG_LCS=m
CONFIG_CTC=m
CONFIG_IUCV=m
CONFIG_CCWGROUP=m
#
# Networking options
......@@ -357,18 +359,23 @@ CONFIG_IBM_PARTITION=y
#
# Kernel hacking
#
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=y
# CONFIG_DEBUG_SLAB is not set
# CONFIG_KALLSYMS is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
#
# Security options
#
CONFIG_SECURITY_CAPABILITIES=y
# CONFIG_SECURITY is not set
#
# Cryptographic options
#
CONFIG_CRYPTO=y
# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_SHA1 is not set
......
......@@ -654,8 +654,10 @@ void debug_set_level(debug_info_t* id, int new_level)
id->name, new_level, 0, DEBUG_MAX_LEVEL);
} else {
id->level = new_level;
#ifdef DEBUG
printk(KERN_INFO
"debug: %s: new level %i\n",id->name,id->level);
#endif
}
spin_unlock_irqrestore(&id->lock,flags);
}
......
......@@ -467,10 +467,21 @@ startup:basr %r13,0 # get base
larl %r12,_pstart # pointer to parameter area
# move IPL device to lowcore
mvc __LC_IPLDEV(4),IPL_DEVICE+4-PARMAREA(%r12)
#
# clear bss memory
#
larl %r2,__bss_start # start of bss segment
larl %r3,_end # end of bss segment
sgr %r3,%r2 # length of bss
sgr %r4,%r4 #
sgr %r5,%r5 # set src,length and pad to zero
mvcle %r2,%r4,0 # clear mem
jo .-4 # branch back, if not finish
# set program check new psw mask
mvc __LC_PGM_NEW_PSW(8),.Lpcmsk-.LPG1(%r13)
#
# find memory chunks.
#
......@@ -631,16 +642,7 @@ _stext: basr %r13,0 # get base
stg %r15,__LC_KERNEL_STACK # set end of kernel stack
aghi %r15,-160
xc 0(8,%r15),0(%r15) # set backchain to zero
#
# clear bss memory
#
larl %r2,__bss_start # start of bss segment
larl %r3,_end # end of bss segment
sgr %r3,%r2 # length of bss
sgr %r4,%r4 #
sgr %r5,%r5 # set src,length and pad to zero
mvcle %r2,%r4,0 # clear mem
jo .-4 # branch back, if not finish
# check control registers
stctg %c0,%c15,0(%r15)
oi 6(%r15),0x20 # enable sigp external interrupts
......
......@@ -143,7 +143,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
regs.orig_gpr2 = -1;
/* Ok, create the new process.. */
p = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL);
p = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
......@@ -185,6 +185,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
frame = ((struct stack_frame *)
(THREAD_SIZE + (unsigned long) p->thread_info)) - 1;
p->thread.ksp = (unsigned long) frame;
p->set_child_tid = p->clear_child_tid = NULL;
frame->childregs = *regs;
frame->childregs.gprs[2] = 0; /* child returns 0 on fork. */
frame->childregs.gprs[15] = new_stackp;
......@@ -208,7 +209,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
asmlinkage int sys_fork(struct pt_regs regs)
{
struct task_struct *p;
p = do_fork(SIGCHLD, regs.gprs[15], &regs, 0, NULL);
p = do_fork(SIGCHLD, regs.gprs[15], &regs, 0, NULL, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
......@@ -217,14 +218,16 @@ asmlinkage int sys_clone(struct pt_regs regs)
unsigned long clone_flags;
unsigned long newsp;
struct task_struct *p;
int *user_tid;
int *parent_tidptr, *child_tidptr;
clone_flags = regs.gprs[3];
newsp = regs.orig_gpr2;
user_tid = (int *) regs.gprs[4];
parent_tidptr = (int *) regs.gprs[4];
child_tidptr = (int *) regs.gprs[5];
if (!newsp)
newsp = regs.gprs[15];
p = do_fork(clone_flags & ~CLONE_IDLETASK, newsp, &regs, 0, user_tid);
p = do_fork(clone_flags & ~CLONE_IDLETASK, newsp, &regs, 0,
parent_tidptr, child_tidptr);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
......@@ -242,7 +245,7 @@ asmlinkage int sys_vfork(struct pt_regs regs)
{
struct task_struct *p;
p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD,
regs.gprs[15], &regs, 0, NULL);
regs.gprs[15], &regs, 0, NULL, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
......
......@@ -47,6 +47,7 @@
*/
unsigned int console_mode = 0;
unsigned int console_device = -1;
unsigned int console_irq = -1;
unsigned long memory_size = 0;
unsigned long machine_flags = 0;
struct { unsigned long addr, size, type; } memory_chunk[16] = { { 0 } };
......@@ -187,6 +188,10 @@ static void __init conmode_default(void)
char *ptr;
if (MACHINE_IS_VM) {
cpcmd("QUERY CONSOLE", query_buffer, 1024);
console_device = simple_strtoul(query_buffer + 5, NULL, 16);
ptr = strstr(query_buffer, "SUBCHANNEL =");
console_irq = simple_strtoul(ptr + 13, NULL, 16);
cpcmd("QUERY TERM", query_buffer, 1024);
ptr = strstr(query_buffer, "CONMODE");
/*
......@@ -245,9 +250,13 @@ void (*_machine_power_off)(void) = machine_power_off_smp;
/*
* Reboot, halt and power_off routines for non SMP.
*/
extern void do_reipl(unsigned long devno);
static void do_machine_restart_nonsmp(char * __unused)
{
reipl(S390_lowcore.ipl_device);
if (MACHINE_IS_VM)
cpcmd ("IPL", NULL, 0);
else
do_reipl (0x10000 | S390_lowcore.ipl_device);
}
static void do_machine_halt_nonsmp(void)
......
......@@ -60,7 +60,7 @@ unsigned long cache_decay_ticks = 0;
extern char vmhalt_cmd[];
extern char vmpoff_cmd[];
extern void reipl(unsigned long devno);
extern void do_reipl(unsigned long devno);
static sigp_ccode smp_ext_bitcall(int, ec_bit_sig);
static void smp_ext_bitcall_others(ec_bit_sig);
......@@ -216,7 +216,10 @@ static void do_machine_restart(void * __unused)
* interrupted by an external interrupt and s390irq
* locks are always held disabled).
*/
reipl(S390_lowcore.ipl_device);
if (MACHINE_IS_VM)
cpcmd ("IPL", NULL, 0);
else
do_reipl (0x10000 | S390_lowcore.ipl_device);
}
signal_processor(smp_processor_id(), sigp_stop);
}
......@@ -461,7 +464,7 @@ static struct task_struct * __devinit fork_by_hand(void)
/* don't care about the psw and regs settings since we'll never
reschedule the forked task. */
memset(&regs,0,sizeof(struct pt_regs));
return do_fork(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL);
return do_fork(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL);
}
int __cpu_up(unsigned int cpu)
......
......@@ -401,8 +401,8 @@ void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs)
printk("Expecting: ");
for (i = 0; i < 16; i++)
if (action->handler)
prom_printf("[%s:%d:0x%x] ", action->name,
(int) i, (unsigned int) action->handler);
printk("[%s:%d:0x%x] ", action->name,
(int) i, (unsigned int) action->handler);
}
printk("AIEEE\n");
panic("bogus interrupt received");
......
......@@ -38,7 +38,7 @@ void *kmap_atomic(struct page *page, enum km_type type)
return page_address(page);
idx = type + KM_TYPE_NR*smp_processor_id();
vaddr = FIX_KMAP_BEGIN + idx * PAGE_SIZE;
vaddr = fix_kmap_begin + idx * PAGE_SIZE;
/* XXX Fix - Anton */
#if 0
......@@ -67,12 +67,12 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
unsigned long vaddr = (unsigned long) kvaddr;
unsigned long idx = type + KM_TYPE_NR*smp_processor_id();
if (vaddr < FIX_KMAP_BEGIN) { // FIXME
if (vaddr < fix_kmap_begin) { // FIXME
dec_preempt_count();
return;
}
if (vaddr != FIX_KMAP_BEGIN + idx * PAGE_SIZE)
if (vaddr != fix_kmap_begin + idx * PAGE_SIZE)
BUG();
/* XXX Fix - Anton */
......
......@@ -59,13 +59,17 @@ unsigned long highstart_pfn, highend_pfn;
pte_t *kmap_pte;
pgprot_t kmap_prot;
/* These are set in {srmmu,sun4c}_paging_init() */
unsigned long fix_kmap_begin;
unsigned long fix_kmap_end;
#define kmap_get_fixed_pte(vaddr) \
pte_offset_kernel(pmd_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr))
void __init kmap_init(void)
{
/* cache the first kmap pte */
kmap_pte = kmap_get_fixed_pte(FIX_KMAP_BEGIN);
kmap_pte = kmap_get_fixed_pte(fix_kmap_begin);
kmap_prot = __pgprot(SRMMU_ET_PTE | SRMMU_PRIV | SRMMU_CACHE);
}
......
......@@ -136,8 +136,16 @@ static inline int srmmu_device_memory(unsigned long x)
int srmmu_cache_pagetables;
/* XXX Make this dynamic based on ram size - Anton */
#define SRMMU_NOCACHE_BITMAP_SIZE (SRMMU_NOCACHE_NPAGES * 16)
/* these will be initialized in srmmu_nocache_calcsize() */
int srmmu_nocache_npages;
unsigned long srmmu_nocache_size;
unsigned long srmmu_nocache_end;
unsigned long pkmap_base;
unsigned long pkmap_base_end;
unsigned long srmmu_nocache_bitmap_size;
extern unsigned long fix_kmap_begin;
extern unsigned long fix_kmap_end;
#define SRMMU_NOCACHE_BITMAP_SHIFT (PAGE_SHIFT - 4)
void *srmmu_nocache_pool;
......@@ -331,7 +339,7 @@ static unsigned long __srmmu_get_nocache(int size, int align)
spin_lock(&srmmu_nocache_spinlock);
repeat:
offset = find_next_zero_bit(srmmu_nocache_bitmap, SRMMU_NOCACHE_BITMAP_SIZE, offset);
offset = find_next_zero_bit(srmmu_nocache_bitmap, srmmu_nocache_bitmap_size, offset);
/* we align on physical address */
if (align) {
......@@ -341,7 +349,7 @@ static unsigned long __srmmu_get_nocache(int size, int align)
offset = (va_tmp - SRMMU_NOCACHE_VADDR) >> SRMMU_NOCACHE_BITMAP_SHIFT;
}
if ((SRMMU_NOCACHE_BITMAP_SIZE - offset) < size) {
if ((srmmu_nocache_bitmap_size - offset) < size) {
printk("Run out of nocached RAM!\n");
spin_unlock(&srmmu_nocache_spinlock);
return 0;
......@@ -393,9 +401,9 @@ void srmmu_free_nocache(unsigned long vaddr, int size)
vaddr, (unsigned long)SRMMU_NOCACHE_VADDR);
BUG();
}
if (vaddr >= SRMMU_NOCACHE_END) {
if (vaddr >= srmmu_nocache_end) {
printk("Vaddr %lx is bigger than nocache end 0x%lx\n",
vaddr, (unsigned long)SRMMU_NOCACHE_END);
vaddr, srmmu_nocache_end);
BUG();
}
if (size & (size-1)) {
......@@ -429,6 +437,35 @@ void srmmu_free_nocache(unsigned long vaddr, int size)
void srmmu_early_allocate_ptable_skeleton(unsigned long start, unsigned long end);
extern unsigned long probe_memory(void); /* in fault.c */
/* Reserve nocache dynamically proportionally to the amount of
* system RAM. -- Tomas Szepe <szepe@pinerecords.com>, June 2002
*/
void srmmu_nocache_calcsize(void)
{
unsigned long sysmemavail = probe_memory() / 1024;
srmmu_nocache_npages =
sysmemavail / SRMMU_NOCACHE_ALCRATIO / 1024 * 256;
if (sysmemavail % (SRMMU_NOCACHE_ALCRATIO * 1024))
srmmu_nocache_npages += 256;
/* anything above 1280 blows up */
if (srmmu_nocache_npages > 1280) srmmu_nocache_npages = 1280;
srmmu_nocache_size = srmmu_nocache_npages * PAGE_SIZE;
srmmu_nocache_bitmap_size = srmmu_nocache_npages * 16;
srmmu_nocache_end = SRMMU_NOCACHE_VADDR + srmmu_nocache_size;
fix_kmap_begin = srmmu_nocache_end;
fix_kmap_end = fix_kmap_begin + (KM_TYPE_NR * NR_CPUS - 1) * PAGE_SIZE;
pkmap_base = SRMMU_NOCACHE_VADDR + srmmu_nocache_size + 0x40000;
pkmap_base_end = pkmap_base + LAST_PKMAP * PAGE_SIZE;
/* printk("system memory available = %luk\nnocache ram size = %luk\n",
sysmemavail, srmmu_nocache_size / 1024); */
}
void srmmu_nocache_init(void)
{
pgd_t *pgd;
......@@ -437,24 +474,24 @@ void srmmu_nocache_init(void)
unsigned long paddr, vaddr;
unsigned long pteval;
srmmu_nocache_pool = __alloc_bootmem(SRMMU_NOCACHE_SIZE, PAGE_SIZE, 0UL);
memset(srmmu_nocache_pool, 0, SRMMU_NOCACHE_SIZE);
srmmu_nocache_pool = __alloc_bootmem(srmmu_nocache_size, PAGE_SIZE, 0UL);
memset(srmmu_nocache_pool, 0, srmmu_nocache_size);
srmmu_nocache_bitmap = __alloc_bootmem(SRMMU_NOCACHE_BITMAP_SIZE, SMP_CACHE_BYTES, 0UL);
memset(srmmu_nocache_bitmap, 0, SRMMU_NOCACHE_BITMAP_SIZE);
srmmu_nocache_bitmap = __alloc_bootmem(srmmu_nocache_bitmap_size, SMP_CACHE_BYTES, 0UL);
memset(srmmu_nocache_bitmap, 0, srmmu_nocache_bitmap_size);
srmmu_swapper_pg_dir = (pgd_t *)__srmmu_get_nocache(SRMMU_PGD_TABLE_SIZE, SRMMU_PGD_TABLE_SIZE);
memset(__nocache_fix(srmmu_swapper_pg_dir), 0, SRMMU_PGD_TABLE_SIZE);
init_mm.pgd = srmmu_swapper_pg_dir;
srmmu_early_allocate_ptable_skeleton(SRMMU_NOCACHE_VADDR, SRMMU_NOCACHE_END);
srmmu_early_allocate_ptable_skeleton(SRMMU_NOCACHE_VADDR, srmmu_nocache_end);
spin_lock_init(&srmmu_nocache_spinlock);
paddr = __pa((unsigned long)srmmu_nocache_pool);
vaddr = SRMMU_NOCACHE_VADDR;
while (vaddr < SRMMU_NOCACHE_END) {
while (vaddr < srmmu_nocache_end) {
pgd = pgd_offset_k(vaddr);
pmd = srmmu_pmd_offset(__nocache_fix(pgd), vaddr);
pte = srmmu_pte_offset(__nocache_fix(pmd), vaddr);
......@@ -1286,6 +1323,7 @@ void __init srmmu_paging_init(void)
pages_avail = 0;
last_valid_pfn = bootmem_init(&pages_avail);
srmmu_nocache_calcsize();
srmmu_nocache_init();
srmmu_inherit_prom_mappings(0xfe400000,(LINUX_OPPROM_ENDVM-PAGE_SIZE));
map_kernel();
......@@ -1307,12 +1345,12 @@ void __init srmmu_paging_init(void)
srmmu_allocate_ptable_skeleton(DVMA_VADDR, DVMA_END);
#endif
srmmu_allocate_ptable_skeleton(FIX_KMAP_BEGIN, FIX_KMAP_END);
srmmu_allocate_ptable_skeleton(PKMAP_BASE, PKMAP_BASE_END);
srmmu_allocate_ptable_skeleton(fix_kmap_begin, fix_kmap_end);
srmmu_allocate_ptable_skeleton(pkmap_base, pkmap_base_end);
pgd = pgd_offset_k(PKMAP_BASE);
pmd = srmmu_pmd_offset(pgd, PKMAP_BASE);
pte = srmmu_pte_offset(pmd, PKMAP_BASE);
pgd = pgd_offset_k(pkmap_base);
pmd = srmmu_pmd_offset(pgd, pkmap_base);
pte = srmmu_pte_offset(pmd, pkmap_base);
pkmap_page_table = pte;
flush_cache_all();
......@@ -1359,7 +1397,7 @@ static void srmmu_mmu_info(struct seq_file *m)
"nocache used\t: %d\n",
srmmu_name,
num_contexts,
SRMMU_NOCACHE_SIZE,
srmmu_nocache_size,
(srmmu_nocache_used << SRMMU_NOCACHE_BITMAP_SHIFT));
}
......
......@@ -2002,6 +2002,9 @@ extern unsigned long end;
extern unsigned long bootmem_init(unsigned long *pages_avail);
extern unsigned long last_valid_pfn;
extern unsigned long fix_kmap_begin;
extern unsigned long fix_kmap_end;
void __init sun4c_paging_init(void)
{
int i, cnt;
......@@ -2009,6 +2012,9 @@ void __init sun4c_paging_init(void)
extern struct resource sparc_iomap;
unsigned long end_pfn, pages_avail;
fix_kmap_begin = KERNBASE + SRMMU_MAXMEM; /* Why bother with SRMMU_MAXMEM? */
fix_kmap_end = fix_kmap_begin + ((KM_TYPE_NR*NR_CPUS)-1)*PAGE_SIZE;
kernel_end = (unsigned long) &end;
kernel_end += (SUN4C_REAL_PGDIR_SIZE * 4);
kernel_end = SUN4C_REAL_PGDIR_ALIGN(kernel_end);
......
This diff is collapsed.
......@@ -82,6 +82,18 @@ config CRYPTO_TWOFISH
See also:
http://www.counterpane.com/twofish.html
config CRYPTO_SERPENT
tristate "Serpent cipher algorithm"
depends on CRYPTO
help
Serpent cipher algorithm, by Anderson, Biham & Knudsen.
Keys are allowed to be from 0 to 256 bits in length, in steps
of 8 bits.
See also:
http://www.cl.cam.ac.uk/~rja14/serpent.html
config CRYPTO_TEST
tristate "Testing module"
depends on CRYPTO
......
......@@ -17,6 +17,7 @@ obj-$(CONFIG_CRYPTO_SHA256) += sha256.o
obj-$(CONFIG_CRYPTO_DES) += des.o
obj-$(CONFIG_CRYPTO_BLOWFISH) += blowfish.o
obj-$(CONFIG_CRYPTO_TWOFISH) += twofish.o
obj-$(CONFIG_CRYPTO_SERPENT) += serpent.o
obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o
......
This diff is collapsed.
......@@ -48,7 +48,7 @@ static char *tvmem;
static char *check[] = {
"des", "md5", "des3_ede", "rot13", "sha1", "sha256", "blowfish",
"twofish",
"twofish", "serpent",
NULL
};
......@@ -1884,6 +1884,105 @@ test_twofish(void)
crypto_free_tfm(tfm);
}
void
test_serpent(void)
{
unsigned int ret, i, tsize;
u8 *p, *q, *key;
struct crypto_tfm *tfm;
struct serpent_tv *serp_tv;
struct scatterlist sg[1];
printk("\ntesting serpent encryption\n");
tfm = crypto_alloc_tfm("serpent", 0);
if (tfm == NULL) {
printk("failed to load transform for serpent (default ecb)\n");
return;
}
tsize = sizeof (serpent_enc_tv_template);
if (tsize > TVMEMSIZE) {
printk("template (%u) too big for tvmem (%u)\n", tsize,
TVMEMSIZE);
return;
}
memcpy(tvmem, serpent_enc_tv_template, tsize);
serp_tv = (void *) tvmem;
for (i = 0; i < SERPENT_ENC_TEST_VECTORS; i++) {
printk("test %u (%d bit key):\n", i + 1, serp_tv[i].keylen * 8);
key = serp_tv[i].key;
ret = crypto_cipher_setkey(tfm, key, serp_tv[i].keylen);
if (ret) {
printk("setkey() failed flags=%x\n", tfm->crt_flags);
if (!serp_tv[i].fail)
goto out;
}
p = serp_tv[i].plaintext;
sg[0].page = virt_to_page(p);
sg[0].offset = ((long) p & ~PAGE_MASK);
sg[0].length = sizeof(serp_tv[i].plaintext);
ret = crypto_cipher_encrypt(tfm, sg, 1);
if (ret) {
printk("encrypt() failed flags=%x\n", tfm->crt_flags);
goto out;
}
q = kmap(sg[0].page) + sg[0].offset;
hexdump(q, sizeof(serp_tv[i].result));
printk("%s\n", memcmp(q, serp_tv[i].result,
sizeof(serp_tv[i].result)) ? "fail" : "pass");
}
printk("\ntesting serpent decryption\n");
tsize = sizeof (serpent_dec_tv_template);
if (tsize > TVMEMSIZE) {
printk("template (%u) too big for tvmem (%u)\n", tsize,
TVMEMSIZE);
return;
}
memcpy(tvmem, serpent_dec_tv_template, tsize);
serp_tv = (void *) tvmem;
for (i = 0; i < SERPENT_DEC_TEST_VECTORS; i++) {
printk("test %u (%d bit key):\n", i + 1, serp_tv[i].keylen * 8);
key = serp_tv[i].key;
ret = crypto_cipher_setkey(tfm, key, serp_tv[i].keylen);
if (ret) {
printk("setkey() failed flags=%x\n", tfm->crt_flags);
if (!serp_tv[i].fail)
goto out;
}
p = serp_tv[i].plaintext;
sg[0].page = virt_to_page(p);
sg[0].offset = ((long) p & ~PAGE_MASK);
sg[0].length = sizeof(serp_tv[i].plaintext);
ret = crypto_cipher_decrypt(tfm, sg, 1);
if (ret) {
printk("decrypt() failed flags=%x\n", tfm->crt_flags);
goto out;
}
q = kmap(sg[0].page) + sg[0].offset;
hexdump(q, sizeof(serp_tv[i].result));
printk("%s\n", memcmp(q, serp_tv[i].result,
sizeof(serp_tv[i].result)) ? "fail" : "pass");
}
out:
crypto_free_tfm(tfm);
}
static void
test_available(void)
{
......@@ -1911,6 +2010,7 @@ do_test(void)
test_sha256();
test_blowfish();
test_twofish();
test_serpent();
#ifdef CONFIG_CRYPTO_HMAC
test_hmac_md5();
test_hmac_sha1();
......@@ -1950,6 +2050,10 @@ do_test(void)
test_twofish();
break;
case 9:
test_serpent();
break;
#ifdef CONFIG_CRYPTO_HMAC
case 100:
test_hmac_md5();
......
......@@ -1384,4 +1384,100 @@ struct tf_tv tf_cbc_dec_tv_template[] = {
},
};
/*
* Serpent test vectors. These are backwards because Serpent writes
* octect sequences in right-to-left mode.
*/
#define SERPENT_ENC_TEST_VECTORS 4
#define SERPENT_DEC_TEST_VECTORS 4
struct serpent_tv {
unsigned int keylen, fail;
u8 key[32], plaintext[16], result[16];
};
struct serpent_tv serpent_enc_tv_template[] =
{
{
0, 0,
{ 0 },
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
{ 0x12, 0x07, 0xfc, 0xce, 0x9b, 0xd0, 0xd6, 0x47,
0x6a, 0xe9, 0x8f, 0xbe, 0xd1, 0x43, 0xa0, 0xe2 }
},
{
16, 0,
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
{ 0x4c, 0x7d, 0x8a, 0x32, 0x80, 0x72, 0xa2, 0x2c,
0x82, 0x3e, 0x4a, 0x1f, 0x3a, 0xcd, 0xa1, 0x6d }
},
{
32, 0,
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
{ 0xde, 0x26, 0x9f, 0xf8, 0x33, 0xe4, 0x32, 0xb8,
0x5b, 0x2e, 0x88, 0xd2, 0x70, 0x1c, 0xe7, 0x5c }
},
{
16, 0,
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0xdd, 0xd2, 0x6b, 0x98, 0xa5, 0xff, 0xd8, 0x2c,
0x05, 0x34, 0x5a, 0x9d, 0xad, 0xbf, 0xaf, 0x49}
}
};
struct serpent_tv serpent_dec_tv_template[] =
{
{
0, 0,
{ 0 },
{ 0x12, 0x07, 0xfc, 0xce, 0x9b, 0xd0, 0xd6, 0x47,
0x6a, 0xe9, 0x8f, 0xbe, 0xd1, 0x43, 0xa0, 0xe2 },
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
},
{
16, 0,
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
{ 0x4c, 0x7d, 0x8a, 0x32, 0x80, 0x72, 0xa2, 0x2c,
0x82, 0x3e, 0x4a, 0x1f, 0x3a, 0xcd, 0xa1, 0x6d },
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
},
{
32, 0,
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
{ 0xde, 0x26, 0x9f, 0xf8, 0x33, 0xe4, 0x32, 0xb8,
0x5b, 0x2e, 0x88, 0xd2, 0x70, 0x1c, 0xe7, 0x5c },
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
},
{
16, 0,
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 },
{ 0xdd, 0xd2, 0x6b, 0x98, 0xa5, 0xff, 0xd8, 0x2c,
0x05, 0x34, 0x5a, 0x9d, 0xad, 0xbf, 0xaf, 0x49},
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
}
};
#endif /* _CRYPTO_TCRYPT_H */
......@@ -318,8 +318,11 @@ static int __init i2c_ioc_init(void)
ret = i2c_bit_add_bus(&ioc_ops);
if (ret >= 0)
misc_register(&rtc_dev);
if (ret >= 0){
ret = misc_register(&rtc_dev);
if(ret < 0)
i2c_bit_del_bus(&ioc_ops);
}
return ret;
}
......
......@@ -58,8 +58,7 @@ config ACPI_BOOT
config ACPI_SLEEP
bool "Sleep States"
depends on X86 && ACPI && !ACPI_HT_ONLY
default SOFTWARE_SUSPEND
depends on X86 && ACPI && !ACPI_HT_ONLY && SOFTWARE_SUSPEND
---help---
This option adds support for ACPI suspend states.
......
......@@ -142,7 +142,7 @@ acpi_set_debug (
switch (flag) {
case ACPI_DEBUG_LOW:
acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS;
acpi_dbg_level = DEBUG_DEFAULT;
acpi_dbg_level = ACPI_DEBUG_DEFAULT;
break;
case ACPI_DEBUG_MEDIUM:
acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS;
......
......@@ -3,7 +3,8 @@
#
obj-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \
dsmethod.o dsobject.o dsutils.o dswload.o dswstate.o
dsmethod.o dsobject.o dsutils.o dswload.o dswstate.o \
dsinit.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
/******************************************************************************
*
* Module Name: dsinit - Object initialization namespace walk
* $Revision: 2 $
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2002, R. Byron Moore
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "acpi.h"
#include "acparser.h"
#include "amlcode.h"
#include "acdispat.h"
#include "acnamesp.h"
#include "acinterp.h"
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dsinit")
/*******************************************************************************
*
* FUNCTION: Acpi_ds_init_one_object
*
* PARAMETERS: Obj_handle - Node
* Level - Current nesting level
* Context - Points to a init info struct
* Return_value - Not used
*
* RETURN: Status
*
* DESCRIPTION: Callback from Acpi_walk_namespace. Invoked for every object
* within the namespace.
*
* Currently, the only objects that require initialization are:
* 1) Methods
* 2) Operation Regions
*
******************************************************************************/
acpi_status
acpi_ds_init_one_object (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value)
{
acpi_object_type type;
acpi_status status;
acpi_init_walk_info *info = (acpi_init_walk_info *) context;
ACPI_FUNCTION_NAME ("Ds_init_one_object");
/*
* We are only interested in objects owned by the table that
* was just loaded
*/
if (((acpi_namespace_node *) obj_handle)->owner_id !=
info->table_desc->table_id) {
return (AE_OK);
}
info->object_count++;
/* And even then, we are only interested in a few object types */
type = acpi_ns_get_type (obj_handle);
switch (type) {
case ACPI_TYPE_REGION:
status = acpi_ds_initialize_region (obj_handle);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %p [%4.4s] - Init failure, %s\n",
obj_handle, ((acpi_namespace_node *) obj_handle)->name.ascii,
acpi_format_exception (status)));
}
info->op_region_count++;
break;
case ACPI_TYPE_METHOD:
info->method_count++;
/* Print a dot for each method unless we are going to print the entire pathname */
if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) {
acpi_os_printf (".");
}
/*
* Set the execution data width (32 or 64) based upon the
* revision number of the parent ACPI table.
* TBD: This is really for possible future support of integer width
* on a per-table basis. Currently, we just use a global for the width.
*/
if (info->table_desc->pointer->revision == 1) {
((acpi_namespace_node *) obj_handle)->flags |= ANOBJ_DATA_WIDTH_32;
}
/*
* Always parse methods to detect errors, we may delete
* the parse tree below
*/
status = acpi_ds_parse_method (obj_handle);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] - parse failure, %s\n",
obj_handle, ((acpi_namespace_node *) obj_handle)->name.ascii,
acpi_format_exception (status)));
/* This parse failed, but we will continue parsing more methods */
break;
}
/*
* Delete the parse tree. We simple re-parse the method
* for every execution since there isn't much overhead
*/
acpi_ns_delete_namespace_subtree (obj_handle);
acpi_ns_delete_namespace_by_owner (((acpi_namespace_node *) obj_handle)->object->method.owning_id);
break;
case ACPI_TYPE_DEVICE:
info->device_count++;
break;
default:
break;
}
/*
* We ignore errors from above, and always return OK, since
* we don't want to abort the walk on a single error.
*/
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ds_initialize_objects
*
* PARAMETERS: Table_desc - Descriptor for parent ACPI table
* Start_node - Root of subtree to be initialized.
*
* RETURN: Status
*
* DESCRIPTION: Walk the namespace starting at "Start_node" and perform any
* necessary initialization on the objects found therein
*
******************************************************************************/
acpi_status
acpi_ds_initialize_objects (
acpi_table_desc *table_desc,
acpi_namespace_node *start_node)
{
acpi_status status;
acpi_init_walk_info info;
ACPI_FUNCTION_TRACE ("Ds_initialize_objects");
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:"));
info.method_count = 0;
info.op_region_count = 0;
info.object_count = 0;
info.device_count = 0;
info.table_desc = table_desc;
/* Walk entire namespace from the supplied root */
status = acpi_walk_namespace (ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX,
acpi_ds_init_one_object, &info, NULL);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Walk_namespace failed, %s\n",
acpi_format_exception (status)));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
"\nTable [%4.4s] - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
table_desc->pointer->signature, info.object_count,
info.device_count, info.method_count, info.op_region_count));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"%hd Methods, %hd Regions\n", info.method_count, info.op_region_count));
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
* Module Name: dsmthdat - control method arguments and local variables
* $Revision: 66 $
* $Revision: 67 $
*
******************************************************************************/
......@@ -68,7 +68,7 @@ acpi_ds_method_data_init (
/* Init the method arguments */
for (i = 0; i < MTH_NUM_ARGS; i++) {
for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) {
ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->arguments[i].name,
NAMEOF_ARG_NTE);
walk_state->arguments[i].name.integer |= (i << 24);
......@@ -79,7 +79,7 @@ acpi_ds_method_data_init (
/* Init the method locals */
for (i = 0; i < MTH_NUM_LOCALS; i++) {
for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) {
ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->local_variables[i].name,
NAMEOF_LOCAL_NTE);
......@@ -118,7 +118,7 @@ acpi_ds_method_data_delete_all (
/* Detach the locals */
for (index = 0; index < MTH_NUM_LOCALS; index++) {
for (index = 0; index < ACPI_METHOD_NUM_LOCALS; index++) {
if (walk_state->local_variables[index].object) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%d=%p\n",
index, walk_state->local_variables[index].object));
......@@ -131,7 +131,7 @@ acpi_ds_method_data_delete_all (
/* Detach the arguments */
for (index = 0; index < MTH_NUM_ARGS; index++) {
for (index = 0; index < ACPI_METHOD_NUM_ARGS; index++) {
if (walk_state->arguments[index].object) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%d=%p\n",
index, walk_state->arguments[index].object));
......@@ -182,7 +182,7 @@ acpi_ds_method_data_init_args (
/* Copy passed parameters into the new method stack frame */
while ((index < MTH_NUM_ARGS) && (index < max_param_count) && params[index]) {
while ((index < ACPI_METHOD_NUM_ARGS) && (index < max_param_count) && params[index]) {
/*
* A valid parameter.
* Store the argument in the method/walk descriptor
......@@ -230,9 +230,9 @@ acpi_ds_method_data_get_node (
switch (opcode) {
case AML_LOCAL_OP:
if (index > MTH_MAX_LOCAL) {
if (index > ACPI_METHOD_MAX_LOCAL) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Local index %d is invalid (max %d)\n",
index, MTH_MAX_LOCAL));
index, ACPI_METHOD_MAX_LOCAL));
return_ACPI_STATUS (AE_AML_INVALID_INDEX);
}
......@@ -243,9 +243,9 @@ acpi_ds_method_data_get_node (
case AML_ARG_OP:
if (index > MTH_MAX_ARG) {
if (index > ACPI_METHOD_MAX_ARG) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Arg index %d is invalid (max %d)\n",
index, MTH_MAX_ARG));
index, ACPI_METHOD_MAX_ARG));
return_ACPI_STATUS (AE_AML_INVALID_INDEX);
}
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
*
* Module Name: dsopcode - Dispatcher Op Region support and handling of
* "control" opcodes
* $Revision: 83 $
* $Revision: 84 $
*
*****************************************************************************/
......@@ -173,7 +173,7 @@ acpi_ds_get_buffer_field_arguments (
extra_desc = acpi_ns_get_secondary_object (obj_desc);
node = obj_desc->buffer_field.node;
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Field]"));
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (ACPI_TYPE_BUFFER_FIELD, node, NULL));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Buffer_field JIT Init\n",
node->name.ascii));
......@@ -317,7 +317,7 @@ acpi_ds_get_region_arguments (
node = obj_desc->region.node;
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Operation Region]"));
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (ACPI_TYPE_REGION, node, NULL));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Op_region Init at AML %p\n",
node->name.ascii, extra_desc->extra.aml_start));
......
This diff is collapsed.
This diff is collapsed.
......@@ -3,7 +3,8 @@
#
obj-y := evevent.o evregion.o evsci.o evxfevnt.o \
evmisc.o evrgnini.o evxface.o evxfregn.o
evmisc.o evrgnini.o evxface.o evxfregn.o \
evgpe.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
This diff is collapsed.
This diff is collapsed.
/******************************************************************************
*
* Module Name: evregion - ACPI Address_space (Op_region) handler dispatch
* $Revision: 135 $
* $Revision: 136 $
*
*****************************************************************************/
......@@ -172,7 +172,7 @@ acpi_ev_execute_reg_method (
/*
* Execute the method, no return value
*/
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (region_obj2->extra.method_REG, " [Method]"));
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (ACPI_TYPE_METHOD, region_obj2->extra.method_REG, NULL));
status = acpi_ns_evaluate_by_handle (region_obj2->extra.method_REG, params, NULL);
acpi_ut_remove_reference (params[1]);
......
This diff is collapsed.
/******************************************************************************
*
* Module Name: exconvrt - Object conversion routines
* $Revision: 44 $
* $Revision: 45 $
*
*****************************************************************************/
......@@ -230,7 +230,7 @@ acpi_ex_convert_to_buffer (
* Create a new Buffer object
* Size will be the string length
*/
ret_desc = acpi_ut_create_buffer_object (obj_desc->string.length);
ret_desc = acpi_ut_create_buffer_object ((ACPI_SIZE) obj_desc->string.length);
if (!ret_desc) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
* $Revision: 47 $
* $Revision: 48 $
*
*****************************************************************************/
......@@ -236,7 +236,7 @@ acpi_enter_sleep_state (
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Entering S%d\n", sleep_state));
ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Entering sleep state [S%d]\n", sleep_state));
/* Clear SLP_EN and SLP_TYP fields */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment