Commit 42153d54 authored by James Bottomley's avatar James Bottomley

Merge mulgrave.(none):/home/jejb/BK/scsi-misc-2.5

into mulgrave.(none):/home/jejb/BK/scsi-for-linus-2.5
parents 87665b16 ba3f8ae2
...@@ -41,6 +41,7 @@ ldd ...@@ -41,6 +41,7 @@ ldd
Debugging modules Debugging modules
The proc file system The proc file system
Starting points for debugging scripting languages etc. Starting points for debugging scripting languages etc.
Dumptool & Lcrash
SysRq SysRq
References References
Special Thanks Special Thanks
...@@ -237,10 +238,9 @@ they go to 64 Bit. ...@@ -237,10 +238,9 @@ they go to 64 Bit.
On 390 our limitations & strengths make us slightly different. On 390 our limitations & strengths make us slightly different.
For backward compatibility ( because of the psw address hi bit which For backward compatibility we are only allowed use 31 bits (2GB)
indicates whether we are in 31 or 64 bit mode ) we are only allowed of our 32 bit addresses,however, we use entirely separate address
use 31 bits (2GB) of our 32 bit addresses. However, spaces for the user & kernel.
we use entirely separate address spaces for the user & kernel.
This means we can support 2GB of non Extended RAM on s/390, & more This means we can support 2GB of non Extended RAM on s/390, & more
with the Extended memory managment swap device & with the Extended memory managment swap device &
...@@ -1288,14 +1288,10 @@ this can make debugging a particular process under VM painful under normal ...@@ -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 circumstances as the process may change when doing a
TR I R <address range>. TR I R <address range>.
Thankfully after reading VM's online help I figured out how to debug Thankfully after reading VM's online help I figured out how to debug
particular processes in 31 bit mode, however, according to the current I particular process.
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.
Your first problem is to find the STD ( segment table designation ) Your first problem is to find the STD ( segment table designation )
of the program you wish to debug. of the program you wish to debug.
There are several ways you can do this here are a few There are several ways you can do this here are a few
1) objdump --syms <program to be debugged> | grep main 1) objdump --syms <program to be debugged> | grep main
To get the address of main in the program. To get the address of main in the program.
...@@ -1475,12 +1471,6 @@ Now display what gpr2 is pointing to ...@@ -1475,12 +1471,6 @@ Now display what gpr2 is pointing to
D 00014CB4.20 D 00014CB4.20
V00014CB4 2F646576 2F636F6E 736F6C65 00001BF5 V00014CB4 2F646576 2F636F6E 736F6C65 00001BF5
V00014CC4 FC00014C B4001001 E0001000 B8070707 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 Now copy the text till the first 00 hex ( which is the end of the string
to an xterm & do hex2ascii on it. to an xterm & do hex2ascii on it.
hex2ascii 2F646576 2F636F6E 736F6C65 00 hex2ascii 2F646576 2F636F6E 736F6C65 00
...@@ -1517,7 +1507,7 @@ int main(int argc,char *argv[]) ...@@ -1517,7 +1507,7 @@ int main(int argc,char *argv[])
c=c-'0'; c=c-'0';
if(c>='A'&&c<='F') if(c>='A'&&c<='F')
c=c-'A'+10; c=c-'A'+10;
if(c>='a'&&c<='F') if(c>='a'&&c<='f')
c=c-'a'+10; c=c-'a'+10;
switch(toggle) switch(toggle)
{ {
...@@ -2131,12 +2121,6 @@ now do ...@@ -2131,12 +2121,6 @@ now do
p/x (*(**$sp+56))&0x7fffffff p/x (*(**$sp+56))&0x7fffffff
& so on. & 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 Disassembling instructions without debug info
--------------------------------------------- ---------------------------------------------
gdb typically compains if there is a lack of debugging gdb typically compains if there is a lack of debugging
...@@ -2472,12 +2456,48 @@ jdb <filename> another fully interactive gdb style debugger. ...@@ -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 SysRq
===== =====
This is now supported by linux for s/390 & z/Architecture. This is now supported by linux for s/390 & z/Architecture.
To enable it do compile the kernel with To enable it do compile the kernel with
Kernel Hacking -> Magic SysRq Key Enabled 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 On 390 all commands are prefixed with
^- ^-
e.g. e.g.
...@@ -2513,4 +2533,4 @@ Special Thanks ...@@ -2513,4 +2533,4 @@ Special Thanks
Special thanks to Neale Ferguson who maintains a much Special thanks to Neale Ferguson who maintains a much
prettier HTML version of this page at prettier HTML version of this page at
http://penguinvm.princeton.edu/notes.html#Debug390 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.
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/thread_info.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/thread_info.h>
#include <asm/msr.h> #include <asm/msr.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
......
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/thread_info.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/thread_info.h>
#include "mce.h" #include "mce.h"
......
...@@ -484,7 +484,7 @@ ENTRY(spurious_interrupt_bug) ...@@ -484,7 +484,7 @@ ENTRY(spurious_interrupt_bug)
.data .data
ENTRY(sys_call_table) 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_exit
.long sys_fork .long sys_fork
.long sys_read .long sys_read
......
...@@ -506,6 +506,8 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, ...@@ -506,6 +506,8 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset,
if (regs->orig_eax >= 0) { if (regs->orig_eax >= 0) {
/* If so, check system call restarting.. */ /* If so, check system call restarting.. */
switch (regs->eax) { switch (regs->eax) {
case -ERESTART_RESTARTBLOCK:
current_thread_info()->restart_block.fn = do_no_restart_syscall;
case -ERESTARTNOHAND: case -ERESTARTNOHAND:
regs->eax = -EINTR; regs->eax = -EINTR;
break; break;
...@@ -591,6 +593,10 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -591,6 +593,10 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
regs->eax = regs->orig_eax; regs->eax = regs->orig_eax;
regs->eip -= 2; regs->eip -= 2;
} }
if (regs->eax == -ERESTART_RESTARTBLOCK){
regs->eax = __NR_restart_syscall;
regs->eip -= 2;
}
} }
return 0; return 0;
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/oprofile.h> #include <linux/oprofile.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <asm/thread_info.h> #include <linux/thread_info.h>
#include <asm/nmi.h> #include <asm/nmi.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/msr.h> #include <asm/msr.h>
......
...@@ -287,11 +287,15 @@ source "fs/Kconfig" ...@@ -287,11 +287,15 @@ source "fs/Kconfig"
menu "Kernel hacking" menu "Kernel hacking"
#if [ "$CONFIG_CTC" = "y" ]; then config DEBUG_KERNEL
# bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG bool "Kernel debugging"
#fi help
Say Y here if you are developing drivers or trying to debug and
identify kernel problems.
config MAGIC_SYSRQ config MAGIC_SYSRQ
bool "Magic SysRq key" bool "Magic SysRq key"
depends on DEBUG_KERNEL
help help
If you say Y here, you will have some control over the system even 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 if the system crashes for example during kernel debugging (e.g., you
...@@ -303,6 +307,28 @@ config MAGIC_SYSRQ ...@@ -303,6 +307,28 @@ config MAGIC_SYSRQ
keys are documented in <file:Documentation/sysrq.txt>. Don't say Y keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
unless you really know what this hack does. 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 endmenu
source "security/Kconfig" source "security/Kconfig"
......
...@@ -11,7 +11,6 @@ CONFIG_ARCH_S390=y ...@@ -11,7 +11,6 @@ CONFIG_ARCH_S390=y
# Code maturity level options # Code maturity level options
# #
CONFIG_EXPERIMENTAL=y CONFIG_EXPERIMENTAL=y
CONFIG_CONFIDENTIAL=y
# #
# General setup # General setup
...@@ -80,6 +79,7 @@ CONFIG_BLK_DEV_XPRAM=m ...@@ -80,6 +79,7 @@ CONFIG_BLK_DEV_XPRAM=m
# S/390 block device drivers # S/390 block device drivers
# #
CONFIG_DASD=y CONFIG_DASD=y
# CONFIG_DASD_PROFILE is not set
CONFIG_DASD_ECKD=y CONFIG_DASD_ECKD=y
CONFIG_DASD_FBA=y CONFIG_DASD_FBA=y
CONFIG_DASD_DIAG=y CONFIG_DASD_DIAG=y
...@@ -108,6 +108,7 @@ CONFIG_UNIX98_PTY_COUNT=2048 ...@@ -108,6 +108,7 @@ CONFIG_UNIX98_PTY_COUNT=2048
# CONFIG_TN3270 is not set # CONFIG_TN3270 is not set
CONFIG_TN3215=y CONFIG_TN3215=y
CONFIG_TN3215_CONSOLE=y CONFIG_TN3215_CONSOLE=y
CONFIG_CCW_CONSOLE=y
CONFIG_SCLP=y CONFIG_SCLP=y
CONFIG_SCLP_TTY=y CONFIG_SCLP_TTY=y
CONFIG_SCLP_CONSOLE=y CONFIG_SCLP_CONSOLE=y
...@@ -143,6 +144,7 @@ CONFIG_HOTPLUG=y ...@@ -143,6 +144,7 @@ CONFIG_HOTPLUG=y
CONFIG_LCS=m CONFIG_LCS=m
CONFIG_CTC=m CONFIG_CTC=m
CONFIG_IUCV=m CONFIG_IUCV=m
CONFIG_CCWGROUP=m
# #
# Networking options # Networking options
...@@ -296,18 +298,23 @@ CONFIG_IBM_PARTITION=y ...@@ -296,18 +298,23 @@ CONFIG_IBM_PARTITION=y
# #
# Kernel hacking # Kernel hacking
# #
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=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 # Security options
# #
CONFIG_SECURITY_CAPABILITIES=y # CONFIG_SECURITY is not set
# #
# Cryptographic options # Cryptographic options
# #
CONFIG_CRYPTO=y CONFIG_CRYPTO=y
# CONFIG_CRYPTO_HMAC is not set # CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set # CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set # CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA1 is not set
......
...@@ -654,8 +654,10 @@ void debug_set_level(debug_info_t* id, int new_level) ...@@ -654,8 +654,10 @@ void debug_set_level(debug_info_t* id, int new_level)
id->name, new_level, 0, DEBUG_MAX_LEVEL); id->name, new_level, 0, DEBUG_MAX_LEVEL);
} else { } else {
id->level = new_level; id->level = new_level;
#ifdef DEBUG
printk(KERN_INFO printk(KERN_INFO
"debug: %s: new level %i\n",id->name,id->level); "debug: %s: new level %i\n",id->name,id->level);
#endif
} }
spin_unlock_irqrestore(&id->lock,flags); spin_unlock_irqrestore(&id->lock,flags);
} }
......
...@@ -465,6 +465,18 @@ startup:basr %r13,0 # get base ...@@ -465,6 +465,18 @@ startup:basr %r13,0 # get base
# move IPL device to lowcore # move IPL device to lowcore
mvc __LC_IPLDEV(4),IPL_DEVICE-PARMAREA(%r12) 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. # find memory chunks.
# #
...@@ -579,6 +591,8 @@ startup:basr %r13,0 # get base ...@@ -579,6 +591,8 @@ startup:basr %r13,0 # get base
.Lmemsize:.long memory_size .Lmemsize:.long memory_size
.Lmchunk:.long memory_chunk .Lmchunk:.long memory_chunk
.Lmflags:.long machine_flags .Lmflags:.long machine_flags
.Lbss_bgn: .long __bss_start
.Lbss_end: .long _end
.org PARMAREA-64 .org PARMAREA-64
.Lduct: .long 0,0,0,0,0,0,0,0 .Lduct: .long 0,0,0,0,0,0,0,0
...@@ -620,17 +634,6 @@ _stext: basr %r13,0 # get base ...@@ -620,17 +634,6 @@ _stext: basr %r13,0 # get base
ahi %r15,-96 ahi %r15,-96
xc 0(4,%r15),0(%r15) # set backchain to zero 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 # check control registers
stctl %c0,%c15,0(%r15) stctl %c0,%c15,0(%r15)
oi 2(%r15),0x20 # enable sigp external interrupts oi 2(%r15),0x20 # enable sigp external interrupts
...@@ -651,7 +654,5 @@ _stext: basr %r13,0 # get base ...@@ -651,7 +654,5 @@ _stext: basr %r13,0 # get base
.Ldw: .long 0x000a0000,0x00000000 .Ldw: .long 0x000a0000,0x00000000
.Linittu: .long init_thread_union .Linittu: .long init_thread_union
.Lstart: .long start_kernel .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 .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) ...@@ -146,7 +146,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
regs.orig_gpr2 = -1; regs.orig_gpr2 = -1;
/* Ok, create the new process.. */ /* 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; 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, ...@@ -188,6 +188,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
frame = ((struct stack_frame *) frame = ((struct stack_frame *)
(THREAD_SIZE + (unsigned long) p->thread_info)) - 1; (THREAD_SIZE + (unsigned long) p->thread_info)) - 1;
p->thread.ksp = (unsigned long) frame; p->thread.ksp = (unsigned long) frame;
p->set_child_tid = p->clear_child_tid = NULL;
frame->childregs = *regs; frame->childregs = *regs;
frame->childregs.gprs[2] = 0; /* child returns 0 on fork. */ frame->childregs.gprs[2] = 0; /* child returns 0 on fork. */
frame->childregs.gprs[15] = new_stackp; frame->childregs.gprs[15] = new_stackp;
...@@ -218,7 +219,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long 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) asmlinkage int sys_fork(struct pt_regs regs)
{ {
struct task_struct *p; 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; return IS_ERR(p) ? PTR_ERR(p) : p->pid;
} }
...@@ -227,14 +228,16 @@ asmlinkage int sys_clone(struct pt_regs regs) ...@@ -227,14 +228,16 @@ asmlinkage int sys_clone(struct pt_regs regs)
unsigned long clone_flags; unsigned long clone_flags;
unsigned long newsp; unsigned long newsp;
struct task_struct *p; struct task_struct *p;
int *user_tid; int *parent_tidptr, *child_tidptr;
clone_flags = regs.gprs[3]; clone_flags = regs.gprs[3];
newsp = regs.orig_gpr2; newsp = regs.orig_gpr2;
user_tid = (int *) regs.gprs[4]; parent_tidptr = (int *) regs.gprs[4];
child_tidptr = (int *) regs.gprs[5];
if (!newsp) if (!newsp)
newsp = regs.gprs[15]; 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; return IS_ERR(p) ? PTR_ERR(p) : p->pid;
} }
...@@ -252,7 +255,7 @@ asmlinkage int sys_vfork(struct pt_regs regs) ...@@ -252,7 +255,7 @@ asmlinkage int sys_vfork(struct pt_regs regs)
{ {
struct task_struct *p; struct task_struct *p;
p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 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; return IS_ERR(p) ? PTR_ERR(p) : p->pid;
} }
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/user.h> #include <linux/user.h>
#include <linux/security.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/page.h> #include <asm/page.h>
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
*/ */
unsigned int console_mode = 0; unsigned int console_mode = 0;
unsigned int console_device = -1; unsigned int console_device = -1;
unsigned int console_irq = -1;
unsigned long memory_size = 0; unsigned long memory_size = 0;
unsigned long machine_flags = 0; unsigned long machine_flags = 0;
struct { unsigned long addr, size, type; } memory_chunk[16] = { { 0 } }; struct { unsigned long addr, size, type; } memory_chunk[16] = { { 0 } };
...@@ -187,6 +188,10 @@ static void __init conmode_default(void) ...@@ -187,6 +188,10 @@ static void __init conmode_default(void)
char *ptr; char *ptr;
if (MACHINE_IS_VM) { 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); cpcmd("QUERY TERM", query_buffer, 1024);
ptr = strstr(query_buffer, "CONMODE"); ptr = strstr(query_buffer, "CONMODE");
/* /*
...@@ -245,9 +250,13 @@ void (*_machine_power_off)(void) = machine_power_off_smp; ...@@ -245,9 +250,13 @@ void (*_machine_power_off)(void) = machine_power_off_smp;
/* /*
* Reboot, halt and power_off routines for non 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) 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) static void do_machine_halt_nonsmp(void)
......
...@@ -61,7 +61,7 @@ unsigned long cache_decay_ticks = 0; ...@@ -61,7 +61,7 @@ unsigned long cache_decay_ticks = 0;
extern char vmhalt_cmd[]; extern char vmhalt_cmd[];
extern char vmpoff_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 sigp_ccode smp_ext_bitcall(int, ec_bit_sig);
static void smp_ext_bitcall_others(ec_bit_sig); static void smp_ext_bitcall_others(ec_bit_sig);
...@@ -217,7 +217,10 @@ static void do_machine_restart(void * __unused) ...@@ -217,7 +217,10 @@ static void do_machine_restart(void * __unused)
* interrupted by an external interrupt and s390irq * interrupted by an external interrupt and s390irq
* locks are always held disabled). * 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); signal_processor(smp_processor_id(), sigp_stop);
} }
...@@ -477,7 +480,7 @@ static struct task_struct *__devinit fork_by_hand(void) ...@@ -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 /* don't care about the psw and regs settings since we'll never
reschedule the forked task. */ reschedule the forked task. */
memset(&regs,0,sizeof(struct pt_regs)); 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) int __cpu_up(unsigned int cpu)
......
...@@ -296,11 +296,15 @@ source "fs/Kconfig" ...@@ -296,11 +296,15 @@ source "fs/Kconfig"
menu "Kernel hacking" menu "Kernel hacking"
#if [ "$CONFIG_CTC" = "y" ]; then config DEBUG_KERNEL
# bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG bool "Kernel debugging"
#fi help
Say Y here if you are developing drivers or trying to debug and
identify kernel problems.
config MAGIC_SYSRQ config MAGIC_SYSRQ
bool "Magic SysRq key" bool "Magic SysRq key"
depends on DEBUG_KERNEL
help help
If you say Y here, you will have some control over the system even 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 if the system crashes for example during kernel debugging (e.g., you
...@@ -312,6 +316,28 @@ config MAGIC_SYSRQ ...@@ -312,6 +316,28 @@ config MAGIC_SYSRQ
keys are documented in <file:Documentation/sysrq.txt>. Don't say Y keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
unless you really know what this hack does. 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 endmenu
source "security/Kconfig" source "security/Kconfig"
......
...@@ -11,7 +11,6 @@ CONFIG_ARCH_S390X=y ...@@ -11,7 +11,6 @@ CONFIG_ARCH_S390X=y
# Code maturity level options # Code maturity level options
# #
CONFIG_EXPERIMENTAL=y CONFIG_EXPERIMENTAL=y
CONFIG_CONFIDENTIAL=y
# #
# General setup # General setup
...@@ -138,6 +137,7 @@ CONFIG_BLK_DEV_XPRAM=m ...@@ -138,6 +137,7 @@ CONFIG_BLK_DEV_XPRAM=m
# S/390 block device drivers # S/390 block device drivers
# #
CONFIG_DASD=y CONFIG_DASD=y
# CONFIG_DASD_PROFILE is not set
CONFIG_DASD_ECKD=y CONFIG_DASD_ECKD=y
CONFIG_DASD_FBA=y CONFIG_DASD_FBA=y
# CONFIG_DASD_DIAG is not set # CONFIG_DASD_DIAG is not set
...@@ -166,6 +166,7 @@ CONFIG_UNIX98_PTY_COUNT=2048 ...@@ -166,6 +166,7 @@ CONFIG_UNIX98_PTY_COUNT=2048
# CONFIG_TN3270 is not set # CONFIG_TN3270 is not set
CONFIG_TN3215=y CONFIG_TN3215=y
CONFIG_TN3215_CONSOLE=y CONFIG_TN3215_CONSOLE=y
CONFIG_CCW_CONSOLE=y
CONFIG_SCLP=y CONFIG_SCLP=y
CONFIG_SCLP_TTY=y CONFIG_SCLP_TTY=y
CONFIG_SCLP_CONSOLE=y CONFIG_SCLP_CONSOLE=y
...@@ -201,6 +202,7 @@ CONFIG_HOTPLUG=y ...@@ -201,6 +202,7 @@ CONFIG_HOTPLUG=y
CONFIG_LCS=m CONFIG_LCS=m
CONFIG_CTC=m CONFIG_CTC=m
CONFIG_IUCV=m CONFIG_IUCV=m
CONFIG_CCWGROUP=m
# #
# Networking options # Networking options
...@@ -357,18 +359,23 @@ CONFIG_IBM_PARTITION=y ...@@ -357,18 +359,23 @@ CONFIG_IBM_PARTITION=y
# #
# Kernel hacking # Kernel hacking
# #
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=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 # Security options
# #
CONFIG_SECURITY_CAPABILITIES=y # CONFIG_SECURITY is not set
# #
# Cryptographic options # Cryptographic options
# #
CONFIG_CRYPTO=y CONFIG_CRYPTO=y
# CONFIG_CRYPTO_HMAC is not set # CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set # CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set # CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA1 is not set
......
...@@ -654,8 +654,10 @@ void debug_set_level(debug_info_t* id, int new_level) ...@@ -654,8 +654,10 @@ void debug_set_level(debug_info_t* id, int new_level)
id->name, new_level, 0, DEBUG_MAX_LEVEL); id->name, new_level, 0, DEBUG_MAX_LEVEL);
} else { } else {
id->level = new_level; id->level = new_level;
#ifdef DEBUG
printk(KERN_INFO printk(KERN_INFO
"debug: %s: new level %i\n",id->name,id->level); "debug: %s: new level %i\n",id->name,id->level);
#endif
} }
spin_unlock_irqrestore(&id->lock,flags); spin_unlock_irqrestore(&id->lock,flags);
} }
......
...@@ -467,10 +467,21 @@ startup:basr %r13,0 # get base ...@@ -467,10 +467,21 @@ startup:basr %r13,0 # get base
larl %r12,_pstart # pointer to parameter area larl %r12,_pstart # pointer to parameter area
# move IPL device to lowcore # move IPL device to lowcore
mvc __LC_IPLDEV(4),IPL_DEVICE+4-PARMAREA(%r12) 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 # set program check new psw mask
mvc __LC_PGM_NEW_PSW(8),.Lpcmsk-.LPG1(%r13) mvc __LC_PGM_NEW_PSW(8),.Lpcmsk-.LPG1(%r13)
# #
# find memory chunks. # find memory chunks.
# #
...@@ -631,16 +642,7 @@ _stext: basr %r13,0 # get base ...@@ -631,16 +642,7 @@ _stext: basr %r13,0 # get base
stg %r15,__LC_KERNEL_STACK # set end of kernel stack stg %r15,__LC_KERNEL_STACK # set end of kernel stack
aghi %r15,-160 aghi %r15,-160
xc 0(8,%r15),0(%r15) # set backchain to zero 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 # check control registers
stctg %c0,%c15,0(%r15) stctg %c0,%c15,0(%r15)
oi 6(%r15),0x20 # enable sigp external interrupts oi 6(%r15),0x20 # enable sigp external interrupts
......
...@@ -143,7 +143,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ...@@ -143,7 +143,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
regs.orig_gpr2 = -1; regs.orig_gpr2 = -1;
/* Ok, create the new process.. */ /* 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; 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, ...@@ -185,6 +185,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
frame = ((struct stack_frame *) frame = ((struct stack_frame *)
(THREAD_SIZE + (unsigned long) p->thread_info)) - 1; (THREAD_SIZE + (unsigned long) p->thread_info)) - 1;
p->thread.ksp = (unsigned long) frame; p->thread.ksp = (unsigned long) frame;
p->set_child_tid = p->clear_child_tid = NULL;
frame->childregs = *regs; frame->childregs = *regs;
frame->childregs.gprs[2] = 0; /* child returns 0 on fork. */ frame->childregs.gprs[2] = 0; /* child returns 0 on fork. */
frame->childregs.gprs[15] = new_stackp; frame->childregs.gprs[15] = new_stackp;
...@@ -208,7 +209,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long 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) asmlinkage int sys_fork(struct pt_regs regs)
{ {
struct task_struct *p; 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; return IS_ERR(p) ? PTR_ERR(p) : p->pid;
} }
...@@ -217,14 +218,16 @@ asmlinkage int sys_clone(struct pt_regs regs) ...@@ -217,14 +218,16 @@ asmlinkage int sys_clone(struct pt_regs regs)
unsigned long clone_flags; unsigned long clone_flags;
unsigned long newsp; unsigned long newsp;
struct task_struct *p; struct task_struct *p;
int *user_tid; int *parent_tidptr, *child_tidptr;
clone_flags = regs.gprs[3]; clone_flags = regs.gprs[3];
newsp = regs.orig_gpr2; newsp = regs.orig_gpr2;
user_tid = (int *) regs.gprs[4]; parent_tidptr = (int *) regs.gprs[4];
child_tidptr = (int *) regs.gprs[5];
if (!newsp) if (!newsp)
newsp = regs.gprs[15]; 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; return IS_ERR(p) ? PTR_ERR(p) : p->pid;
} }
...@@ -242,7 +245,7 @@ asmlinkage int sys_vfork(struct pt_regs regs) ...@@ -242,7 +245,7 @@ asmlinkage int sys_vfork(struct pt_regs regs)
{ {
struct task_struct *p; struct task_struct *p;
p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 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; return IS_ERR(p) ? PTR_ERR(p) : p->pid;
} }
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
*/ */
unsigned int console_mode = 0; unsigned int console_mode = 0;
unsigned int console_device = -1; unsigned int console_device = -1;
unsigned int console_irq = -1;
unsigned long memory_size = 0; unsigned long memory_size = 0;
unsigned long machine_flags = 0; unsigned long machine_flags = 0;
struct { unsigned long addr, size, type; } memory_chunk[16] = { { 0 } }; struct { unsigned long addr, size, type; } memory_chunk[16] = { { 0 } };
...@@ -187,6 +188,10 @@ static void __init conmode_default(void) ...@@ -187,6 +188,10 @@ static void __init conmode_default(void)
char *ptr; char *ptr;
if (MACHINE_IS_VM) { 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); cpcmd("QUERY TERM", query_buffer, 1024);
ptr = strstr(query_buffer, "CONMODE"); ptr = strstr(query_buffer, "CONMODE");
/* /*
...@@ -245,9 +250,13 @@ void (*_machine_power_off)(void) = machine_power_off_smp; ...@@ -245,9 +250,13 @@ void (*_machine_power_off)(void) = machine_power_off_smp;
/* /*
* Reboot, halt and power_off routines for non 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) 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) static void do_machine_halt_nonsmp(void)
......
...@@ -60,7 +60,7 @@ unsigned long cache_decay_ticks = 0; ...@@ -60,7 +60,7 @@ unsigned long cache_decay_ticks = 0;
extern char vmhalt_cmd[]; extern char vmhalt_cmd[];
extern char vmpoff_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 sigp_ccode smp_ext_bitcall(int, ec_bit_sig);
static void smp_ext_bitcall_others(ec_bit_sig); static void smp_ext_bitcall_others(ec_bit_sig);
...@@ -216,7 +216,10 @@ static void do_machine_restart(void * __unused) ...@@ -216,7 +216,10 @@ static void do_machine_restart(void * __unused)
* interrupted by an external interrupt and s390irq * interrupted by an external interrupt and s390irq
* locks are always held disabled). * 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); signal_processor(smp_processor_id(), sigp_stop);
} }
...@@ -461,7 +464,7 @@ static struct task_struct * __devinit fork_by_hand(void) ...@@ -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 /* don't care about the psw and regs settings since we'll never
reschedule the forked task. */ reschedule the forked task. */
memset(&regs,0,sizeof(struct pt_regs)); 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) int __cpu_up(unsigned int cpu)
......
...@@ -142,7 +142,7 @@ acpi_set_debug ( ...@@ -142,7 +142,7 @@ acpi_set_debug (
switch (flag) { switch (flag) {
case ACPI_DEBUG_LOW: case ACPI_DEBUG_LOW:
acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS; acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS;
acpi_dbg_level = DEBUG_DEFAULT; acpi_dbg_level = ACPI_DEBUG_DEFAULT;
break; break;
case ACPI_DEBUG_MEDIUM: case ACPI_DEBUG_MEDIUM:
acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS; acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS;
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
# #
obj-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \ 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) 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 * Module Name: dsmthdat - control method arguments and local variables
* $Revision: 66 $ * $Revision: 67 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -68,7 +68,7 @@ acpi_ds_method_data_init ( ...@@ -68,7 +68,7 @@ acpi_ds_method_data_init (
/* Init the method arguments */ /* 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, ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->arguments[i].name,
NAMEOF_ARG_NTE); NAMEOF_ARG_NTE);
walk_state->arguments[i].name.integer |= (i << 24); walk_state->arguments[i].name.integer |= (i << 24);
...@@ -79,7 +79,7 @@ acpi_ds_method_data_init ( ...@@ -79,7 +79,7 @@ acpi_ds_method_data_init (
/* Init the method locals */ /* 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, ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->local_variables[i].name,
NAMEOF_LOCAL_NTE); NAMEOF_LOCAL_NTE);
...@@ -118,7 +118,7 @@ acpi_ds_method_data_delete_all ( ...@@ -118,7 +118,7 @@ acpi_ds_method_data_delete_all (
/* Detach the locals */ /* 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) { if (walk_state->local_variables[index].object) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%d=%p\n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%d=%p\n",
index, walk_state->local_variables[index].object)); index, walk_state->local_variables[index].object));
...@@ -131,7 +131,7 @@ acpi_ds_method_data_delete_all ( ...@@ -131,7 +131,7 @@ acpi_ds_method_data_delete_all (
/* Detach the arguments */ /* 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) { if (walk_state->arguments[index].object) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%d=%p\n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%d=%p\n",
index, walk_state->arguments[index].object)); index, walk_state->arguments[index].object));
...@@ -182,7 +182,7 @@ acpi_ds_method_data_init_args ( ...@@ -182,7 +182,7 @@ acpi_ds_method_data_init_args (
/* Copy passed parameters into the new method stack frame */ /* 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. * A valid parameter.
* Store the argument in the method/walk descriptor * Store the argument in the method/walk descriptor
...@@ -230,9 +230,9 @@ acpi_ds_method_data_get_node ( ...@@ -230,9 +230,9 @@ acpi_ds_method_data_get_node (
switch (opcode) { switch (opcode) {
case AML_LOCAL_OP: 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", 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); return_ACPI_STATUS (AE_AML_INVALID_INDEX);
} }
...@@ -243,9 +243,9 @@ acpi_ds_method_data_get_node ( ...@@ -243,9 +243,9 @@ acpi_ds_method_data_get_node (
case AML_ARG_OP: 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", 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); return_ACPI_STATUS (AE_AML_INVALID_INDEX);
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dsobject - Dispatcher object management routines * Module Name: dsobject - Dispatcher object management routines
* $Revision: 110 $ * $Revision: 111 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -36,187 +36,6 @@ ...@@ -36,187 +36,6 @@
#ifndef ACPI_NO_METHOD_EXECUTION #ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
*
* 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++;
if (!(acpi_dbg_level & ACPI_LV_INIT)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "."));
}
/*
* 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_OK, "Parsing 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_OK,
"\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);
}
/***************************************************************************** /*****************************************************************************
* *
* FUNCTION: Acpi_ds_build_internal_object * FUNCTION: Acpi_ds_build_internal_object
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* Module Name: dsopcode - Dispatcher Op Region support and handling of * Module Name: dsopcode - Dispatcher Op Region support and handling of
* "control" opcodes * "control" opcodes
* $Revision: 83 $ * $Revision: 84 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -173,7 +173,7 @@ acpi_ds_get_buffer_field_arguments ( ...@@ -173,7 +173,7 @@ acpi_ds_get_buffer_field_arguments (
extra_desc = acpi_ns_get_secondary_object (obj_desc); extra_desc = acpi_ns_get_secondary_object (obj_desc);
node = obj_desc->buffer_field.node; 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", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Buffer_field JIT Init\n",
node->name.ascii)); node->name.ascii));
...@@ -317,7 +317,7 @@ acpi_ds_get_region_arguments ( ...@@ -317,7 +317,7 @@ acpi_ds_get_region_arguments (
node = obj_desc->region.node; 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", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Op_region Init at AML %p\n",
node->name.ascii, extra_desc->extra.aml_start)); node->name.ascii, extra_desc->extra.aml_start));
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dswload - Dispatcher namespace load callbacks * Module Name: dswload - Dispatcher namespace load callbacks
* $Revision: 78 $ * $Revision: 80 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -356,6 +356,37 @@ acpi_ds_load1_end_op ( ...@@ -356,6 +356,37 @@ acpi_ds_load1_end_op (
} }
} }
if (op->common.aml_opcode == AML_METHOD_OP) {
/*
* Method_op Pkg_length Name_string Method_flags Term_list
*
* Note: We must create the method node/object pair as soon as we
* see the method declaration. This allows later pass1 parsing
* of invocations of the method (need to know the number of
* arguments.)
*/
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"LOADING-Method: State=%p Op=%p Named_obj=%p\n",
walk_state, op, op->named.node));
if (!acpi_ns_get_attached_object (op->named.node)) {
walk_state->operands[0] = (void *) op->named.node;
walk_state->num_operands = 1;
status = acpi_ds_create_operands (walk_state, op->common.value.arg);
if (ACPI_SUCCESS (status)) {
status = acpi_ex_create_method (op->named.data,
op->named.length, walk_state);
}
walk_state->operands[0] = NULL;
walk_state->num_operands = 0;
if (ACPI_FAILURE (status)) {
return (status);
}
}
}
/* Pop the scope stack */ /* Pop the scope stack */
if (acpi_ns_opens_scope (object_type)) { if (acpi_ns_opens_scope (object_type)) {
...@@ -651,11 +682,10 @@ acpi_ds_load2_end_op ( ...@@ -651,11 +682,10 @@ acpi_ds_load2_end_op (
status = acpi_ds_scope_stack_pop (walk_state); status = acpi_ds_scope_stack_pop (walk_state);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status); goto cleanup;
} }
} }
/* /*
* Named operations are as follows: * Named operations are as follows:
* *
...@@ -789,26 +819,6 @@ acpi_ds_load2_end_op ( ...@@ -789,26 +819,6 @@ acpi_ds_load2_end_op (
case AML_TYPE_NAMED_COMPLEX: case AML_TYPE_NAMED_COMPLEX:
switch (op->common.aml_opcode) { switch (op->common.aml_opcode) {
case AML_METHOD_OP:
/*
* Method_op Pkg_length Name_string Method_flags Term_list
*/
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"LOADING-Method: State=%p Op=%p Named_obj=%p\n",
walk_state, op, node));
if (!acpi_ns_get_attached_object (node)) {
status = acpi_ds_create_operands (walk_state, arg);
if (ACPI_FAILURE (status)) {
goto cleanup;
}
status = acpi_ex_create_method (op->named.data,
op->named.length, walk_state);
}
break;
#ifndef ACPI_NO_METHOD_EXECUTION #ifndef ACPI_NO_METHOD_EXECUTION
case AML_REGION_OP: case AML_REGION_OP:
/* /*
...@@ -842,6 +852,7 @@ acpi_ds_load2_end_op ( ...@@ -842,6 +852,7 @@ acpi_ds_load2_end_op (
default: default:
/* All NAMED_COMPLEX opcodes must be handled above */ /* All NAMED_COMPLEX opcodes must be handled above */
/* Note: Method objects were already created in Pass 1 */
break; break;
} }
break; break;
...@@ -891,7 +902,6 @@ acpi_ds_load2_end_op ( ...@@ -891,7 +902,6 @@ acpi_ds_load2_end_op (
break; break;
} }
cleanup: cleanup:
/* Remove the Node pushed at the very beginning */ /* Remove the Node pushed at the very beginning */
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: dswstate - Dispatcher parse tree walk management routines * Module Name: dswstate - Dispatcher parse tree walk management routines
* $Revision: 70 $ * $Revision: 71 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -65,7 +65,7 @@ acpi_ds_result_insert ( ...@@ -65,7 +65,7 @@ acpi_ds_result_insert (
return (AE_NOT_EXIST); return (AE_NOT_EXIST);
} }
if (index >= OBJ_NUM_OPERANDS) { if (index >= ACPI_OBJ_NUM_OPERANDS) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Index out of range: %X Obj=%p State=%p Num=%X\n", "Index out of range: %X Obj=%p State=%p Num=%X\n",
index, object, walk_state, state->results.num_results)); index, object, walk_state, state->results.num_results));
...@@ -124,7 +124,7 @@ acpi_ds_result_remove ( ...@@ -124,7 +124,7 @@ acpi_ds_result_remove (
return (AE_NOT_EXIST); return (AE_NOT_EXIST);
} }
if (index >= OBJ_MAX_OPERAND) { if (index >= ACPI_OBJ_MAX_OPERAND) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Index out of range: %X State=%p Num=%X\n", "Index out of range: %X State=%p Num=%X\n",
index, walk_state, state->results.num_results)); index, walk_state, state->results.num_results));
...@@ -196,7 +196,7 @@ acpi_ds_result_pop ( ...@@ -196,7 +196,7 @@ acpi_ds_result_pop (
state->results.num_results--; state->results.num_results--;
for (index = OBJ_NUM_OPERANDS; index; index--) { for (index = ACPI_OBJ_NUM_OPERANDS; index; index--) {
/* Check for a valid result object */ /* Check for a valid result object */
if (state->results.obj_desc [index -1]) { if (state->results.obj_desc [index -1]) {
...@@ -312,7 +312,7 @@ acpi_ds_result_push ( ...@@ -312,7 +312,7 @@ acpi_ds_result_push (
return (AE_AML_INTERNAL); return (AE_AML_INTERNAL);
} }
if (state->results.num_results == OBJ_NUM_OPERANDS) { if (state->results.num_results == ACPI_OBJ_NUM_OPERANDS) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Result stack overflow: Obj=%p State=%p Num=%X\n", "Result stack overflow: Obj=%p State=%p Num=%X\n",
object, walk_state, state->results.num_results)); object, walk_state, state->results.num_results));
...@@ -440,7 +440,7 @@ acpi_ds_obj_stack_delete_all ( ...@@ -440,7 +440,7 @@ acpi_ds_obj_stack_delete_all (
/* The stack size is configurable, but fixed */ /* The stack size is configurable, but fixed */
for (i = 0; i < OBJ_NUM_OPERANDS; i++) { for (i = 0; i < ACPI_OBJ_NUM_OPERANDS; i++) {
if (walk_state->operands[i]) { if (walk_state->operands[i]) {
acpi_ut_remove_reference (walk_state->operands[i]); acpi_ut_remove_reference (walk_state->operands[i]);
walk_state->operands[i] = NULL; walk_state->operands[i] = NULL;
...@@ -474,7 +474,7 @@ acpi_ds_obj_stack_push ( ...@@ -474,7 +474,7 @@ acpi_ds_obj_stack_push (
/* Check for stack overflow */ /* Check for stack overflow */
if (walk_state->num_operands >= OBJ_NUM_OPERANDS) { if (walk_state->num_operands >= ACPI_OBJ_NUM_OPERANDS) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"overflow! Obj=%p State=%p #Ops=%X\n", "overflow! Obj=%p State=%p #Ops=%X\n",
object, walk_state, walk_state->num_operands)); object, walk_state, walk_state->num_operands));
...@@ -922,7 +922,7 @@ acpi_ds_init_aml_walk ( ...@@ -922,7 +922,7 @@ acpi_ds_init_aml_walk (
/* Init the method arguments */ /* Init the method arguments */
status = acpi_ds_method_data_init_args (params, MTH_NUM_ARGS, walk_state); status = acpi_ds_method_data_init_args (params, ACPI_METHOD_NUM_ARGS, walk_state);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
# #
obj-y := evevent.o evregion.o evsci.o evxfevnt.o \ 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) EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
This diff is collapsed.
This diff is collapsed.
/****************************************************************************** /******************************************************************************
* *
* Module Name: evregion - ACPI Address_space (Op_region) handler dispatch * Module Name: evregion - ACPI Address_space (Op_region) handler dispatch
* $Revision: 135 $ * $Revision: 136 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -172,7 +172,7 @@ acpi_ev_execute_reg_method ( ...@@ -172,7 +172,7 @@ acpi_ev_execute_reg_method (
/* /*
* Execute the method, no return value * 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); status = acpi_ns_evaluate_by_handle (region_obj2->extra.method_REG, params, NULL);
acpi_ut_remove_reference (params[1]); acpi_ut_remove_reference (params[1]);
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evxfevnt - External Interfaces, ACPI event disable/enable * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
* $Revision: 57 $ * $Revision: 59 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -60,18 +60,18 @@ acpi_enable (void) ...@@ -60,18 +60,18 @@ acpi_enable (void)
} }
if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) { if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) {
ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Already in ACPI mode.\n")); ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "System is already in ACPI mode\n"));
} }
else { else {
/* Transition to ACPI mode */ /* Transition to ACPI mode */
status = acpi_hw_set_mode (ACPI_SYS_MODE_ACPI); status = acpi_hw_set_mode (ACPI_SYS_MODE_ACPI);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Could not transition to ACPI mode.\n")); ACPI_REPORT_ERROR (("Could not transition to ACPI mode.\n"));
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Transition to ACPI mode successful\n")); ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Transition to ACPI mode successful\n"));
} }
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
...@@ -104,18 +104,19 @@ acpi_disable (void) ...@@ -104,18 +104,19 @@ acpi_disable (void)
} }
if (acpi_hw_get_mode() == ACPI_SYS_MODE_LEGACY) { if (acpi_hw_get_mode() == ACPI_SYS_MODE_LEGACY) {
ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Already in LEGACY mode.\n")); ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "System is already in legacy (non-ACPI) mode\n"));
} }
else { else {
/* Transition to LEGACY mode */ /* Transition to LEGACY mode */
status = acpi_hw_set_mode (ACPI_SYS_MODE_LEGACY); status = acpi_hw_set_mode (ACPI_SYS_MODE_LEGACY);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not transition to LEGACY mode.")); ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not exit ACPI mode to legacy mode"));
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Transition to LEGACY mode successful\n")); ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "ACPI mode disabled\n"));
} }
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exconvrt - Object conversion routines * Module Name: exconvrt - Object conversion routines
* $Revision: 44 $ * $Revision: 45 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -230,7 +230,7 @@ acpi_ex_convert_to_buffer ( ...@@ -230,7 +230,7 @@ acpi_ex_convert_to_buffer (
* Create a new Buffer object * Create a new Buffer object
* Size will be the string length * 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) { if (!ret_desc) {
return_ACPI_STATUS (AE_NO_MEMORY); return_ACPI_STATUS (AE_NO_MEMORY);
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exfield - ACPI AML (p-code) execution - field manipulation * Module Name: exfield - ACPI AML (p-code) execution - field manipulation
* $Revision: 115 $ * $Revision: 116 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -56,7 +56,7 @@ acpi_ex_read_data_from_field ( ...@@ -56,7 +56,7 @@ acpi_ex_read_data_from_field (
{ {
acpi_status status; acpi_status status;
acpi_operand_object *buffer_desc; acpi_operand_object *buffer_desc;
u32 length; ACPI_SIZE length;
void *buffer; void *buffer;
u8 locked; u8 locked;
...@@ -118,7 +118,7 @@ acpi_ex_read_data_from_field ( ...@@ -118,7 +118,7 @@ acpi_ex_read_data_from_field (
* *
* Note: Field.length is in bits. * Note: Field.length is in bits.
*/ */
length = ACPI_ROUND_BITS_UP_TO_BYTES (obj_desc->field.bit_length); length = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES (obj_desc->field.bit_length);
if (length > acpi_gbl_integer_byte_width) { if (length > acpi_gbl_integer_byte_width) {
/* Field is too large for an Integer, create a Buffer instead */ /* Field is too large for an Integer, create a Buffer instead */
...@@ -143,7 +143,7 @@ acpi_ex_read_data_from_field ( ...@@ -143,7 +143,7 @@ acpi_ex_read_data_from_field (
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Obj=%p Type=%X Buf=%p Len=%X\n", "Obj=%p Type=%X Buf=%p Len=%X\n",
obj_desc, ACPI_GET_OBJECT_TYPE (obj_desc), buffer, length)); obj_desc, ACPI_GET_OBJECT_TYPE (obj_desc), buffer, (u32) length));
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Field_write: Bit_len=%X Bit_off=%X Byte_off=%X\n", "Field_write: Bit_len=%X Bit_off=%X Byte_off=%X\n",
obj_desc->common_field.bit_length, obj_desc->common_field.bit_length,
...@@ -156,7 +156,7 @@ acpi_ex_read_data_from_field ( ...@@ -156,7 +156,7 @@ acpi_ex_read_data_from_field (
/* Read from the field */ /* Read from the field */
status = acpi_ex_extract_from_field (obj_desc, buffer, length); status = acpi_ex_extract_from_field (obj_desc, buffer, (u32) length);
acpi_ex_release_global_lock (locked); acpi_ex_release_global_lock (locked);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
* $Revision: 112 $ * $Revision: 113 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -281,7 +281,7 @@ acpi_ex_do_concatenate ( ...@@ -281,7 +281,7 @@ acpi_ex_do_concatenate (
/* Operand0 is string */ /* Operand0 is string */
new_buf = ACPI_MEM_ALLOCATE ((ACPI_SIZE) obj_desc1->string.length + new_buf = ACPI_MEM_CALLOCATE ((ACPI_SIZE) obj_desc1->string.length +
(ACPI_SIZE) obj_desc2->string.length + 1); (ACPI_SIZE) obj_desc2->string.length + 1);
if (!new_buf) { if (!new_buf) {
ACPI_REPORT_ERROR ACPI_REPORT_ERROR
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exregion - ACPI default Op_region (address space) handlers * Module Name: exregion - ACPI default Op_region (address space) handlers
* $Revision: 80 $ * $Revision: 81 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -133,8 +133,8 @@ acpi_ex_system_memory_space_handler ( ...@@ -133,8 +133,8 @@ acpi_ex_system_memory_space_handler (
* constrain the maximum mapping size to something reasonable. * constrain the maximum mapping size to something reasonable.
*/ */
window_size = (ACPI_SIZE) ((mem_info->address + mem_info->length) - address); window_size = (ACPI_SIZE) ((mem_info->address + mem_info->length) - address);
if (window_size > SYSMEM_REGION_WINDOW_SIZE) { if (window_size > ACPI_SYSMEM_REGION_WINDOW_SIZE) {
window_size = SYSMEM_REGION_WINDOW_SIZE; window_size = ACPI_SYSMEM_REGION_WINDOW_SIZE;
} }
/* Create a new mapping starting at the address given */ /* Create a new mapping starting at the address given */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exstorob - AML Interpreter object store support, store to object * Module Name: exstorob - AML Interpreter object store support, store to object
* $Revision: 46 $ * $Revision: 47 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -65,15 +65,17 @@ acpi_ex_store_buffer_to_buffer ( ...@@ -65,15 +65,17 @@ acpi_ex_store_buffer_to_buffer (
length = source_desc->buffer.length; length = source_desc->buffer.length;
/* /*
* If target is a buffer of length zero, allocate a new * If target is a buffer of length zero or is a static buffer,
* buffer of the proper length * allocate a new buffer of the proper length
*/ */
if (target_desc->buffer.length == 0) { if ((target_desc->buffer.length == 0) ||
(target_desc->common.flags & AOPOBJ_STATIC_POINTER)) {
target_desc->buffer.pointer = ACPI_MEM_ALLOCATE (length); target_desc->buffer.pointer = ACPI_MEM_ALLOCATE (length);
if (!target_desc->buffer.pointer) { if (!target_desc->buffer.pointer) {
return (AE_NO_MEMORY); return (AE_NO_MEMORY);
} }
target_desc->common.flags &= ~AOPOBJ_STATIC_POINTER;
target_desc->buffer.length = length; target_desc->buffer.length = length;
} }
...@@ -137,11 +139,13 @@ acpi_ex_store_string_to_string ( ...@@ -137,11 +139,13 @@ acpi_ex_store_string_to_string (
length = source_desc->string.length; length = source_desc->string.length;
/* /*
* Setting a string value replaces the old string * Replace existing string value if it will fit and the string
* pointer is not a static pointer (part of an ACPI table)
*/ */
if (length < target_desc->string.length) { if ((length < target_desc->string.length) &&
(!(target_desc->common.flags & AOPOBJ_STATIC_POINTER))) {
/* /*
* String will fit in existing buffer. * String will fit in existing non-static buffer.
* Clear old string and copy in the new one * Clear old string and copy in the new one
*/ */
ACPI_MEMSET (target_desc->string.pointer, 0, (ACPI_SIZE) target_desc->string.length + 1); ACPI_MEMSET (target_desc->string.pointer, 0, (ACPI_SIZE) target_desc->string.length + 1);
...@@ -165,6 +169,7 @@ acpi_ex_store_string_to_string ( ...@@ -165,6 +169,7 @@ acpi_ex_store_string_to_string (
return (AE_NO_MEMORY); return (AE_NO_MEMORY);
} }
target_desc->common.flags &= ~AOPOBJ_STATIC_POINTER;
ACPI_MEMCPY (target_desc->string.pointer, buffer, length); ACPI_MEMCPY (target_desc->string.pointer, buffer, length);
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Module Name: hwregs - Read/write access functions for the various ACPI * Module Name: hwregs - Read/write access functions for the various ACPI
* control and status registers. * control and status registers.
* $Revision: 134 $ * $Revision: 137 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -142,6 +142,9 @@ acpi_get_sleep_type_data ( ...@@ -142,6 +142,9 @@ acpi_get_sleep_type_data (
status = acpi_ns_evaluate_by_name ((NATIVE_CHAR *) acpi_gbl_db_sleep_states[sleep_state], status = acpi_ns_evaluate_by_name ((NATIVE_CHAR *) acpi_gbl_db_sleep_states[sleep_state],
NULL, &obj_desc); NULL, &obj_desc);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s while evaluating Sleep_state [%s]\n",
acpi_format_exception (status), acpi_gbl_db_sleep_states[sleep_state]));
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
...@@ -184,8 +187,8 @@ acpi_get_sleep_type_data ( ...@@ -184,8 +187,8 @@ acpi_get_sleep_type_data (
} }
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Bad Sleep object %p type %s\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "While evaluating Sleep_state [%s], bad Sleep object %p type %s\n",
obj_desc, acpi_ut_get_object_type_name (obj_desc))); acpi_gbl_db_sleep_states[sleep_state], obj_desc, acpi_ut_get_object_type_name (obj_desc)));
} }
acpi_ut_remove_reference (obj_desc); acpi_ut_remove_reference (obj_desc);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
* $Revision: 47 $ * $Revision: 48 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -236,7 +236,7 @@ acpi_enter_sleep_state ( ...@@ -236,7 +236,7 @@ acpi_enter_sleep_state (
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (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 */ /* Clear SLP_EN and SLP_TYP fields */
......
This diff is collapsed.
This diff is collapsed.
/****************************************************************************** /******************************************************************************
* *
* Name: acexcep.h - Exception codes returned by the ACPI subsystem * Name: acexcep.h - Exception codes returned by the ACPI subsystem
* $Revision: 64 $ * $Revision: 65 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -75,8 +75,9 @@ ...@@ -75,8 +75,9 @@
#define AE_NO_HARDWARE_RESPONSE (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL) #define AE_NO_HARDWARE_RESPONSE (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL)
#define AE_NO_GLOBAL_LOCK (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL) #define AE_NO_GLOBAL_LOCK (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL)
#define AE_LOGICAL_ADDRESS (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL) #define AE_LOGICAL_ADDRESS (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL)
#define AE_ABORT_METHOD (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL)
#define AE_CODE_ENV_MAX 0x001B #define AE_CODE_ENV_MAX 0x001C
/* /*
* Programmer exceptions * Programmer exceptions
...@@ -199,7 +200,8 @@ NATIVE_CHAR const *acpi_gbl_exception_names_env[] = ...@@ -199,7 +200,8 @@ NATIVE_CHAR const *acpi_gbl_exception_names_env[] =
"AE_ALREADY_ACQUIRED", "AE_ALREADY_ACQUIRED",
"AE_NO_HARDWARE_RESPONSE", "AE_NO_HARDWARE_RESPONSE",
"AE_NO_GLOBAL_LOCK", "AE_NO_GLOBAL_LOCK",
"AE_LOGICAL_ADDRESS" "AE_LOGICAL_ADDRESS",
"AE_ABORT_METHOD"
}; };
NATIVE_CHAR const *acpi_gbl_exception_names_pgm[] = NATIVE_CHAR const *acpi_gbl_exception_names_pgm[] =
......
/****************************************************************************** /******************************************************************************
* *
* Name: acglobal.h - Declarations for global variables * Name: acglobal.h - Declarations for global variables
* $Revision: 132 $ * $Revision: 134 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -141,7 +141,7 @@ ACPI_EXTERN u8 acpi_gbl_events_initialized; ...@@ -141,7 +141,7 @@ ACPI_EXTERN u8 acpi_gbl_events_initialized;
extern u8 acpi_gbl_shutdown; extern u8 acpi_gbl_shutdown;
extern u32 acpi_gbl_startup_flags; extern u32 acpi_gbl_startup_flags;
extern const u8 acpi_gbl_decode_to8bit[8]; extern const u8 acpi_gbl_decode_to8bit[8];
extern const NATIVE_CHAR *acpi_gbl_db_sleep_states[ACPI_NUM_SLEEP_STATES]; extern const NATIVE_CHAR *acpi_gbl_db_sleep_states[ACPI_S_STATE_COUNT];
extern const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; extern const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
extern const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; extern const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
...@@ -253,6 +253,7 @@ ACPI_EXTERN u8 acpi_gbl_db_opt_verbose; ...@@ -253,6 +253,7 @@ ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
#ifdef ACPI_DEBUGGER #ifdef ACPI_DEBUGGER
extern u8 acpi_gbl_method_executing; extern u8 acpi_gbl_method_executing;
extern u8 acpi_gbl_abort_method;
extern u8 acpi_gbl_db_terminate_threads; extern u8 acpi_gbl_db_terminate_threads;
ACPI_EXTERN int optind; ACPI_EXTERN int optind;
......
/****************************************************************************** /******************************************************************************
* *
* Name: aclocal.h - Internal data types used across the ACPI subsystem * Name: aclocal.h - Internal data types used across the ACPI subsystem
* $Revision: 181 $ * $Revision: 182 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -496,7 +496,7 @@ typedef struct acpi_thread_state ...@@ -496,7 +496,7 @@ typedef struct acpi_thread_state
typedef struct acpi_result_values typedef struct acpi_result_values
{ {
ACPI_STATE_COMMON ACPI_STATE_COMMON
union acpi_operand_obj *obj_desc [OBJ_NUM_OPERANDS]; union acpi_operand_obj *obj_desc [ACPI_OBJ_NUM_OPERANDS];
u8 num_results; u8 num_results;
u8 last_insert; u8 last_insert;
......
/****************************************************************************** /******************************************************************************
* *
* Name: acmacros.h - C macros for the entire subsystem. * Name: acmacros.h - C macros for the entire subsystem.
* $Revision: 130 $ * $Revision: 133 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -367,6 +367,8 @@ ...@@ -367,6 +367,8 @@
acpi_os_printf ACPI_PARAM_LIST(fp);} acpi_os_printf ACPI_PARAM_LIST(fp);}
#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_THIS_MODULE,__LINE__,_COMPONENT, s, e); #define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_THIS_MODULE,__LINE__,_COMPONENT, s, e);
#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_THIS_MODULE,__LINE__,_COMPONENT, s, n, p, e);
#else #else
#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info("ACPI",__LINE__,_COMPONENT); \ #define ACPI_REPORT_INFO(fp) {acpi_ut_report_info("ACPI",__LINE__,_COMPONENT); \
...@@ -377,6 +379,8 @@ ...@@ -377,6 +379,8 @@
acpi_os_printf ACPI_PARAM_LIST(fp);} acpi_os_printf ACPI_PARAM_LIST(fp);}
#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error("ACPI",__LINE__,_COMPONENT, s, e); #define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error("ACPI",__LINE__,_COMPONENT, s, e);
#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error("ACPI",__LINE__,_COMPONENT, s, n, p, e);
#endif #endif
/* Error reporting. These versions pass thru the module and line# */ /* Error reporting. These versions pass thru the module and line# */
...@@ -394,7 +398,7 @@ ...@@ -394,7 +398,7 @@
#ifdef ACPI_DEBUG_OUTPUT #ifdef ACPI_DEBUG_OUTPUT
#define ACPI_MODULE_NAME(name) static char *_THIS_MODULE = name; #define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_THIS_MODULE = name;
/* /*
* Function entry tracing. * Function entry tracing.
...@@ -454,7 +458,7 @@ ...@@ -454,7 +458,7 @@
#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) #define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b)
#define ACPI_DUMP_TABLES(a,b) acpi_ns_dump_tables(a,b) #define ACPI_DUMP_TABLES(a,b) acpi_ns_dump_tables(a,b)
#define ACPI_DUMP_PATHNAME(a,b,c,d) (void) acpi_ns_dump_pathname(a,b,c,d) #define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d)
#define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) #define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a)
#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) #define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT)
#define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a)) #define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a))
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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