Commit 5ecc69e4 authored by Linus Torvalds's avatar Linus Torvalds

More Makefile cleanups, otherwise mainly noticeable are the netfilter fix

and the LVM update.

		Linus

- Christoph Rohland: shmfs cleanup
- Nicolas Pitre: don't forget loop.c flags
- Geert Uytterhoeven: new-style m68k Makefiles
- Neil Brown: knfsd cleanups, raid5 re-org
- Andrea Arkangeli: update to LVM-0.9
- LC Chang: sis900 driver doc update
- David Miller: netfilter oops fix
- Andrew Grover: acpi update
parent 4d372877
......@@ -2352,10 +2352,10 @@ CONFIG_AGP
module, say M here and read Documentation/modules.txt. The module
will be called agpgart.o.
Intel 440LX/BX/GX support
Intel 440LX/BX/GX/815/840/850 support
CONFIG_AGP_INTEL
This option gives you AGP support for the GLX component of the
XFree86 4.x on Intel 440LX/BX/GX, 815, and 840 chipsets.
XFree86 4.x on Intel 440LX/BX/GX, 815, 840 and 850 chipsets.
For the moment, you should probably say N, unless you want to test
the GLX component for XFree86 3.3.6, which can be downloaded from
......
BOOKS := wanbook.sgml z8530book.sgml mcabook.sgml videobook.sgml \
kernel-api.sgml parportbook.sgml kernel-hacking.sgml \
kernel-locking.sgml via-audio.sgml mousedrivers.sgml
kernel-locking.sgml via-audio.sgml mousedrivers.sgml sis900.sgml
PS := $(patsubst %.sgml, %.ps, $(BOOKS))
PDF := $(patsubst %.sgml, %.pdf, $(BOOKS))
......@@ -51,6 +51,10 @@ via-audio.sgml: via-audio.tmpl $(TOPDIR)/drivers/sound/via82cxxx_audio.c
$(TOPDIR)/scripts/docgen $(TOPDIR)/drivers/sound/via82cxxx_audio.c \
<via-audio.tmpl >via-audio.sgml
sis900.sgml: sis900.tmpl $(TOPDIR)/drivers/net/sis900.c
$(TOPDIR)/scripts/docgen $(TOPDIR)/drivers/net/sis900.c \
<sis900.tmpl >sis900.sgml
mcabook.sgml: mcabook.tmpl $(TOPDIR)/arch/i386/kernel/mca.c
$(TOPDIR)/scripts/docgen $(TOPDIR)/arch/i386/kernel/mca.c \
<mcabook.tmpl >mcabook.sgml
......
......@@ -155,7 +155,7 @@
</row>
<row>
<entry></entry>
<entry>add 1 (5)</entry>
<entry>add 1 (6)</entry>
</row>
<row>
<entry>write very_important_count (6)</entry>
......
This diff is collapsed.
......@@ -5,14 +5,43 @@ Ollie Lho
Lei Chun Chang
November 16, 2000. Document Revision: 0.3
Copyright © 1999 by Silicon Integrated System Corp.
This document gives some information on installation and usage of SiS
900/7016 device driver under Linux.
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
_________________________________________________________________
Table of Contents
1. Introduction
2. Changes
3. Tested Environment
4. Files in This Package
5. Installation
Building the driver as loadable module
Building the driver into kernel
6. Known Problems and Bugs
7. Revision History
8. Acknowledgements
_________________________________________________________________
Introduction
Chapter 1. Introduction
This document describes the revision 1.06 and 1.07 of SiS 900/7016
Fast Ethernet device driver under Linux. The driver is developed by
......@@ -20,9 +49,8 @@ Introduction
General Public License (GPL). The driver can be compiled as a loadable
module and used under Linux kernel version 2.2.x. (rev. 1.06) With
minimal changes, the driver can also be used under 2.3.x and 2.4.x
kernel (rev. 1.07), please see the section called Installation. If you
are intended to use the driver for earlier kernels, you are on your
own.
kernel (rev. 1.07), please see Chapter 5. If you are intended to use
the driver for earlier kernels, you are on your own.
The driver is tested with usual TCP/IP applications including FTP,
Telnet, Netscape etc. and is used constantly by the developers.
......@@ -30,27 +58,7 @@ Introduction
Please send all comments/fixes/questions to Lei-Chun Chang.
_________________________________________________________________
License
Copyright (C) 1999 Silicon Integrated System Corp.
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 U
SA
_________________________________________________________________
Changes
Chapter 2. Changes
Changes made in Revision 1.07
......@@ -75,9 +83,10 @@ Changes
rule.
14. Support for ICS1893 10/100 Interated PHYceiver.
15. Support for media select by ifconfig.
16. Added kernel-doc extratable documentation.
_________________________________________________________________
Tested Environment
Chapter 3. Tested Environment
This driver is developed on the following hardware
......@@ -93,7 +102,7 @@ Tested Environment
* Samba version 2.0.3
_________________________________________________________________
Files in This Package
Chapter 4. Files in This Package
In the package you can find these files:
......@@ -110,7 +119,7 @@ Files in This Package
Driver document in plain text
_________________________________________________________________
Installation
Chapter 5. Installation
Silicon Integrated System Corp. is cooperating closely with core Linux
Kernel developers. The revisions of SiS 900 driver are distributed by
......@@ -179,11 +188,14 @@ eth0: Using SiS 900 Internal MII PHY as default
Once the driver is loaded, network can be brought up by
/sbin/ifconfig eth0 IPADDR broadcast BROADCAST netmask NETMASK
/sbin/ifconfig eth0 IPADDR broadcast BROADCAST netmask NETMASK media TYPE
where IPADDR, BROADCAST, NETMASK are your IP address, broadcast
address and netmask respectively. For more information on how to
configure network interface, please refer to Networking HOWTO.
address and netmask respectively. TYPE is used to set medium type used
by the device. Typical values are "10baseT"(twisted-pair 10Mbps
Ethernet) or "100baseT" (twisted-pair 100Mbps Ethernet). For more
information on how to configure network interface, please refer to
Networking HOWTO.
The link status is also shown by kernel messages. For example, after
the network interface is activated, you may have the message:
......@@ -212,7 +224,7 @@ make bzlilo
Next time the system reboot, you have the driver in memory.
_________________________________________________________________
Known Problems and Bugs
Chapter 6. Known Problems and Bugs
There are some known problems and bugs. If you find any other bugs
please mail to lcchang@sis.com.tw
......@@ -224,9 +236,11 @@ Known Problems and Bugs
caught before bad things happen and reported with the message:
eth0: NULL pointer encountered in Rx ring, skipping which can be
viewed with dmesg or cat /var/log/message.
3. The media type change from 10Mbps to 100Mbps twisted-pair ethernet
by ifconfig causes the media link down.
_________________________________________________________________
Revision History
Chapter 7. Revision History
* November 13, 2000, Revision 1.07, seventh release, 630E problem
fixed and furthur clean up.
......@@ -235,7 +249,7 @@ Revision History
* August 8, 1999, Revision 1.05, Initial Public Release
_________________________________________________________________
Acknowledgements
Chapter 8. Acknowledgements
This driver was originally derived form Donald Becker's pci-skeleton
and rtl8139 drivers. Donald also provided various suggestion regarded
......
VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 0
EXTRAVERSION = -test13-pre3
EXTRAVERSION = -test13-pre4
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
......@@ -159,7 +159,7 @@ DRIVERS-$(CONFIG_PCMCIA_NETCARD) += drivers/net/pcmcia/pcmcia_net.o
DRIVERS-$(CONFIG_PCMCIA_CHRDEV) += drivers/char/pcmcia/pcmcia_char.o
DRIVERS-$(CONFIG_DIO) += drivers/dio/dio.a
DRIVERS-$(CONFIG_SBUS) += drivers/sbus/sbus_all.o
DRIVERS-$(CONFIG_ZORRO) += drivers/zorro/zorro.a
DRIVERS-$(CONFIG_ZORRO) += drivers/zorro/driver.o
DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a
DRIVERS-$(CONFIG_ALL_PPC) += drivers/macintosh/macintosh.o
DRIVERS-$(CONFIG_MAC) += drivers/macintosh/macintosh.o
......
......@@ -3,6 +3,7 @@
# see Documentation/kbuild/config-language.txt.
#
define_bool CONFIG_ALPHA y
define_bool CONFIG_UID16 n
mainmenu_name "Kernel configuration of Linux for Alpha machines"
......
......@@ -40,6 +40,5 @@ obj-$(CONFIG_SMP) += smp.o smpboot.o trampoline.o
obj-$(CONFIG_X86_LOCAL_APIC) += apic.o
obj-$(CONFIG_X86_IO_APIC) += io_apic.o mpparse.o
obj-$(CONFIG_X86_VISWS_APIC) += visws_apic.o
obj-$(CONFIG_ACPI) += acpi.o
include $(TOPDIR)/Rules.make
/*
* acpi.c - Linux ACPI arch-specific functions
*
* Copyright (C) 1999-2000 Andrew Henroid
*
* 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
*/
/*
* Changes:
* Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 2000/08/31
* - check copy*user return
* - get rid of check_region
* - get rid of verify_area
* Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 2000/09/28
* - do proper release on failure in acpi_claim_ioports and acpi_init
* Andrew Grover <andrew.grover@intel.com> - 2000/11/13
* - Took out support for user-level interpreter. ACPI 2.0 changes preclude
* its maintenance.
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/pm.h>
#define _LINUX
#include <linux/acpi.h>
/* Is there a better way to include this? */
#include <../drivers/acpi/include/acpi.h>
ACPI_PHYSICAL_ADDRESS
acpi_get_rsdp_ptr()
{
ACPI_PHYSICAL_ADDRESS rsdp_phys;
if(ACPI_SUCCESS(acpi_find_root_pointer(&rsdp_phys)))
return rsdp_phys;
else
return 0;
}
......@@ -477,7 +477,7 @@ static int __init copy_e820_map(struct e820entry * biosmap, int nr_map)
if (start < 0x100000ULL && end > 0xA0000ULL) {
if (start < 0xA0000ULL)
add_memory_region(start, 0xA0000ULL-start, type);
if (end < 0x100000ULL)
if (end <= 0x100000ULL)
continue;
start = 0x100000ULL;
size = end - start;
......@@ -518,7 +518,7 @@ void __init setup_memory_region(void)
e820.nr_map = 0;
add_memory_region(0, LOWMEMSIZE(), E820_RAM);
add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
add_memory_region(HIGH_MEMORY, (mem_size << 10) - HIGH_MEMORY, E820_RAM);
}
printk("BIOS-provided physical RAM map:\n");
print_memory_map(who);
......
......@@ -20,7 +20,7 @@
of the stack frame of math_emulate() */
#define SETUP_DATA_AREA(arg) FPU_info = (struct info *) &arg
#define LDT_DESCRIPTOR(s) (((struct desc_struct *)current->mm->segments)[(s) >> 3])
#define LDT_DESCRIPTOR(s) (((struct desc_struct *)current->mm->context.segments)[(s) >> 3])
#define SEG_D_SIZE(x) ((x).b & (3 << 21))
#define SEG_G_BIT(x) ((x).b & (1 << 23))
#define SEG_GRANULARITY(x) (((x).b & (1 << 23)) ? 4096 : 1)
......
......@@ -8,11 +8,11 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := amiga.o
O_OBJS := config.o amiints.o cia.o chipram.o amisound.o
OX_OBJS := amiga_ksyms.o
ifdef CONFIG_AMIGA_PCMCIA
O_OBJS := $(O_OBJS) pcmcia.o
endif
export-objs := amiga_ksyms.o
obj-y := config.o amiints.o cia.o chipram.o amisound.o amiga_ksyms.o
obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o
include $(TOPDIR)/Rules.make
......@@ -8,7 +8,7 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := apollo.o
O_OBJS := config.o dn_ints.o dma.o \
obj-y := config.o dn_ints.o dma.o
include $(TOPDIR)/Rules.make
......@@ -8,14 +8,14 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := atari.o
O_OBJS := config.o time.o debug.o atakeyb.o ataints.o stdma.o atasound.o \
joystick.o stram.o
OX_OBJS := atari_ksyms.o
export-objs := atari_ksyms.o
obj-y := config.o time.o debug.o atakeyb.o ataints.o stdma.o \
atasound.o joystick.o stram.o atari_ksyms.o
ifdef CONFIG_PCI
ifdef CONFIG_HADES
O_OBJS += hades-pci.o
endif
obj-$(CONFIG_HADES) += hades-pci.o
endif
include $(TOPDIR)/Rules.make
......@@ -8,7 +8,7 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := bvme6000.o
O_OBJS := config.o bvmeints.o rtc.o
#OX_OBJS = ksyms.o
obj-y := config.o bvmeints.o rtc.o
include $(TOPDIR)/Rules.make
......@@ -8,10 +8,11 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := hp300.o
O_OBJS := ksyms.o config.o ints.o time.o reboot.o
ifdef CONFIG_VT
O_OBJS += hil.o
endif
export-objs := ksyms.o
obj-y := ksyms.o config.o ints.o time.o reboot.o
obj-$(CONFIG_VT) += hil.o
include $(TOPDIR)/Rules.make
......@@ -17,13 +17,13 @@ all: sun3-head.o kernel.o
endif
O_TARGET := kernel.o
O_OBJS := entry.o process.o traps.o ints.o signal.o ptrace.o \
sys_m68k.o time.o semaphore.o
OX_OBJS := setup.o m68k_ksyms.o
ifdef CONFIG_PCI
O_OBJS += bios32.o
endif
export-objs := setup.o m68k_ksyms.o
obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \
sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o
obj-$(CONFIG_PCI) += bios32.o
head.o: head.S m68k_defs.h
......
......@@ -6,6 +6,8 @@
$(CC) $(AFLAGS) -traditional -c $< -o $@
L_TARGET = lib.a
L_OBJS = ashrdi3.o lshrdi3.o checksum.o memcpy.o memcmp.o memset.o semaphore.o muldi3.o
obj-y := ashrdi3.o lshrdi3.o checksum.o memcpy.o memcmp.o memset.o \
semaphore.o muldi3.o
include $(TOPDIR)/Rules.make
......@@ -8,8 +8,10 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := mac.o
OX_OBJS := mac_ksyms.o
O_OBJS := config.o bootparse.o macints.o iop.o via.o oss.o psc.o \
baboon.o macboing.o debug.o misc.o
export-objs := mac_ksyms.o
obj-y := config.o bootparse.o macints.o iop.o via.o oss.o psc.o \
baboon.o macboing.o debug.o misc.o mac_ksyms.o
include $(TOPDIR)/Rules.make
......@@ -13,7 +13,8 @@
#EXTRA_CFLAGS=-DFPU_EMU_DEBUG
O_TARGET := mathemu.o
O_OBJS := fp_entry.o fp_scan.o fp_util.o fp_move.o fp_movem.o \
fp_cond.o fp_arith.o fp_log.o fp_trig.o
obj-y := fp_entry.o fp_scan.o fp_util.o fp_move.o fp_movem.o \
fp_cond.o fp_arith.o fp_log.o fp_trig.o
include $(TOPDIR)/Rules.make
......@@ -8,12 +8,13 @@
# Note 2! The CFLAGS definition is now in the main makefile...
O_TARGET := mm.o
O_OBJS := init.o fault.o extable.o hwtest.o
obj-y := init.o fault.o extable.o hwtest.o
ifndef CONFIG_SUN3
O_OBJS += kmap.o memory.o motorola.o
obj-y += kmap.o memory.o motorola.o
else
O_OBJS += sun3mmu.o
obj-y += sun3mmu.o
endif
......
......@@ -7,8 +7,8 @@
#
O_TARGET := mvme147.o
O_OBJS := config.o 147ints.o
obj-y := config.o 147ints.o
include $(TOPDIR)/Rules.make
......@@ -8,7 +8,9 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := mvme16x.o
O_OBJS := config.o 16xints.o rtc.o
OX_OBJS := mvme16x_ksyms.o
export-objs := mvme16x_ksyms.o
obj-y := config.o 16xints.o rtc.o mvme16x_ksyms.o
include $(TOPDIR)/Rules.make
......@@ -8,7 +8,7 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := q40.o
O_OBJS := config.o q40ints.o
obj-y := config.o q40ints.o
include $(TOPDIR)/Rules.make
......@@ -11,7 +11,10 @@
$(CC) $(AFLAGS) -traditional -Wa,-m68020 -c $< -o $*.o
O_TARGET := sun3.o
O_OBJS := config.o idprom.o mmu_emu.o sun3ints.o leds.o dvma.o sbus.o intersil.o
OX_OBJS := sun3_ksyms.o
export-objs := sun3_ksyms.o
obj-y := config.o idprom.o mmu_emu.o sun3ints.o leds.o dvma.o \
sbus.o intersil.o sun3_ksyms.o
include $(TOPDIR)/Rules.make
......@@ -8,7 +8,7 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := sun3x.o
O_OBJS := config.o time.o dvma.o sbus.o
OX_OBJS :=
obj-y := config.o time.o dvma.o sbus.o
include $(TOPDIR)/Rules.make
......@@ -9,9 +9,11 @@
O_TARGET := amiga.o
obj-y := config.o amiints.o cia.o time.o bootinfo.o amisound.o chipram.o
export-objs := amiga_ksyms.o
objs-$(CONFIG_AMIGA_PCMCIA) += pcmia.o
obj-y := config.o amiints.o cia.o time.o bootinfo.o amisound.o \
chipram.o amiga_ksyms.o
obj-$(CONFIG_AMIGA_PCMCIA) += pcmia.o
include $(TOPDIR)/Rules.make
......@@ -31,7 +31,7 @@ obj-$(CONFIG_ACPI) += os.o ksyms.o
ifdef CONFIG_ACPI_KERNEL_CONFIG
obj-$(CONFIG_ACPI) += acpiconf.o osconf.o
else
obj-$(CONFIG_ACPI) += driver.o cmbatt.o cpu.o ec.o ksyms.o sys.o table.o
obj-$(CONFIG_ACPI) += driver.o cmbatt.o cpu.o ec.o ksyms.o sys.o table.o power.o
endif
include $(TOPDIR)/Rules.make
......
This diff is collapsed.
/******************************************************************************
*
* Module Name: cmcopy - Internal to external object translation utilities
* $Revision: 59 $
* $Revision: 61 $
*
*****************************************************************************/
......@@ -102,7 +102,7 @@ acpi_cm_build_external_simple_object (
case ACPI_TYPE_STRING:
length = internal_obj->string.length;
length = internal_obj->string.length + 1;
external_obj->string.length = internal_obj->string.length;
external_obj->string.pointer = (NATIVE_CHAR *) data_space;
source_ptr = (u8 *) internal_obj->string.pointer;
......
/******************************************************************************
*
* Module Name: cminit - Common ACPI subsystem initialization
* $Revision: 89 $
* $Revision: 91 $
*
*****************************************************************************/
......@@ -53,7 +53,7 @@
static ACPI_STATUS
acpi_cm_fadt_register_error (
NATIVE_CHAR *register_name,
UINT64 value)
u32 value)
{
REPORT_ERROR (
......@@ -96,25 +96,25 @@ acpi_cm_validate_fadt (
if (!acpi_gbl_FADT->pm1_cnt_len) {
status = acpi_cm_fadt_register_error ("PM1_CNT_LEN",
(u32) acpi_gbl_FADT->pm1_cnt_len);
0);
}
if (!acpi_gbl_FADT->Xpm1a_evt_blk.address) {
if (!ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xpm1a_evt_blk.address)) {
status = acpi_cm_fadt_register_error ("PM1a_EVT_BLK",
acpi_gbl_FADT->Xpm1a_evt_blk.address);
0);
}
if (!acpi_gbl_FADT->Xpm1a_cnt_blk.address) {
if (!ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xpm1a_cnt_blk.address)) {
status = acpi_cm_fadt_register_error ("PM1a_CNT_BLK",
acpi_gbl_FADT->Xpm1a_cnt_blk.address);
0);
}
if (!acpi_gbl_FADT->Xpm_tmr_blk.address) {
if (!ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xpm_tmr_blk.address)) {
status = acpi_cm_fadt_register_error ("PM_TMR_BLK",
acpi_gbl_FADT->Xpm_tmr_blk.address);
0);
}
if ((acpi_gbl_FADT->Xpm2_cnt_blk.address &&
if ((ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xpm2_cnt_blk.address) &&
!acpi_gbl_FADT->pm2_cnt_len))
{
status = acpi_cm_fadt_register_error ("PM2_CNT_LEN",
......@@ -129,14 +129,14 @@ acpi_cm_validate_fadt (
/* length of GPE blocks must be a multiple of 2 */
if (acpi_gbl_FADT->Xgpe0blk.address &&
if (ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xgpe0blk.address) &&
(acpi_gbl_FADT->gpe0blk_len & 1))
{
status = acpi_cm_fadt_register_error ("GPE0_BLK_LEN",
(u32) acpi_gbl_FADT->gpe0blk_len);
}
if (acpi_gbl_FADT->Xgpe1_blk.address &&
if (ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xgpe1_blk.address) &&
(acpi_gbl_FADT->gpe1_blk_len & 1))
{
status = acpi_cm_fadt_register_error ("GPE1_BLK_LEN",
......
/******************************************************************************
*
* Module Name: cmobject - ACPI object create/delete/size/cache routines
* $Revision: 32 $
* $Revision: 34 $
*
*****************************************************************************/
......@@ -424,7 +424,7 @@ acpi_cm_get_simple_object_size (
case ACPI_TYPE_STRING:
length += internal_obj->string.length;
length += internal_obj->string.length + 1;
break;
......
/******************************************************************************
*
* Module Name: dswstate - Dispatcher parse tree walk management routines
* $Revision: 35 $
* $Revision: 36 $
*
*****************************************************************************/
......@@ -253,7 +253,7 @@ acpi_ds_result_pop_from_bottom (
return (AE_AML_NO_OPERAND);
}
return (AE_OK);
}
......
......@@ -17,6 +17,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* Changes
* David Woodhouse <dwmw2@redhat.com> 2000-12-6
* - Fix interruptible_sleep_on() races
*/
#include <linux/config.h>
#include <linux/module.h>
......@@ -32,6 +37,12 @@
#include "acpi.h"
#include "driver.h"
#ifdef CONFIG_ACPI_KERNEL_CONFIG
#include <asm/efi.h>
#define ACPI_CAN_USE_EFI_STRUCT
#endif
#define _COMPONENT OS_DEPENDENT
MODULE_NAME ("driver")
......@@ -193,8 +204,12 @@ acpi_do_event(ctl_table * ctl,
return 0;
}
for (;;) {
while (!event_status) {
unsigned long flags;
DECLARE_WAITQUEUE(wait, current);
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&acpi_event_wait, &wait);
// we need an atomic exchange here
spin_lock_irqsave(&acpi_event_lock, flags);
......@@ -203,11 +218,12 @@ acpi_do_event(ctl_table * ctl,
spin_unlock_irqrestore(&acpi_event_lock, flags);
event_state = acpi_event_state;
if (event_status)
break;
if (!event_status)
schedule();
remove_wait_queue(&acpi_event_wait, &wait);
set_current_state(TASK_RUNNING);
// wait for an event to arrive
interruptible_sleep_on(&acpi_event_wait);
if (signal_pending(current))
return -ERESTARTSYS;
}
......@@ -412,12 +428,14 @@ acpi_thread(void *context)
return -ENODEV;
}
/* arch-specific call to get rsdp ptr */
rsdp_phys = acpi_get_rsdp_ptr();
if (!rsdp_phys) {
#ifndef ACPI_CAN_USE_EFI_STRUCT
if (!ACPI_SUCCESS(acpi_find_root_pointer(&rsdp_phys))) {
printk(KERN_ERR "ACPI: System description tables not found\n");
return -ENODEV;
}
#else
rsdp_phys = efi.acpi;
#endif
printk(KERN_ERR "ACPI: System description tables found\n");
......@@ -443,7 +461,7 @@ acpi_thread(void *context)
acpi_cpu_init();
acpi_sys_init();
acpi_ec_init();
acpi_cmbatt_init();
acpi_power_init();
/*
* Non-intuitive: 0 means pwr and sleep are implemented using the fixed
......@@ -474,9 +492,20 @@ acpi_thread(void *context)
* run
*/
for (;;) {
interruptible_sleep_on(&acpi_thread_wait);
DECLARE_WAITQUEUE(wait, current);
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&acpi_thread_wait, &wait);
if (list_empty(&acpi_thread_run))
schedule();
remove_wait_queue(&acpi_thread_wait, &wait);
set_current_state(TASK_RUNNING);
if (signal_pending(current))
break;
run_task_queue(&acpi_thread_run);
}
......
......@@ -53,9 +53,9 @@ int acpi_run(void (*callback)(void*), void *context);
int acpi_ec_init(void);
/*
* cmbatt.c
* power.c
*/
int acpi_cmbatt_init(void);
int acpi_power_init(void);
/*
* sys.c
......
This diff is collapsed.
/*
* Copyright (C) 2000 Andrew Grover
*
* 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
*/
#ifndef __EC_H__
#define __EC_H__
// TODO: Linux-specific
#include <linux/spinlock.h>
#include <asm/semaphore.h>
#include <actypes.h>
#include <acexcep.h>
/*****************************************************************************
* Types & Other Defines
*****************************************************************************/
#define EC_DEFAULT_TIMEOUT 1000 /* 1 second */
#define EC_GPE_UNKNOWN 0xFFFFFFFF
#define EC_PORT_UNKNOWN 0x00000000
#define EC_BURST_ENABLE_ACKNOWLEDGE 0x90
/*
* EC_COMMAND:
* -----------
*/
typedef UINT8 EC_COMMAND;
#define EC_COMMAND_UNKNOWN ((EC_COMMAND) 0x00)
#define EC_COMMAND_READ ((EC_COMMAND) 0x80)
#define EC_COMMAND_WRITE ((EC_COMMAND) 0x81)
#define EC_COMMAND_QUERY ((EC_COMMAND) 0x84)
/*
* EC_STATUS:
* ----------
* The encoding of the EC status register is illustrated below.
* Note that a set bit (1) indicates the property is TRUE
* (e.g. if bit 0 is set then the output buffer is full).
* +-+-+-+-+-+-+-+-+
* |7|6|5|4|3|2|1|0|
* +-+-+-+-+-+-+-+-+
* | | | | | | | |
* | | | | | | | +- Output Buffer Full (OBF)?
* | | | | | | +--- Input Buffer Full (IBF)?
* | | | | | +----- <reserved>
* | | | | +------- data Register is command Byte?
* | | | +--------- Burst Mode Enabled?
* | | +----------- SCI event?
* | +------------- SMI event?
* +--------------- <Reserved>
*
*/
typedef UINT8 EC_STATUS;
#define EC_FLAG_OUTPUT_BUFFER ((EC_STATUS) 0x01)
#define EC_FLAG_INPUT_BUFFER ((EC_STATUS) 0x02)
#define EC_FLAG_BURST_MODE ((EC_STATUS) 0x10)
#define EC_FLAG_SCI ((EC_STATUS) 0x20)
/*
* EC_EVENT:
* ---------
*/
typedef UINT8 EC_EVENT;
#define EC_EVENT_UNKNOWN ((EC_EVENT) 0x00)
#define EC_EVENT_NONE ((EC_EVENT) 0x00)
#define EC_EVENT_OUTPUT_BUFFER_FULL ((EC_EVENT) 0x01)
#define EC_EVENT_INPUT_BUFFER_EMPTY ((EC_EVENT) 0x02)
#define EC_EVENT_SCI ((EC_EVENT) 0x03)
/*
* EC_REQUEST:
* -----------
*/
typedef struct
{
EC_COMMAND command;
UINT8 address;
UINT8 data;
} EC_REQUEST;
#endif /* __EC_H__ */
......@@ -2,7 +2,7 @@
*
* Module Name: evevent - Fixed and General Purpose Acpi_event
* handling and dispatch
* $Revision: 30 $
* $Revision: 32 $
*
*****************************************************************************/
......@@ -375,10 +375,10 @@ acpi_ev_gpe_initialize (void)
for (i = 0; i < gpe0register_count; i++) {
acpi_gbl_gpe_registers[register_index].status_addr =
(u16) (acpi_gbl_FADT->Xgpe0blk.address + i);
(u16) (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe0blk.address) + i);
acpi_gbl_gpe_registers[register_index].enable_addr =
(u16) (acpi_gbl_FADT->Xgpe0blk.address + i + gpe0register_count);
(u16) (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe0blk.address) + i + gpe0register_count);
acpi_gbl_gpe_registers[register_index].gpe_base = (u8) MUL_8 (i);
......@@ -402,10 +402,10 @@ acpi_ev_gpe_initialize (void)
for (i = 0; i < gpe1_register_count; i++) {
acpi_gbl_gpe_registers[register_index].status_addr =
(u16) (acpi_gbl_FADT->Xgpe1_blk.address + i);
(u16) (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe1_blk.address) + i);
acpi_gbl_gpe_registers[register_index].enable_addr =
(u16) (acpi_gbl_FADT->Xgpe1_blk.address + i + gpe1_register_count);
(u16) (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe1_blk.address) + i + gpe1_register_count);
acpi_gbl_gpe_registers[register_index].gpe_base =
(u8) (acpi_gbl_FADT->gpe1_base + MUL_8 (i));
......
/******************************************************************************
*
* Module Name: evregion - ACPI Address_space (Op_region) handler dispatch
* $Revision: 90 $
* $Revision: 93 $
*
*****************************************************************************/
......@@ -292,8 +292,8 @@ acpi_ev_address_space_dispatch (
*
* FUNCTION: Acpi_ev_disassociate_region_from_handler
*
* PARAMETERS: Handler_obj - Handler Object
* Region_obj - Region Object
* PARAMETERS: Region_obj - Region Object
* Acpi_ns_is_locked - Namespace Region Already Locked?
*
* RETURN: None
*
......@@ -304,7 +304,8 @@ acpi_ev_address_space_dispatch (
void
acpi_ev_disassociate_region_from_handler(
ACPI_OPERAND_OBJECT *region_obj)
ACPI_OPERAND_OBJECT *region_obj,
u8 acpi_ns_is_locked)
{
ACPI_OPERAND_OBJECT *handler_obj;
ACPI_OPERAND_OBJECT *obj_desc;
......@@ -347,11 +348,19 @@ acpi_ev_disassociate_region_from_handler(
*last_obj_ptr = obj_desc->region.next;
obj_desc->region.next = NULL; /* Must clear field */
if (acpi_ns_is_locked) {
acpi_cm_release_mutex (ACPI_MTX_NAMESPACE);
}
/*
* Now stop region accesses by executing the _REG method
*/
acpi_ev_execute_reg_method (region_obj, 0);
if (acpi_ns_is_locked) {
acpi_cm_acquire_mutex (ACPI_MTX_NAMESPACE);
}
/*
* Call the setup handler with the deactivate notification
*/
......@@ -404,6 +413,7 @@ acpi_ev_disassociate_region_from_handler(
*
* PARAMETERS: Handler_obj - Handler Object
* Region_obj - Region Object
* Acpi_ns_is_locked - Namespace Region Already Locked?
*
* RETURN: None
*
......@@ -589,7 +599,7 @@ acpi_ev_addr_handler_helper (
*
* First disconnect region for any previous handler (if any)
*/
acpi_ev_disassociate_region_from_handler (obj_desc);
acpi_ev_disassociate_region_from_handler (obj_desc, FALSE);
/*
* Then connect the region to the new handler
......
......@@ -2,7 +2,7 @@
*
* Module Name: evxfregn - External Interfaces, ACPI Operation Regions and
* Address Spaces.
* $Revision: 24 $
* $Revision: 26 $
*
*****************************************************************************/
......@@ -337,7 +337,7 @@ acpi_remove_address_space_handler (
* The region is just inaccessible as indicated to
* the _REG method
*/
acpi_ev_disassociate_region_from_handler(region_obj);
acpi_ev_disassociate_region_from_handler(region_obj, FALSE);
/*
* Walk the list, since we took the first region and it
......
/******************************************************************************
*
* Module Name: hwacpi - ACPI hardware functions - mode and timer
* $Revision: 32 $
* $Revision: 34 $
*
*****************************************************************************/
......@@ -126,7 +126,9 @@ acpi_hw_initialize (
* block is not fixed, so the buffer must be allocated with malloc
*/
if (acpi_gbl_FADT->Xgpe0blk.address && acpi_gbl_FADT->gpe0blk_len) {
if (ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xgpe0blk.address) &&
acpi_gbl_FADT->gpe0blk_len)
{
/* GPE0 specified in FADT */
acpi_gbl_gpe0enable_register_save =
......@@ -147,7 +149,9 @@ acpi_hw_initialize (
acpi_gbl_gpe0enable_register_save = NULL;
}
if (acpi_gbl_FADT->Xgpe1_blk.address && acpi_gbl_FADT->gpe1_blk_len) {
if (ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xgpe1_blk.address) &&
acpi_gbl_FADT->gpe1_blk_len)
{
/* GPE1 defined */
acpi_gbl_gpe1_enable_register_save =
......@@ -317,7 +321,7 @@ acpi_hw_pmt_ticks (void)
{
u32 ticks;
ticks = acpi_os_in32 ((ACPI_IO_ADDRESS) acpi_gbl_FADT->Xpm_tmr_blk.address);
ticks = acpi_os_in32 ((ACPI_IO_ADDRESS) ACPI_GET_ADDRESS (acpi_gbl_FADT->Xpm_tmr_blk.address));
return (ticks);
}
......
......@@ -3,7 +3,7 @@
*
* Module Name: hwregs - Read/write access functions for the various ACPI
* control and status registers.
* $Revision: 84 $
* $Revision: 86 $
*
******************************************************************************/
......@@ -90,8 +90,8 @@ acpi_hw_clear_acpi_status (void)
acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, PM1_STS, ALL_FIXED_STS_BITS);
if (acpi_gbl_FADT->Xpm1b_evt_blk.address) {
acpi_os_out16 ((ACPI_IO_ADDRESS) acpi_gbl_FADT->Xpm1b_evt_blk.address,
if (ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xpm1b_evt_blk.address)) {
acpi_os_out16 ((ACPI_IO_ADDRESS) ACPI_GET_ADDRESS (acpi_gbl_FADT->Xpm1b_evt_blk.address),
(u16) ALL_FIXED_STS_BITS);
}
......@@ -101,7 +101,7 @@ acpi_hw_clear_acpi_status (void)
gpe_length = (u16) DIV_2 (acpi_gbl_FADT->gpe0blk_len);
for (index = 0; index < gpe_length; index++) {
acpi_os_out8 ((ACPI_IO_ADDRESS) (acpi_gbl_FADT->Xgpe0blk.address + index),
acpi_os_out8 ((ACPI_IO_ADDRESS) (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe0blk.address) + index),
(u8) 0xff);
}
}
......@@ -110,7 +110,7 @@ acpi_hw_clear_acpi_status (void)
gpe_length = (u16) DIV_2 (acpi_gbl_FADT->gpe1_blk_len);
for (index = 0; index < gpe_length; index++) {
acpi_os_out8 ((ACPI_IO_ADDRESS) (acpi_gbl_FADT->Xgpe1_blk.address + index),
acpi_os_out8 ((ACPI_IO_ADDRESS) (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe1_blk.address) + index),
(u8) 0xff);
}
}
......@@ -816,7 +816,7 @@ acpi_hw_low_level_read (
* a non-zero address within
*/
if ((!reg) ||
(!reg->address))
(!ACPI_VALID_ADDRESS (reg->address)))
{
return 0;
}
......@@ -831,7 +831,7 @@ acpi_hw_low_level_read (
{
case ADDRESS_SPACE_SYSTEM_MEMORY:
mem_address = (ACPI_PHYSICAL_ADDRESS) reg->address + offset;
mem_address = (ACPI_PHYSICAL_ADDRESS) (ACPI_GET_ADDRESS (reg->address) + offset);
switch (width)
{
......@@ -850,7 +850,7 @@ acpi_hw_low_level_read (
case ADDRESS_SPACE_SYSTEM_IO:
io_address = (ACPI_IO_ADDRESS) reg->address + offset;
io_address = (ACPI_IO_ADDRESS) (ACPI_GET_ADDRESS (reg->address) + offset);
switch (width)
{
......@@ -869,8 +869,8 @@ acpi_hw_low_level_read (
case ADDRESS_SPACE_PCI_CONFIG:
pci_dev_func = ACPI_PCI_DEVFUN (reg->address);
pci_register = ACPI_PCI_REGISTER (reg->address) + offset;
pci_dev_func = ACPI_PCI_DEVFUN (ACPI_GET_ADDRESS (reg->address));
pci_register = ACPI_PCI_REGISTER (ACPI_GET_ADDRESS (reg->address)) + offset;
switch (width)
{
......@@ -925,7 +925,7 @@ acpi_hw_low_level_write (
* a non-zero address within
*/
if ((!reg) ||
(!reg->address))
(!ACPI_VALID_ADDRESS (reg->address)))
{
return;
}
......@@ -940,7 +940,7 @@ acpi_hw_low_level_write (
{
case ADDRESS_SPACE_SYSTEM_MEMORY:
mem_address = (ACPI_PHYSICAL_ADDRESS) reg->address + offset;
mem_address = (ACPI_PHYSICAL_ADDRESS) (ACPI_GET_ADDRESS (reg->address) + offset);
switch (width)
{
......@@ -959,7 +959,7 @@ acpi_hw_low_level_write (
case ADDRESS_SPACE_SYSTEM_IO:
io_address = (ACPI_IO_ADDRESS) reg->address + offset;
io_address = (ACPI_IO_ADDRESS) (ACPI_GET_ADDRESS (reg->address) + offset);
switch (width)
{
......@@ -978,8 +978,8 @@ acpi_hw_low_level_write (
case ADDRESS_SPACE_PCI_CONFIG:
pci_dev_func = ACPI_PCI_DEVFUN (reg->address);
pci_register = ACPI_PCI_REGISTER (reg->address) + offset;
pci_dev_func = ACPI_PCI_DEVFUN (ACPI_GET_ADDRESS (reg->address));
pci_register = ACPI_PCI_REGISTER (ACPI_GET_ADDRESS (reg->address)) + offset;
switch (width)
{
......
/******************************************************************************
*
* Name: acevents.h - Event subcomponent prototypes and defines
* $Revision: 60 $
* $Revision: 62 $
*
*****************************************************************************/
......@@ -123,7 +123,8 @@ acpi_ev_addr_handler_helper (
void
acpi_ev_disassociate_region_from_handler(
ACPI_OPERAND_OBJECT *region_obj);
ACPI_OPERAND_OBJECT *region_obj,
u8 acpi_ns_is_locked);
ACPI_STATUS
......
/******************************************************************************
*
* Name: aclinux.h - OS specific defines, etc.
* $Revision: 4 $
* $Revision: 6 $
*
*****************************************************************************/
......@@ -48,20 +48,4 @@
#define ACPI_NO_INTEGER64_SUPPORT
#endif
#if 0
/* Use native Linux string library */
#define ACPI_USE_SYSTEM_CLIBRARY
/* Special functions */
#define strtoul simple_strtoul
/* Linux clib doesn't to strupr, but we do. */
char *
strupr(char *str);
#endif /* 0 */
#endif /* __ACLINUX_H__ */
/******************************************************************************
*
* Name: aclocal.h - Internal data types used across the ACPI subsystem
* $Revision: 93 $
* $Revision: 95 $
*
*****************************************************************************/
......@@ -178,8 +178,11 @@ typedef struct acpi_node
#define ANOBJ_AML_ATTACHMENT 0x01
#define ANOBJ_END_OF_PEER_LIST 0x02
#define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */
#define ANOBJ_METHOD_ARG 0x40
#define ANOBJ_METHOD_LOCAL 0x80
#define ANOBJ_METHOD_ARG 0x08
#define ANOBJ_METHOD_LOCAL 0x10
#define ANOBJ_METHOD_NO_RETVAL 0x20
#define ANOBJ_METHOD_SOME_NO_RETVAL 0x40
/*
* ACPI Table Descriptor. One per ACPI table
......
/******************************************************************************
*
* Name: acmacros.h - C macros for the entire subsystem.
* $Revision: 56 $
* $Revision: 59 $
*
*****************************************************************************/
......@@ -63,6 +63,15 @@
#define HI_LIMIT(b) ((u8) (((b) & 0x00FF0000) >> 16))
#ifdef _IA16
#define ACPI_GET_ADDRESS(a) ((a).lo)
#define ACPI_STORE_ADDRESS(a,b) {(a).hi=0;(a).lo=(b);}
#define ACPI_VALID_ADDRESS(a) ((a).hi && (a).lo)
#else
#define ACPI_GET_ADDRESS(a) (a)
#define ACPI_STORE_ADDRESS(a,b) ((a)=(b))
#define ACPI_VALID_ADDRESS(a) (a)
#endif
/*
* Extract a byte of data using a pointer. Any more than a byte and we
* get into potential aligment issues -- see the STORE macros below
......@@ -167,9 +176,16 @@
#define ACPI_PCI_FUNCTION(a) (u32) ((((a) & ACPI_PCI_FUNCTION_MASK) >> 16))
#define ACPI_PCI_DEVICE(a) (u32) ((((a) & ACPI_PCI_DEVICE_MASK) >> 32))
#ifndef _IA16
#define ACPI_PCI_REGISTER(a) (u32) (((a) & ACPI_PCI_REGISTER_MASK))
#define ACPI_PCI_DEVFUN(a) (u32) ((ACPI_PCI_DEVICE(a) << 16) | ACPI_PCI_FUNCTION(a))
#else
#define ACPI_PCI_REGISTER(a) (u32) (((a) & 0x0000FFFF))
#define ACPI_PCI_DEVFUN(a) (u32) ((((a) & 0xFFFF0000) >> 16))
#endif
/*
* An ACPI_HANDLE (which is actually an ACPI_NAMESPACE_NODE *) can appear in some contexts,
......
/******************************************************************************
*
* Name: acnamesp.h - Namespace subcomponent prototypes and defines
* $Revision: 98 $
* $Revision: 100 $
*
*****************************************************************************/
......@@ -56,6 +56,7 @@
#define NS_SEARCH_PARENT 0x01
#define NS_DONT_OPEN_SCOPE 0x02
#define NS_NO_PEER_SEARCH 0x04
#define NS_ERROR_IF_FOUND 0x08
#define NS_WALK_UNLOCK TRUE
#define NS_WALK_NO_UNLOCK FALSE
......
/******************************************************************************
*
* Name: acpiosd.h - All interfaces to the OS-dependent layer. These
* interfaces must be implemented by the OS-dependent
* front-end to the ACPI subsystem.
* Name: acpiosxf.h - All interfaces to the OS-dependent layer. These
* interfaces must be implemented by the OS-dependent
* front-end to the ACPI subsystem.
*
*****************************************************************************/
......@@ -35,10 +35,10 @@
/* Priorities for Acpi_os_queue_for_execution */
#define OSD_PRIORITY_HIGH 1
#define OSD_PRIORITY_MED 2
#define OSD_PRIORITY_LO 3
#define OSD_PRIORITY_GPE OSD_PRIORITY_HIGH
#define OSD_PRIORITY_GPE 1
#define OSD_PRIORITY_HIGH 2
#define OSD_PRIORITY_MED 3
#define OSD_PRIORITY_LO 4
#define ACPI_NO_UNIT_LIMIT ((u32) -1)
#define ACPI_MUTEX_SEM 1
......
/******************************************************************************
*
* Name: acxface.h - External interfaces to the ACPI subsystem
* Name: acpixf.h - External interfaces to the ACPI subsystem
*
*****************************************************************************/
......
/******************************************************************************
*
* Name: actypes.h - Common data types for the entire ACPI subsystem
* $Revision: 155 $
* $Revision: 159 $
*
*****************************************************************************/
......@@ -85,12 +85,19 @@ typedef long INT32;
typedef int INT16;
typedef unsigned long UINT32;
typedef struct
{
UINT32 Lo;
UINT32 Hi;
} UINT64;
typedef UINT16 NATIVE_UINT;
typedef INT16 NATIVE_INT;
typedef UINT32 ACPI_TBLPTR;
typedef UINT32 ACPI_IO_ADDRESS;
typedef UINT32 ACPI_PHYSICAL_ADDRESS;
typedef void *ACPI_PHYSICAL_ADDRESS;
#define ALIGNED_ADDRESS_BOUNDARY 0x00000002
#define _HW_ALIGNMENT_SUPPORT
......@@ -197,19 +204,23 @@ typedef void* ACPI_HANDLE; /* Actually a ptr to an
*/
#ifdef ACPI_NO_INTEGER64_SUPPORT
/* 32-bit Integers */
/* 32-bit integers only, no 64-bit support */
typedef u32 ACPI_INTEGER;
#define ACPI_INTEGER_MAX ACPI_UINT32_MAX;
#define ACPI_INTEGER_MAX ACPI_UINT32_MAX
#define ACPI_INTEGER_BIT_SIZE 32
#define ACPI_MAX_BCD_VALUE 99999999
#define ACPI_MAX_BCD_DIGITS 8
#else
/* 64-bit Integers */
/* 64-bit integers */
typedef UINT64 ACPI_INTEGER;
#define ACPI_INTEGER_MAX ACPI_UINT64_MAX;
#define ACPI_INTEGER_MAX ACPI_UINT64_MAX
#define ACPI_INTEGER_BIT_SIZE 64
#define ACPI_MAX_BCD_VALUE 9999999999999999
#define ACPI_MAX_BCD_DIGITS 16
#endif
......@@ -676,7 +687,7 @@ typedef struct
typedef struct
{
UINT64 mapped_physical_address;
ACPI_PHYSICAL_ADDRESS mapped_physical_address;
u8 *mapped_logical_address;
u32 mapped_length;
} MEM_HANDLER_CONTEXT;
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: ammonad - ACPI AML (p-code) execution for monadic operators
* $Revision: 85 $
* $Revision: 88 $
*
*****************************************************************************/
......@@ -239,10 +239,9 @@ acpi_aml_exec_monadic2_r (
ACPI_OPERAND_OBJECT *ret_desc2 = NULL;
u32 res_val;
ACPI_STATUS status;
u32 d0;
u32 d1;
u32 d2;
u32 d3;
u32 i;
u32 j;
ACPI_INTEGER digit;
/* Resolve all operands */
......@@ -330,19 +329,32 @@ acpi_aml_exec_monadic2_r (
case AML_FROM_BCD_OP:
/* TBD: for ACPI 2.0, expand to 64 bits */
/*
* The 64-bit ACPI integer can hold 16 4-bit BCD integers
*/
ret_desc->number.value = 0;
for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) {
/* Get one BCD digit */
d0 = (u32) (obj_desc->number.value & 15);
d1 = (u32) (obj_desc->number.value >> 4 & 15);
d2 = (u32) (obj_desc->number.value >> 8 & 15);
d3 = (u32) (obj_desc->number.value >> 12 & 15);
digit = (ACPI_INTEGER) ((obj_desc->number.value >> (i * 4)) & 0xF);
if (d0 > 9 || d1 > 9 || d2 > 9 || d3 > 9) {
status = AE_AML_NUMERIC_OVERFLOW;
goto cleanup;
}
/* Check the range of the digit */
if (digit > 9) {
status = AE_AML_NUMERIC_OVERFLOW;
goto cleanup;
}
if (digit > 0) {
/* Sum into the result with the appropriate power of 10 */
ret_desc->number.value = d0 + d1 * 10 + d2 * 100 + d3 * 1000;
for (j = 0; j < i; j++) {
digit *= 10;
}
ret_desc->number.value += digit;
}
}
break;
......@@ -350,19 +362,27 @@ acpi_aml_exec_monadic2_r (
case AML_TO_BCD_OP:
/* TBD: for ACPI 2.0, expand to 64 bits */
if (obj_desc->number.value > 9999) {
if (obj_desc->number.value > ACPI_MAX_BCD_VALUE) {
status = AE_AML_NUMERIC_OVERFLOW;
goto cleanup;
}
ret_desc->number.value
= ACPI_MODULO (obj_desc->number.value, 10)
+ (ACPI_MODULO (ACPI_DIVIDE (obj_desc->number.value, 10), 10) << 4)
+ (ACPI_MODULO (ACPI_DIVIDE (obj_desc->number.value, 100), 10) << 8)
+ (ACPI_MODULO (ACPI_DIVIDE (obj_desc->number.value, 1000), 10) << 12);
ret_desc->number.value = 0;
for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) {
/* Divide by nth factor of 10 */
digit = obj_desc->number.value;
for (j = 0; j < i; j++) {
digit /= 10;
}
/* Create the BCD digit */
if (digit > 0) {
ret_desc->number.value += (ACPI_MODULO (digit, 10) << (i * 4));
}
}
break;
......@@ -404,7 +424,7 @@ acpi_aml_exec_monadic2_r (
/* The object exists in the namespace, return TRUE */
ret_desc->number.value = ACPI_INTEGER_MAX
ret_desc->number.value = ACPI_INTEGER_MAX;
goto cleanup;
break;
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: amprep - ACPI AML (p-code) execution - field prep utilities
* $Revision: 69 $
* $Revision: 72 $
*
*****************************************************************************/
......@@ -50,13 +50,25 @@
static u32
acpi_aml_decode_field_access_type (
u32 access)
u32 access,
u16 length)
{
switch (access)
{
case ACCESS_ANY_ACC:
return (8);
if (length <= 8) {
return (8);
}
else if (length <= 16) {
return (16);
}
else if (length <= 32) {
return (32);
}
else {
return (8);
}
break;
case ACCESS_BYTE_ACC:
......@@ -131,7 +143,7 @@ acpi_aml_prep_common_field_object (
/* Decode the access type so we can compute offsets */
granularity = acpi_aml_decode_field_access_type (obj_desc->field.access);
granularity = acpi_aml_decode_field_access_type (obj_desc->field.access, obj_desc->field.length);
if (!granularity) {
return (AE_AML_OPERAND_VALUE);
}
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: amutils - interpreter/scanner utilities
* $Revision: 64 $
* $Revision: 66 $
*
*****************************************************************************/
......@@ -167,7 +167,7 @@ acpi_aml_truncate_for32bit_table (
* We are running a method that exists in a 32-bit ACPI table.
* Truncate the value to 32 bits by zeroing out the upper 32-bit field
*/
obj_desc->number.value &= (UINT64) ACPI_UINT32_MAX;
obj_desc->number.value &= (ACPI_INTEGER) ACPI_UINT32_MAX;
}
}
......
/*******************************************************************************
*
* Module Name: nsaccess - Top-level functions for accessing ACPI namespace
* $Revision: 115 $
* $Revision: 117 $
*
******************************************************************************/
......@@ -209,14 +209,14 @@ acpi_ns_root_initialize (void)
*
* FUNCTION: Acpi_ns_lookup
*
* PARAMETERS: Prefix_node - Search scope if name is not fully qualified
* PARAMETERS: Prefix_node - Search scope if name is not fully qualified
* Pathname - Search pathname, in internal format
* (as represented in the AML stream)
* Type - Type associated with name
* Interpreter_mode - IMODE_LOAD_PASS2 => add name if not found
* Flags - Flags describing the search restrictions
* Walk_state - Current state of the walk
* Return_node - Where the Node is placed (if found
* Return_node - Where the Node is placed (if found
* or created successfully)
*
* RETURN: Status
......
/*******************************************************************************
*
* Module Name: nssearch - Namespace search
* $Revision: 60 $
* $Revision: 62 $
*
******************************************************************************/
......@@ -289,6 +289,16 @@ acpi_ns_search_and_enter (
status = acpi_ns_search_node (target_name, node,
type, return_node);
if (status != AE_NOT_FOUND) {
/*
* If we found it AND the request specifies that a
* find is an error, return the error
*/
if ((status == AE_OK) &&
(flags & NS_ERROR_IF_FOUND))
{
status = AE_EXIST;
}
/*
* Either found it or there was an error
* -- finished either way
......
/******************************************************************************
*
* Module Name: psargs - Parse AML opcode arguments
* $Revision: 40 $
* $Revision: 42 $
*
*****************************************************************************/
......@@ -401,7 +401,7 @@ acpi_ps_get_next_namepath (
/*
* Either we didn't find the object in the namespace, or the object is
* something other than a control method. Just initialize the Op with the
* pathname
* pathname.
*/
acpi_ps_init_op (arg, AML_NAMEPATH_OP);
......
/******************************************************************************
*
* Module Name: psparse - Parser top level AML parse routines
* $Revision: 69 $
* $Revision: 71 $
*
*****************************************************************************/
......@@ -1044,7 +1044,6 @@ acpi_ps_parse_aml (
ACPI_WALK_LIST *prev_walk_list = acpi_gbl_current_walk_list;
ACPI_OPERAND_OBJECT *return_desc;
ACPI_OPERAND_OBJECT *mth_desc = NULL;
ACPI_NAMESPACE_NODE *start_node;
/* Create and initialize a new parser state */
......@@ -1082,19 +1081,16 @@ acpi_ps_parse_aml (
if (method_node) {
start_node = method_node;
parser_state->start_node = method_node;
walk_state->walk_type = WALK_METHOD;
if (start_node) {
/* Push start scope on scope stack and make it current */
status = acpi_ds_scope_stack_push (start_node, ACPI_TYPE_METHOD, walk_state);
if (ACPI_FAILURE (status)) {
return (status);
}
/* Push start scope on scope stack and make it current */
status = acpi_ds_scope_stack_push (method_node, ACPI_TYPE_METHOD, walk_state);
if (ACPI_FAILURE (status)) {
return (status);
}
/* Init arguments if this is a control method */
/* TBD: [Restructure] add walkstate as a param */
......@@ -1105,6 +1101,8 @@ acpi_ps_parse_aml (
/* Setup the current scope */
node = parser_state->start_op->node;
parser_state->start_node = node;
if (node) {
/* Push start scope on scope stack and make it current */
......
/*
* power.c - Overall power driver. Also handles AC adapter device.
*
* Copyright (C) 2000 Andrew Grover
*
* 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 <linux/kernel.h>
#include <linux/types.h>
#include <linux/proc_fs.h>
#include "acpi.h"
#include "driver.h"
#define _COMPONENT OS_DEPENDENT
MODULE_NAME ("power")
int acpi_cmbatt_init(void);
int acpi_cmbatt_terminate(void);
/* ACPI-specific defines */
#define ACPI_AC_ADAPTER_HID "ACPI0003"
static int ac_count = 0;
static ACPI_HANDLE ac_handle = 0;
/*
* We found a device with the correct HID
*/
static ACPI_STATUS
acpi_found_ac_adapter(ACPI_HANDLE handle, u32 level, void *ctx, void **value)
{
ACPI_DEVICE_INFO info;
if (ac_count > 0) {
printk(KERN_ERR "AC Adapter: more than one!\n");
return (AE_OK);
}
if (!ACPI_SUCCESS(acpi_get_object_info(handle, &info))) {
printk(KERN_ERR "AC Adapter: Could not get AC Adapter object info\n");
return (AE_OK);
}
if (!(info.valid & ACPI_VALID_STA)) {
printk(KERN_ERR "AC Adapter: Battery _STA invalid\n");
return AE_OK;
}
printk(KERN_INFO "AC Adapter: found\n");
ac_handle = handle;
ac_count++;
return AE_OK;
}
static int
proc_read_ac_adapter_status(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
ACPI_OBJECT obj;
ACPI_BUFFER buf;
char *p = page;
int len;
buf.length = sizeof(obj);
buf.pointer = &obj;
if (!ACPI_SUCCESS(acpi_evaluate_object(ac_handle, "_PSR", NULL, &buf))
|| obj.type != ACPI_TYPE_NUMBER) {
p += sprintf(p, "Could not read AC status\n");
goto end;
}
if (obj.number.value)
p += sprintf(p, "on-line\n");
else
p += sprintf(p, "off-line\n");
end:
len = (p - page);
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return len;
}
int
acpi_power_init(void)
{
acpi_get_devices(ACPI_AC_ADAPTER_HID,
acpi_found_ac_adapter,
NULL,
NULL);
if (!proc_mkdir("power", NULL))
return 0;
if (ac_handle) {
create_proc_read_entry("power/ac", 0, NULL,
proc_read_ac_adapter_status, NULL);
}
acpi_cmbatt_init();
return 0;
}
int
acpi_power_terminate(void)
{
acpi_cmbatt_terminate();
if (ac_handle) {
remove_proc_entry("power/ac", NULL);
}
remove_proc_entry("power", NULL);
return 0;
}
......@@ -129,6 +129,8 @@ int
acpi_enter_sx(acpi_sstate_t state)
{
struct acpi_enter_sx_ctx ctx;
DECLARE_WAITQUEUE(wait, current);
int ret = 0;
if ((STRNCMP(acpi_fadt.header.signature, ACPI_FADT_SIGNATURE, ACPI_SIG_LEN) != 0)
|| acpi_slptyp[state] == ACPI_INVALID)
......@@ -137,14 +139,22 @@ acpi_enter_sx(acpi_sstate_t state)
init_waitqueue_head(&ctx.wait);
ctx.state = state;
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&ctx.wait, &wait);
if (acpi_os_queue_for_execution(0, acpi_enter_sx_async, &ctx))
return -1;
ret = -1;
interruptible_sleep_on(&ctx.wait);
if (signal_pending(current))
return -ERESTARTSYS;
if (!ret)
schedule();
return 0;
set_current_state(TASK_RUNNING);
remove_wait_queue(&ctx.wait, &wait);
if (!ret && signal_pending(current))
ret = -ERESTARTSYS;
return ret;
}
int
......
......@@ -453,7 +453,7 @@ static int loop_set_fd(struct loop_device *lo, kdev_t dev, unsigned int arg)
structure that the caller is using */
lo->lo_device = inode->i_dev;
lo->lo_flags = LO_FLAGS_DO_BMAP;
lo->lo_flags |= LO_FLAGS_DO_BMAP;
error = -ENFILE;
lo->lo_backing_file = get_empty_filp();
......
......@@ -178,7 +178,7 @@ endmenu
tristate '/dev/agpgart (AGP Support)' CONFIG_AGP $CONFIG_DRM_AGP
if [ "$CONFIG_AGP" != "n" ]; then
bool ' Intel 440LX/BX/GX and I815/I840 support' CONFIG_AGP_INTEL
bool ' Intel 440LX/BX/GX and I815/I840/I850 support' CONFIG_AGP_INTEL
bool ' Intel I810/I815 (on-board) support' CONFIG_AGP_I810
bool ' VIA chipset support' CONFIG_AGP_VIA
bool ' AMD Irongate support' CONFIG_AGP_AMD
......
......@@ -25,6 +25,8 @@ export-objs := busmouse.o console.o keyboard.o sysrq.o \
misc.o pty.o random.o selection.o serial.o \
tty_io.o
mod-subdirs := joystick ftape drm pcmcia
list-multi :=
KEYMAP =defkeymap.o
......
......@@ -164,6 +164,9 @@ struct agp_bridge_data {
#ifndef PCI_DEVICE_ID_INTEL_840_0
#define PCI_DEVICE_ID_INTEL_840_0 0x1a21
#endif
#ifndef PCI_DEVICE_ID_INTEL_850_0
#define PCI_DEVICE_ID_INTEL_850_0 0x2530
#endif
#ifndef PCI_DEVICE_ID_INTEL_810_DC100_0
#define PCI_DEVICE_ID_INTEL_810_DC100_0 0x7122
#endif
......@@ -213,6 +216,10 @@ struct agp_bridge_data {
#define INTEL_I840_MCHCFG 0x50
#define INTEL_I840_ERRSTS 0xc8
/* intel i850 registers */
#define INTEL_I850_MCHCFG 0x50
#define INTEL_I850_ERRSTS 0xc8
/* intel i810 registers */
#define I810_GMADDR 0x10
#define I810_MMADDR 0x14
......
......@@ -415,8 +415,9 @@ int agp_unbind_memory(agp_memory * curr)
/*
* Driver routines - start
* Currently this module supports the following chipsets:
* i810, 440lx, 440bx, 440gx, via vp3, via mvp3, via kx133, via kt133,
* amd irongate, ALi M1541, and generic support for the SiS chipsets.
* i810, 440lx, 440bx, 440gx, i840, i850, via vp3, via mvp3, via kx133,
* via kt133, amd irongate, ALi M1541, and generic support for the SiS
* chipsets.
*/
/* Generic Agp routines - Start */
......@@ -1191,6 +1192,38 @@ static int intel_840_configure(void)
return 0;
}
static int intel_850_configure(void)
{
u32 temp;
u16 temp2;
aper_size_info_16 *current_size;
current_size = A_SIZE_16(agp_bridge.current_size);
/* aperture size */
pci_write_config_byte(agp_bridge.dev, INTEL_APSIZE,
(char)current_size->size_value);
/* address to map to */
pci_read_config_dword(agp_bridge.dev, INTEL_APBASE, &temp);
agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
/* attbase - aperture base */
pci_write_config_dword(agp_bridge.dev, INTEL_ATTBASE,
agp_bridge.gatt_bus_addr);
/* agpctrl */
pci_write_config_dword(agp_bridge.dev, INTEL_AGPCTRL, 0x0000);
/* mcgcfg */
pci_read_config_word(agp_bridge.dev, INTEL_I850_MCHCFG, &temp2);
pci_write_config_word(agp_bridge.dev, INTEL_I850_MCHCFG,
temp2 | (1 << 9));
/* clear any possible AGP-related error conditions */
pci_write_config_word(agp_bridge.dev, INTEL_I850_ERRSTS, 0x001c);
return 0;
}
static unsigned long intel_mask_memory(unsigned long addr, int type)
{
/* Memory type is ignored */
......@@ -1272,6 +1305,34 @@ static int __init intel_840_setup (struct pci_dev *pdev)
(void) pdev; /* unused */
}
static int __init intel_850_setup (struct pci_dev *pdev)
{
agp_bridge.masks = intel_generic_masks;
agp_bridge.num_of_masks = 1;
agp_bridge.aperture_sizes = (void *) intel_generic_sizes;
agp_bridge.size_type = U16_APER_SIZE;
agp_bridge.num_aperture_sizes = 7;
agp_bridge.dev_private_data = NULL;
agp_bridge.needs_scratch_page = FALSE;
agp_bridge.configure = intel_850_configure;
agp_bridge.fetch_size = intel_fetch_size;
agp_bridge.cleanup = intel_cleanup;
agp_bridge.tlb_flush = intel_tlbflush;
agp_bridge.mask_memory = intel_mask_memory;
agp_bridge.agp_enable = agp_generic_agp_enable;
agp_bridge.cache_flush = global_cache_flush;
agp_bridge.create_gatt_table = agp_generic_create_gatt_table;
agp_bridge.free_gatt_table = agp_generic_free_gatt_table;
agp_bridge.insert_memory = agp_generic_insert_memory;
agp_bridge.remove_memory = agp_generic_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
return 0;
(void) pdev; /* unused */
}
#endif /* CONFIG_AGP_INTEL */
#ifdef CONFIG_AGP_VIA
......@@ -2070,6 +2131,12 @@ static struct {
"Intel",
"i840",
intel_840_setup },
{ PCI_DEVICE_ID_INTEL_850_0,
PCI_VENDOR_ID_INTEL,
INTEL_I850,
"Intel",
"i850",
intel_850_setup },
{ 0,
PCI_VENDOR_ID_INTEL,
INTEL_GENERIC,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -10,6 +10,7 @@
#
subdir-y := video radio
mod-subdirs := video radio
O_TARGET := media.o
obj-y := $(join $(subdir-y),$(subdir-y:%=/%.o))
......
......@@ -37,9 +37,9 @@ obj-$(CONFIG_PCMCIA_IBMTR) += ibmtr_cs.o
include $(TOPDIR)/Rules.make
.ibmtr.o: ../tokenring/ibmtr.c
tmp-ibmtr.o: ../tokenring/ibmtr.c
$(CC) $(CFLAGS) -D__NO_VERSION__ -DPCMCIA -c -o $@ ../tokenring/ibmtr.c
ibmtr_cs.o: .ibmtr.o ibmtr_cs.c
$(CC) $(CFLAGS) -DPCMCIA -c -o .$@ ibmtr_cs.c
$(LD) -r -o $@ .$@ .ibmtr.o
ibmtr_cs.o: tmp-ibmtr.o ibmtr_cs.c
$(CC) $(CFLAGS) -DPCMCIA -c -o tmp-$@ ibmtr_cs.c
$(LD) -r -o $@ tmp-$@ tmp-ibmtr.o
This diff is collapsed.
......@@ -231,9 +231,14 @@ enum mii_stssum_register_bits {
MII_STSSUM_AUTO = 0x0002, MII_STSSUM_SPD = 0x0001
};
enum sis900_revision_id {
SIS630A_900_REV = 0x80, SIS630E_900_REV = 0x81,
SIS630S_900_REV = 0x82, SIS630EA1_900_REV = 0x83
};
enum sis630_revision_id {
SIS630E_REV = 0x81, SIS630EA1_REV = 0x83,
SIS630S_REV = 0x82
SIS630A0 = 0x00, SIS630A1 = 0x01,
SIS630B0 = 0x10, SIS630B1 = 0x11
};
#define FDX_CAPABLE_DUPLEX_UNKNOWN 0
......@@ -257,7 +262,9 @@ enum sis630_revision_id {
/* PCI stuff, should be move to pic.h */
#define PCI_DEVICE_ID_SI_900 0x900
#define PCI_DEVICE_ID_SI_7016 0x7016
#define PCI_DEVICE_ID_SI_7016 0x7016
#define SIS630_VENDOR_ID 0x0630
#define SIS630_DEVICE_ID 0x1039
/* ioctl for accessing MII transceiver */
#define SIOCGMIIPHY (SIOCDEVPRIVATE) /* Get the PHY in use. */
......
......@@ -4598,6 +4598,8 @@
250f 82820 820 (Camino) Chipset PCI to AGP Bridge
2520 82805AA MTH Memory Translator Hub
2521 82804AA MRH-S Memory Repeater Hub for SDRAM
2530 82850 850 (Tehama) Chipset Host Bridge (MCH)
2532 82850 850 (Tehama) Chipset AGP Bridge
5200 EtherExpress PRO/100
5201 EtherExpress PRO/100
8086 0001 EtherExpress PRO/100 Server Ethernet Adapter
......
......@@ -8,7 +8,9 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := sbus_all.o
ifneq ($(ARCH),m68k)
obj-y := sbus.o dvma.o
endif
subdir-y += char
subdir-m += char
......
......@@ -9,18 +9,12 @@
# parent makefile.
#
L_TARGET := zorro.a
O_TARGET := driver.o
# Nasty trick as we need to link files with no references from the outside.
O_TARGET := zorro_core.o
L_OBJS := zorro_core.o
OX_OBJS := zorro.o
export-objs := zorro.o
ifdef CONFIG_PROC_FS
O_OBJS += proc.o
endif
L_OBJS += names.o
obj-$(CONFIG_ZORRO) += zorro.o names.o
obj-$(CONFIG_PROC_FS) += proc.o
include $(TOPDIR)/Rules.make
......
......@@ -639,8 +639,13 @@ void __invalidate_buffers(kdev_t dev, int destroy_dirty_buffers)
continue;
for (i = nr_buffers_type[nlist]; i > 0 ; bh = bh_next, i--) {
bh_next = bh->b_next_free;
/* Another device? */
if (bh->b_dev != dev)
continue;
/* Part of a mapping? */
if (bh->b_page->mapping)
continue;
if (buffer_locked(bh)) {
atomic_inc(&bh->b_count);
spin_unlock(&lru_list_lock);
......@@ -1512,13 +1517,13 @@ static int __block_write_full_page(struct inode *inode, struct page *page, get_b
block++;
} while (bh != head);
/* Stage 2: lock the buffers, mark them dirty */
/* Stage 2: lock the buffers, mark them clean */
do {
lock_buffer(bh);
bh->b_end_io = end_buffer_io_async;
atomic_inc(&bh->b_count);
set_bit(BH_Uptodate, &bh->b_state);
set_bit(BH_Dirty, &bh->b_state);
clear_bit(BH_Dirty, &bh->b_state);
bh = bh->b_this_page;
} while (bh != head);
......@@ -2093,7 +2098,7 @@ int brw_kiovec(int rw, int nr, struct kiobuf *iovec[],
if (rw == WRITE) {
set_bit(BH_Uptodate, &tmp->b_state);
set_bit(BH_Dirty, &tmp->b_state);
clear_bit(BH_Dirty, &tmp->b_state);
}
bh[bhind++] = tmp;
......
......@@ -313,9 +313,7 @@ int setup_arg_pages(struct linux_binprm *bprm)
mpnt->vm_pgoff = 0;
mpnt->vm_file = NULL;
mpnt->vm_private_data = (void *) 0;
spin_lock(&current->mm->page_table_lock);
insert_vm_struct(current->mm, mpnt);
spin_unlock(&current->mm->page_table_lock);
current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
}
......
......@@ -1611,7 +1611,7 @@ asmlinkage long sys_link(const char * oldname, const char * newname)
goto out;
error = -EXDEV;
if (old_nd.mnt != nd.mnt)
goto out;
goto out_release;
new_dentry = lookup_create(&nd, 0);
error = PTR_ERR(new_dentry);
if (!IS_ERR(new_dentry)) {
......@@ -1619,6 +1619,7 @@ asmlinkage long sys_link(const char * oldname, const char * newname)
dput(new_dentry);
}
up(&nd.dentry->d_inode->i_sem);
out_release:
path_release(&nd);
out:
path_release(&old_nd);
......
......@@ -35,14 +35,6 @@ static u32 nfs3_ftypes[] = {
/*
* XDR functions for basic NFS types
*/
static inline u32 *
dec64(u32 *p, u64 *valp)
{
*valp = ((u64) ntohl(*p++)) << 32;
*valp |= ntohl(*p++);
return p;
}
static inline u32 *
encode_time3(u32 *p, time_t secs)
{
......@@ -142,7 +134,7 @@ decode_sattr3(u32 *p, struct iattr *iap)
u64 newsize;
iap->ia_valid |= ATTR_SIZE;
p = dec64(p, &newsize);
p = xdr_decode_hyper(p, &newsize);
if (newsize <= NFS_OFFSET_MAX)
iap->ia_size = newsize;
else
......@@ -343,7 +335,7 @@ nfs3svc_decode_readargs(struct svc_rqst *rqstp, u32 *p,
struct nfsd3_readargs *args)
{
if (!(p = decode_fh(p, &args->fh))
|| !(p = dec64(p, &args->offset)))
|| !(p = xdr_decode_hyper(p, &args->offset)))
return 0;
args->count = ntohl(*p++);
......@@ -355,7 +347,7 @@ nfs3svc_decode_writeargs(struct svc_rqst *rqstp, u32 *p,
struct nfsd3_writeargs *args)
{
if (!(p = decode_fh(p, &args->fh))
|| !(p = dec64(p, &args->offset)))
|| !(p = xdr_decode_hyper(p, &args->offset)))
return 0;
args->count = ntohl(*p++);
......@@ -471,7 +463,7 @@ nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, u32 *p,
{
if (!(p = decode_fh(p, &args->fh)))
return 0;
p = dec64(p, &args->cookie);
p = xdr_decode_hyper(p, &args->cookie);
args->verf = p; p += 2;
args->dircount = ~0;
args->count = ntohl(*p++);
......@@ -485,7 +477,7 @@ nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, u32 *p,
{
if (!(p = decode_fh(p, &args->fh)))
return 0;
p = dec64(p, &args->cookie);
p = xdr_decode_hyper(p, &args->cookie);
args->verf = p; p += 2;
args->dircount = ntohl(*p++);
args->count = ntohl(*p++);
......@@ -499,7 +491,7 @@ nfs3svc_decode_commitargs(struct svc_rqst *rqstp, u32 *p,
{
if (!(p = decode_fh(p, &args->fh)))
return 0;
p = dec64(p, &args->offset);
p = xdr_decode_hyper(p, &args->offset);
args->count = ntohl(*p++);
return xdr_argsize_check(rqstp, p);
......
......@@ -359,8 +359,16 @@ static struct accessmap nfs3_diraccess[] = {
};
static struct accessmap nfs3_anyaccess[] = {
/* XXX: should we try to cover read/write here for clients that
* rely on us to do their access checking for special files? */
/* Some clients - Solaris 2.6 at least, make an access call
* to the server to check for access for things like /dev/null
* (which really, the server doesn't care about). So
* We provide simple access checking for them, looking
* mainly at mode bits
*/
{ NFS3_ACCESS_READ, MAY_READ },
{ NFS3_ACCESS_EXECUTE, MAY_EXEC },
{ NFS3_ACCESS_MODIFY, MAY_WRITE },
{ NFS3_ACCESS_EXTEND, MAY_WRITE },
{ 0, 0 }
};
......@@ -1501,12 +1509,17 @@ nfsd_permission(struct svc_export *exp, struct dentry *dentry, int acc)
inode->i_uid, inode->i_gid, current->fsuid, current->fsgid);
#endif
if (acc & (MAY_WRITE | MAY_SATTR | MAY_TRUNC)) {
if (EX_RDONLY(exp) || IS_RDONLY(inode))
return nfserr_rofs;
if (/* (acc & MAY_WRITE) && */ IS_IMMUTABLE(inode))
return nfserr_perm;
}
/* only care about readonly exports for files and
* directories. links don't have meaningful write access,
* and all else is local to the client
*/
if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))
if (acc & (MAY_WRITE | MAY_SATTR | MAY_TRUNC)) {
if (EX_RDONLY(exp) || IS_RDONLY(inode))
return nfserr_rofs;
if (/* (acc & MAY_WRITE) && */ IS_IMMUTABLE(inode))
return nfserr_perm;
}
if ((acc & MAY_TRUNC) && IS_APPEND(inode))
return nfserr_perm;
......
......@@ -169,6 +169,7 @@ enum
ACPI_FACS,
ACPI_XSDT,
ACPI_PMTIMER,
ACPI_BATTERY,
};
#define ACPI_SLP_TYP_DISABLED (~0UL)
......
......@@ -47,6 +47,7 @@ enum chipset_type {
INTEL_I810,
INTEL_I815,
INTEL_I840,
INTEL_I850,
VIA_GENERIC,
VIA_VP3,
VIA_MVP3,
......
This diff is collapsed.
......@@ -413,7 +413,6 @@ extern void swapin_readahead(swp_entry_t);
/* mmap.c */
extern void lock_vma_mappings(struct vm_area_struct *);
extern void unlock_vma_mappings(struct vm_area_struct *);
extern void merge_segments(struct mm_struct *, unsigned long, unsigned long);
extern void insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
extern void __insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
extern void build_mmap_avl(struct mm_struct *);
......
......@@ -350,6 +350,7 @@ do { \
if (condition) \
break; \
spin_unlock_irq(&lock); \
run_task_queue(&tq_disk); \
schedule(); \
spin_lock_irq(&lock); \
} \
......
This diff is collapsed.
......@@ -15,23 +15,13 @@
*
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/malloc.h>
#include <linux/shm.h>
#include <linux/swap.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/locks.h>
#include <linux/file.h>
#include <linux/mman.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
#include <linux/proc_fs.h>
#include <linux/highmem.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include "util.h"
......@@ -109,6 +99,7 @@ static inline void shm_inc (int id) {
BUG();
shp->shm_atim = CURRENT_TIME;
shp->shm_lprid = current->pid;
shp->shm_nattch++;
shm_unlock(id);
}
......@@ -123,21 +114,14 @@ static void shm_open (struct vm_area_struct *shmd)
*
* @shp: struct to free
*
* It has to be called with shp and shm_ids.sem locked and will
* release them
* It has to be called with shp and shm_ids.sem locked
*/
static void shm_destroy (struct shmid_kernel *shp)
{
struct file * file = shp->shm_file;
shp->shm_file = NULL;
shm_tot -= (shp->shm_segsz + PAGE_SIZE - 1) >> PAGE_SHIFT;
shm_unlock (shp->id);
shm_rmid (shp->id);
fput (shp->shm_file);
kfree (shp);
up (&shm_ids.sem);
/* put the file outside the critical path to prevent recursion */
fput (file);
}
/*
......@@ -158,10 +142,10 @@ static void shm_close (struct vm_area_struct *shmd)
BUG();
shp->shm_lprid = current->pid;
shp->shm_dtim = CURRENT_TIME;
if(shp->shm_flags & SHM_DEST &&
file_count (file) == 2) /* shp and the vma have the last
references*/
return shm_destroy (shp);
shp->shm_nattch--;
if(shp->shm_nattch == 0 &&
shp->shm_flags & SHM_DEST)
shm_destroy (shp);
shm_unlock(id);
up (&shm_ids.sem);
......@@ -176,7 +160,7 @@ static int shm_mmap(struct file * file, struct vm_area_struct * vma)
}
static struct file_operations shm_file_operations = {
mmap: shm_mmap
mmap: shm_mmap
};
static struct vm_operations_struct shm_vm_ops = {
......@@ -218,9 +202,10 @@ static int newseg (key_t key, int shmflg, size_t size)
shp->shm_atim = shp->shm_dtim = 0;
shp->shm_ctim = CURRENT_TIME;
shp->shm_segsz = size;
shp->shm_nattch = 0;
shp->id = shm_buildid(id,shp->shm_perm.seq);
shp->shm_file = file;
file->f_dentry->d_inode->i_ino = id;
file->f_dentry->d_inode->i_ino = shp->id;
file->f_op = &shm_file_operations;
shm_tot += numpages;
shm_unlock (id);
......@@ -370,15 +355,13 @@ static void shm_get_stat (unsigned long *rss, unsigned long *swp)
struct inode * inode;
shp = shm_get(i);
if(shp == NULL || shp->shm_file == NULL)
if(shp == NULL)
continue;
inode = shp->shm_file->f_dentry->d_inode;
down (&inode->i_sem);
*rss += inode->i_mapping->nrpages;
spin_lock (&inode->u.shmem_i.lock);
*rss += inode->i_mapping->nrpages;
*swp += inode->u.shmem_i.swapped;
spin_unlock (&inode->u.shmem_i.lock);
up (&inode->i_sem);
}
}
......@@ -462,7 +445,7 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds *buf)
tbuf.shm_ctime = shp->shm_ctim;
tbuf.shm_cpid = shp->shm_cprid;
tbuf.shm_lpid = shp->shm_lprid;
tbuf.shm_nattch = file_count (shp->shm_file) - 1;
tbuf.shm_nattch = shp->shm_nattch;
shm_unlock(shmid);
if(copy_shmid_to_user (buf, &tbuf, version))
return -EFAULT;
......@@ -512,13 +495,12 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds *buf)
goto out_up;
err = shm_checkid(shp, shmid);
if (err == 0) {
if (file_count (shp->shm_file) == 1) {
if (shp->shm_nattch){
shp->shm_flags |= SHM_DEST;
/* Do not find it any more */
shp->shm_perm.key = IPC_PRIVATE;
} else
shm_destroy (shp);
return 0;
}
shp->shm_flags |= SHM_DEST;
/* Do not find it any more */
shp->shm_perm.key = IPC_PRIVATE;
}
/* Unlock */
shm_unlock(shmid);
......@@ -619,13 +601,23 @@ asmlinkage long sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr)
return -EACCES;
}
file = shp->shm_file;
get_file (file);
shp->shm_nattch++;
shm_unlock(shmid);
down(&current->mm->mmap_sem);
user_addr = (void *) do_mmap (file, addr, file->f_dentry->d_inode->i_size, prot, flags, 0);
up(&current->mm->mmap_sem);
fput (file);
down (&shm_ids.sem);
if(!(shp = shm_lock(shmid)))
BUG();
shp->shm_nattch--;
if(shp->shm_nattch == 0 &&
shp->shm_flags & SHM_DEST)
shm_destroy (shp);
shm_unlock(shmid);
up (&shm_ids.sem);
*raddr = (unsigned long) user_addr;
err = 0;
if (IS_ERR(user_addr))
......@@ -684,7 +676,7 @@ static int sysvipc_shm_read_proc(char *buffer, char **start, off_t offset, int l
shp->shm_segsz,
shp->shm_cprid,
shp->shm_lprid,
file_count (shp->shm_file) - 1,
shp->shm_nattch,
shp->shm_perm.uid,
shp->shm_perm.gid,
shp->shm_perm.cuid,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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