Commit 976e84b0 authored by Anton Blanchard's avatar Anton Blanchard

Merge bk://linux.bkbits.net/linux-2.5

into samba.org:/scratch/anton/linux-2.5_ppc64
parents ee634c3f 9038672a
Tmpfs is a file system which keeps all files in virtual memory.
Everything in tmpfs is temporary in the sense that no files will be
created on your hard drive. If you unmount a tmpfs instance,
everything stored therein is lost.
tmpfs puts everything into the kernel internal caches and grows and
shrinks to accommodate the files it contains and is able to swap
unneeded pages out to swap space. It has maximum size limits which can
be adjusted on the fly via 'mount -o remount ...'
If you compare it to ramfs (which was the template to create tmpfs)
you gain swapping and limit checking. Another similar thing is the RAM
disk (/dev/ram*), which simulates a fixed size hard disk in physical
RAM, where you have to create an ordinary filesystem on top. Ramdisks
cannot swap and you do not have the possibility to resize them.
Since tmpfs lives completely in the page cache and on swap, all tmpfs
pages currently in memory will show up as cached. It will not show up
as shared or something like that. Further on you can check the actual
RAM+swap use of a tmpfs instance with df(1) and du(1).
tmpfs has the following uses:
1) There is always a kernel internal mount which you will not see at
all. This is used for shared anonymous mappings and SYSV shared
memory.
This mount does not depend on CONFIG_TMPFS. If CONFIG_TMPFS is not
set, the user visible part of tmpfs is not build. But the internal
mechanisms are always present.
2) glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
POSIX shared memory (shm_open, shm_unlink). Adding the following
line to /etc/fstab should take care of this:
tmpfs /dev/shm tmpfs defaults 0 0
Remember to create the directory that you intend to mount tmpfs on
if necessary (/dev/shm is automagically created if you use devfs).
This mount is _not_ needed for SYSV shared memory. The internal
mount is used for that. (In the 2.3 kernel versions it was
necessary to mount the predecessor of tmpfs (shm fs) to use SYSV
shared memory)
3) Some people (including me) find it very convenient to mount it
e.g. on /tmp and /var/tmp and have a big swap partition. But be
aware: loop mounts of tmpfs files do not work due to the internal
design. So mkinitrd shipped by most distributions will fail with a
tmpfs /tmp.
4) And probably a lot more I do not know about :-)
tmpfs has a couple of mount options:
size: The limit of allocated bytes for this tmpfs instance. The
default is half of your physical RAM without swap. If you
oversize your tmpfs instances the machine will deadlock
since the OOM handler will not be able to free that memory.
nr_blocks: The same as size, but in blocks of PAGECACHE_SIZE.
nr_inodes: The maximum number of inodes for this instance. The default
is half of the number of your physical RAM pages.
These parameters accept a suffix k, m or g for kilo, mega and giga and
can be changed on remount.
To specify the initial root directory you can use the following mount
options:
mode: The permissions as an octal number
uid: The user id
gid: The group id
These options do not have any effect on remount. You can change these
parameters with chmod(1), chown(1) and chgrp(1) on a mounted filesystem.
So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs'
will give you tmpfs instance on /mytmpfs which can allocate 10GB
RAM/SWAP in 10240 inodes and it is only accessible by root.
TODOs:
1) give the size option a percent semantic: If you give a mount option
size=50% the tmpfs instance should be able to grow to 50 percent of
RAM + swap. So the instance should adapt automatically if you add
or remove swap space.
2) loop mounts: This is difficult since loop.c relies on the readpage
operation. This operation gets a page from the caller to be filled
with the content of the file at that position. But tmpfs always has
the page and thus cannot copy the content to the given page. So it
cannot provide this operation. The VM had to be changed seriously
to achieve this.
3) Show the number of tmpfs RAM pages. (As shared?)
Author:
Christoph Rohland <cr@sap.com>, 1.12.01
This diff is collapsed.
VERSION = 2
PATCHLEVEL = 5
SUBLEVEL = 7
EXTRAVERSION =-pre1
EXTRAVERSION =-pre2
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
......
......@@ -120,6 +120,24 @@ $(L_TARGET): $(obj-y)
) > $(dir $@)/.$(notdir $@).flags
endif
#
# Rule to link composite objects
#
# for make >= 3.78 the following is cleaner:
# multi-used := $(foreach m,$(obj-y) $(obj-m), $(if $($(basename $(m))-objs), $(m)))
multi-used := $(sort $(foreach m,$(obj-y) $(obj-m),$(patsubst %,$(m),$($(basename $(m))-objs))))
ld-multi-used := $(filter-out $(list-multi),$(multi-used))
ld-multi-objs := $(foreach m, $(ld-multi-used), $($(basename $(m))-objs))
$(ld-multi-used) : %.o: $(ld-multi-objs)
rm -f $@
$(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs), $^)
@ ( \
echo 'ifeq ($(strip $(subst $(comma),:,$(LD) $(EXTRA_LDFLAGS) $($(basename $@)-objs)),$$(strip $$(subst $$(comma),:,$$(LD) $$(EXTRA_LDFLAGS) $$($(basename $@)-objs)))))' ; \
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
echo 'endif' \
) > $(dir $@)/.$(notdir $@).flags
#
# This make dependencies quickly
......@@ -200,8 +218,7 @@ script:
#
ifdef CONFIG_MODULES
multi-used := $(filter $(list-multi), $(obj-y) $(obj-m))
multi-objs := $(foreach m, $(multi-used), $($(basename $(m))-objs))
multi-objs := $(foreach m, $(obj-y) $(obj-m), $($(basename $(m))-objs))
active-objs := $(sort $(multi-objs) $(obj-y) $(obj-m))
ifdef CONFIG_MODVERSIONS
......
......@@ -460,7 +460,7 @@ smp_boot_one_cpu(int cpuid, int cpunum)
if (fork_by_hand() < 0)
panic("failed fork for CPU %d", cpuid);
idle = init_task.prev_task;
idle = prev_task(&init_task);
if (!idle)
panic("No idle process for CPU %d", cpuid);
......
......@@ -649,33 +649,32 @@ CONFIG_PM
sending the processor to sleep and saving power.
CONFIG_ACPI
ACPI/OSPM support for Linux is currently under development. As such,
this support is preliminary and EXPERIMENTAL. Configuring ACPI
support enables kernel interfaces that allow higher level software
(OSPM) to manipulate ACPI defined hardware and software interfaces,
including the evaluation of ACPI control methods. If unsure, choose
N here. Note, this option will enlarge your kernel by about 120K.
This support requires an ACPI compliant platform (hardware/firmware).
If both ACPI and Advanced Power Management (APM) support are
configured, whichever is loaded first shall be used.
This code DOES NOT currently provide a complete OSPM implementation
-- it has not yet reached APM's level of functionality. When fully
implemented, Linux ACPI/OSPM will provide a more robust functional
replacement for legacy configuration and power management
interfaces, including the Plug-and-Play BIOS specification (PnP
BIOS), the Multi-Processor Specification (MPS), and the Advanced
Power Management specification (APM).
Linux support for ACPI/OSPM is based on Intel Corporation's ACPI
Component Architecture (ACPI CA). The latest ACPI CA source code,
documentation, debug builds, and implementation status information
can be downloaded from:
<http://developer.intel.com/technology/iapc/acpi/downloads.htm>.
The ACPI Sourceforge project may also be of interest:
<http://sf.net/projects/acpi/>
Advanced Configuration and Power Interface (ACPI) support for
Linux requires an ACPI compliant platform (hardware/firmware),
and assumes the presence of OS-directed configuration and power
management (OSPM) software. This option will enlarge your
kernel by about 70K.
Linux ACPI provides a robust functional replacement for several
legacy configuration and power management intefaces, including
the Plug-and-Play BIOS specification (PnP BIOS), the
MultiProcessor Specification (MPS), and the Advanced Power
Management (APM) specification. If both ACPI and APM support
are configured, whichever is loaded first shall be used.
The ACPI SourceForge project contains the latest source code,
documentation, tools, mailing list subscription, and other
information. This project is available at:
<http://sourceforge.net/projects/acpi>
Linux support for ACPI is based on Intel Corporation's ACPI
Component Architecture (ACPI CA). For more information see:
<http://developer.intel.com/technology/iapc/acpi>
ACPI is an open industry specification co-developed by Compaq,
Intel, Microsoft, Phoenix, and Toshiba. The specification is
available at:
<http://www.acpi.info>
CONFIG_APM
APM is a BIOS specification for saving power using several different
......
......@@ -41,6 +41,7 @@ if [ "$CONFIG_M386" = "y" ]; then
define_bool CONFIG_RWSEM_GENERIC_SPINLOCK y
define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
define_bool CONFIG_X86_PPRO_FENCE y
define_bool CONFIG_X86_F00F_BUG y
else
define_bool CONFIG_X86_WP_WORKS_OK y
define_bool CONFIG_X86_INVLPG y
......@@ -56,12 +57,14 @@ if [ "$CONFIG_M486" = "y" ]; then
define_bool CONFIG_X86_USE_STRING_486 y
define_bool CONFIG_X86_ALIGNMENT_16 y
define_bool CONFIG_X86_PPRO_FENCE y
define_bool CONFIG_X86_F00F_BUG y
fi
if [ "$CONFIG_M586" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5
define_bool CONFIG_X86_USE_STRING_486 y
define_bool CONFIG_X86_ALIGNMENT_16 y
define_bool CONFIG_X86_PPRO_FENCE y
define_bool CONFIG_X86_F00F_BUG y
fi
if [ "$CONFIG_M586TSC" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5
......@@ -69,6 +72,7 @@ if [ "$CONFIG_M586TSC" = "y" ]; then
define_bool CONFIG_X86_ALIGNMENT_16 y
define_bool CONFIG_X86_TSC y
define_bool CONFIG_X86_PPRO_FENCE y
define_bool CONFIG_X86_F00F_BUG y
fi
if [ "$CONFIG_M586MMX" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5
......@@ -77,6 +81,7 @@ if [ "$CONFIG_M586MMX" = "y" ]; then
define_bool CONFIG_X86_TSC y
define_bool CONFIG_X86_GOOD_APIC y
define_bool CONFIG_X86_PPRO_FENCE y
define_bool CONFIG_X86_F00F_BUG y
fi
if [ "$CONFIG_M686" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5
......@@ -203,6 +208,8 @@ endmenu
mainmenu_option next_comment
comment 'General options'
source drivers/acpi/Config.in
# Visual Workstation support is utterly broken.
# If you want to see it working mail an VW540 to hch@infradead.org 8)
#bool 'SGI Visual Workstation support' CONFIG_VISWS
......@@ -261,14 +268,6 @@ tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
bool 'Power Management support' CONFIG_PM
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
dep_bool ' ACPI support' CONFIG_ACPI $CONFIG_PM
if [ "$CONFIG_ACPI" != "n" ]; then
source drivers/acpi/Config.in
fi
fi
dep_tristate ' Advanced Power Management BIOS support' CONFIG_APM $CONFIG_PM
if [ "$CONFIG_APM" != "n" ]; then
bool ' Ignore USER SUSPEND' CONFIG_APM_IGNORE_USER_SUSPEND
......
......@@ -77,6 +77,11 @@ CONFIG_HAVE_DEC_LOCK=y
#
# General options
#
#
# ACPI Support
#
# CONFIG_ACPI is not set
CONFIG_X86_IO_APIC=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_PCI=y
......@@ -830,6 +835,7 @@ CONFIG_USB_UHCI_ALT=y
# USB Device Class drivers
#
# CONFIG_USB_AUDIO is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_BLUETOOTH is not set
CONFIG_USB_STORAGE=y
# CONFIG_USB_STORAGE_DEBUG is not set
......
......@@ -36,9 +36,11 @@ obj-$(CONFIG_X86_MSR) += msr.o
obj-$(CONFIG_X86_CPUID) += cpuid.o
obj-$(CONFIG_MICROCODE) += microcode.o
obj-$(CONFIG_APM) += apm.o
obj-$(CONFIG_ACPI) += acpi.o
obj-$(CONFIG_ACPI_SLEEP) += acpi_wakeup.o
obj-$(CONFIG_SMP) += smp.o smpboot.o trampoline.o
obj-$(CONFIG_X86_LOCAL_APIC) += mpparse.o apic.o nmi.o
obj-$(CONFIG_X86_IO_APIC) += io_apic.o acpitable.o
obj-$(CONFIG_X86_IO_APIC) += io_apic.o
ifdef CONFIG_VISWS
obj-y += setup-visws.o
obj-$(CONFIG_X86_VISWS_APIC) += visws_apic.o
......
This diff is collapsed.
.text
#include <linux/linkage.h>
#include <asm/segment.h>
ALIGN
wakeup_start:
wakeup_code:
wakeup_code_start = .
.code16
cli
cld
# setup data segment
movw %cs, %ax
addw $(wakeup_data - wakeup_code) >> 4, %ax
movw %ax, %ds
# set up page table
movl (real_save_cr3 - wakeup_data), %eax
movl %eax, %cr3
# make sure %cr4 is set correctly (features, etc)
movl (real_save_cr4 - wakeup_data), %eax
movl %eax, %cr4
# need a gdt
lgdt real_save_gdt - wakeup_data
movl %cr0, %eax
orl $0x80000001, %eax
movl %eax, %cr0
ljmpl $__KERNEL_CS,$SYMBOL_NAME(wakeup_pmode_return)
.code32
ALIGN
.org 0x100
wakeup_data:
.word 0
real_save_gdt: .word 0
.long 0
real_save_cr3: .long 0
real_save_cr4: .long 0
.org 0x300
wakeup_stack:
wakeup_end:
wakeup_pmode_return:
# restore data segment
movl $__KERNEL_DS, %eax
movw %ax, %ds
movw %ax, %es
# and restore the stack
movw %ax, %ss
movl saved_esp, %esp
# restore other segment registers
xorl %eax, %eax
movw %ax, %fs
movw %ax, %gs
# reload the gdt, as we need the full 32 bit address
lgdt saved_gdt
lidt saved_idt
lldt saved_ldt
# restore the other general registers
movl saved_ebx, %ebx
movl saved_edi, %edi
movl saved_esi, %esi
movl saved_ebp, %ebp
# jump to place where we left off
movl saved_eip,%eax
jmp *%eax
##
# acpi_copy_wakeup_routine
#
# Copy the above routine to low memory.
#
# Parameters:
# %eax: place to copy wakeup routine to
#
# Returned address is location of code in low memory (past data and stack)
#
ENTRY(acpi_copy_wakeup_routine)
pushl %esi
pushl %edi
sgdt saved_gdt
sidt saved_idt
sldt saved_ldt
str saved_tss
movl %eax, %edi
leal wakeup_start, %esi
movl $(wakeup_end - wakeup_start) >> 2, %ecx
rep ; movsl
movl %cr3, %edx
movl %edx, real_save_cr3 - wakeup_start (%eax)
movl %cr4, %edx
movl %edx, real_save_cr4 - wakeup_start (%eax)
sgdt real_save_gdt - wakeup_start (%eax)
# restore the regs we used
popl %edi
popl %esi
ret
.data
ALIGN
# saved registers
saved_gdt: .long 0,0
saved_idt: .long 0,0
saved_ldt: .long 0
saved_tss: .long 0
saved_cr0: .long 0
ENTRY(saved_ebp) .long 0
ENTRY(saved_esi) .long 0
ENTRY(saved_edi) .long 0
ENTRY(saved_ebx) .long 0
ENTRY(saved_eip) .long 0
ENTRY(saved_esp) .long 0
This diff is collapsed.
/*
* acpitable.c - IA32-specific ACPI boot-time initialization (Revision: 1)
*
* Copyright (C) 1999 Andrew Henroid
* Copyright (C) 2001 Richard Schaal
* Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
* Copyright (C) 2001 Jun Nakajima <jun.nakajima@intel.com>
* Copyright (C) 2001 Arjan van de Ven <arjanv@redhat.com>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* 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
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* $Id: acpitable.h,v 1.3 2001/11/03 22:41:34 fenrus Exp $
*/
/*
* The following codes are cut&pasted from drivers/acpi. Part of the code
* there can be not updated or delivered yet.
* To avoid conflicts when CONFIG_ACPI is defined, the following codes are
* modified so that they are self-contained in this file.
* -- jun
*/
#ifndef _HEADER_ACPITABLE_H_
#define _HEADER_ACPITABLE_H_
#define dprintk printk
typedef unsigned int ACPI_TBLPTR;
typedef struct { /* ACPI common table header */
char signature[4]; /* identifies type of table */
u32 length; /* length of table,
in bytes, * including header */
u8 revision; /* specification minor version # */
u8 checksum; /* to make sum of entire table == 0 */
char oem_id[6]; /* OEM identification */
char oem_table_id[8]; /* OEM table identification */
u32 oem_revision; /* OEM revision number */
char asl_compiler_id[4]; /* ASL compiler vendor ID */
u32 asl_compiler_revision; /* ASL compiler revision number */
} acpi_table_header __attribute__ ((packed));;
enum {
ACPI_APIC = 0,
ACPI_BOOT,
ACPI_DBGP,
ACPI_DSDT,
ACPI_ECDT,
ACPI_ETDT,
ACPI_FACP,
ACPI_FACS,
ACPI_OEMX,
ACPI_PSDT,
ACPI_SBST,
ACPI_SLIT,
ACPI_SPCR,
ACPI_SRAT,
ACPI_SSDT,
ACPI_SPMI,
ACPI_XSDT,
ACPI_TABLE_COUNT
};
static char *acpi_table_signatures[ACPI_TABLE_COUNT] = {
"APIC",
"BOOT",
"DBGP",
"DSDT",
"ECDT",
"ETDT",
"FACP",
"FACS",
"OEM",
"PSDT",
"SBST",
"SLIT",
"SPCR",
"SRAT",
"SSDT",
"SPMI",
"XSDT"
};
struct acpi_table_madt {
acpi_table_header header;
u32 lapic_address;
struct {
u32 pcat_compat:1;
u32 reserved:31;
} flags __attribute__ ((packed));
} __attribute__ ((packed));;
enum {
ACPI_MADT_LAPIC = 0,
ACPI_MADT_IOAPIC,
ACPI_MADT_INT_SRC_OVR,
ACPI_MADT_NMI_SRC,
ACPI_MADT_LAPIC_NMI,
ACPI_MADT_LAPIC_ADDR_OVR,
ACPI_MADT_IOSAPIC,
ACPI_MADT_LSAPIC,
ACPI_MADT_PLAT_INT_SRC,
ACPI_MADT_ENTRY_COUNT
};
#define RSDP_SIG "RSD PTR "
#define RSDT_SIG "RSDT"
#define ACPI_DEBUG_PRINT(pl)
#define ACPI_MEMORY_MODE 0x01
#define ACPI_LOGICAL_ADDRESSING 0x00
#define ACPI_PHYSICAL_ADDRESSING 0x01
#define LO_RSDP_WINDOW_BASE 0 /* Physical Address */
#define HI_RSDP_WINDOW_BASE 0xE0000 /* Physical Address */
#define LO_RSDP_WINDOW_SIZE 0x400
#define HI_RSDP_WINDOW_SIZE 0x20000
#define RSDP_SCAN_STEP 16
#define RSDP_CHECKSUM_LENGTH 20
typedef int (*acpi_table_handler) (acpi_table_header * header, unsigned long);
struct acpi_table_rsdp {
char signature[8];
u8 checksum;
char oem_id[6];
u8 revision;
u32 rsdt_address;
} __attribute__ ((packed));
struct acpi_table_rsdt {
acpi_table_header header;
u32 entry[ACPI_TABLE_COUNT];
} __attribute__ ((packed));
typedef struct {
u8 type;
u8 length;
} acpi_madt_entry_header __attribute__ ((packed));
typedef struct {
u16 polarity:2;
u16 trigger:2;
u16 reserved:12;
} acpi_madt_int_flags __attribute__ ((packed));
struct acpi_table_lapic {
acpi_madt_entry_header header;
u8 acpi_id;
u8 id;
struct {
u32 enabled:1;
u32 reserved:31;
} flags __attribute__ ((packed));
} __attribute__ ((packed));
struct acpi_table_ioapic {
acpi_madt_entry_header header;
u8 id;
u8 reserved;
u32 address;
u32 global_irq_base;
} __attribute__ ((packed));
struct acpi_table_int_src_ovr {
acpi_madt_entry_header header;
u8 bus;
u8 bus_irq;
u32 global_irq;
acpi_madt_int_flags flags;
} __attribute__ ((packed));
struct acpi_table_nmi_src {
acpi_madt_entry_header header;
acpi_madt_int_flags flags;
u32 global_irq;
} __attribute__ ((packed));
struct acpi_table_lapic_nmi {
acpi_madt_entry_header header;
u8 acpi_id;
acpi_madt_int_flags flags;
u8 lint;
} __attribute__ ((packed));
struct acpi_table_lapic_addr_ovr {
acpi_madt_entry_header header;
u8 reserved[2];
u64 address;
} __attribute__ ((packed));
struct acpi_table_iosapic {
acpi_madt_entry_header header;
u8 id;
u8 reserved;
u32 global_irq_base;
u64 address;
} __attribute__ ((packed));
struct acpi_table_lsapic {
acpi_madt_entry_header header;
u8 acpi_id;
u8 id;
u8 eid;
u8 reserved[3];
struct {
u32 enabled:1;
u32 reserved:31;
} flags;
} __attribute__ ((packed));
struct acpi_table_plat_int_src {
acpi_madt_entry_header header;
acpi_madt_int_flags flags;
u8 type;
u8 id;
u8 eid;
u8 iosapic_vector;
u32 global_irq;
u32 reserved;
} __attribute__ ((packed));
/*
* ACPI Table Descriptor. One per ACPI table
*/
typedef struct acpi_table_desc {
struct acpi_table_desc *prev;
struct acpi_table_desc *next;
struct acpi_table_desc *installed_desc;
acpi_table_header *pointer;
void *base_pointer;
u8 *aml_pointer;
u64 physical_address;
u32 aml_length;
u32 length;
u32 count;
u16 table_id;
u8 type;
u8 allocation;
u8 loaded_into_namespace;
} acpi_table_desc __attribute__ ((packed));;
#endif
......@@ -178,7 +178,7 @@ checkCPUtype:
* we don't need to preserve eflags.
*/
movl $3,X86 # at least 386
movb $3,X86 # at least 386
pushfl # push EFLAGS
popl %eax # get EFLAGS
movl %eax,%ecx # save original EFLAGS
......@@ -191,7 +191,7 @@ checkCPUtype:
andl $0x40000,%eax # check if AC bit changed
je is386
movl $4,X86 # at least 486
movb $4,X86 # at least 486
movl %ecx,%eax
xorl $0x200000,%eax # check ID flag
pushl %eax
......
......@@ -14,6 +14,7 @@
#include <linux/mm.h>
#include <linux/irq.h>
#include <linux/acpi.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/config.h>
......@@ -30,6 +31,9 @@
/* Have we found an MP table */
int smp_found_config;
/* Have we found an ACPI MADT table */
int acpi_found_madt = 0;
/*
* Various Linux-internal data structures created from the
* MP-table.
......@@ -65,6 +69,19 @@ static unsigned int num_processors;
/* Bitmask of physically existing CPUs */
unsigned long phys_cpu_present_map;
/* ACPI MADT entry parsing functions */
#ifdef CONFIG_ACPI_BOOT
extern struct acpi_boot_flags acpi_boot;
#ifdef CONFIG_X86_LOCAL_APIC
extern int acpi_parse_lapic (acpi_table_entry_header *header);
extern int acpi_parse_lapic_addr_ovr (acpi_table_entry_header *header);
extern int acpi_parse_lapic_nmi (acpi_table_entry_header *header);
#endif /*CONFIG_X86_LOCAL_APIC*/
#ifdef CONFIG_X86_IO_APIC
extern int acpi_parse_ioapic (acpi_table_entry_header *header);
#endif /*CONFIG_X86_IO_APIC*/
#endif /*CONFIG_ACPI_BOOT*/
/*
* Intel MP BIOS table parsing routines:
*/
......@@ -122,13 +139,7 @@ static char __init *mpc_family(int family,int model)
return n;
}
#ifdef CONFIG_X86_IO_APIC
extern int have_acpi_tables; /* set by acpitable.c */
#else
#define have_acpi_tables (0)
#endif
/*
/*
* Have to match translation table entries to main table entries by counter
* hence the mpc_record variable .... can't see a less disgusting way of
* doing this ....
......@@ -427,10 +438,11 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
printk("APIC at: 0x%lX\n",mpc->mpc_lapic);
/* save the local APIC address, it might be non-default,
/*
* Save the local APIC address, it might be non-default,
* but only if we're not using the ACPI tables
*/
if (!have_acpi_tables)
if (!acpi_found_madt)
mp_lapic_addr = mpc->mpc_lapic;
if (clustered_apic_mode && mpc->mpc_oemptr) {
......@@ -451,7 +463,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
(struct mpc_config_processor *)mpt;
/* ACPI may already have provided this one for us */
if (!have_acpi_tables)
if (!acpi_found_madt)
MP_processor_info(m);
mpt += sizeof(*m);
count += sizeof(*m);
......@@ -665,7 +677,6 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
}
static struct intel_mp_floating *mpf_found;
extern void config_acpi_tables(void);
/*
* Scan the memory blocks for an SMP configuration block.
......@@ -674,16 +685,19 @@ void __init get_smp_config (void)
{
struct intel_mp_floating *mpf = mpf_found;
#ifdef CONFIG_X86_IO_APIC
#ifdef CONFIG_ACPI_BOOT
/*
* Check if the ACPI tables are provided. Use them only to get
* the processor information, mainly because it provides
* the info on the logical processor(s), rather than the physical
* processor(s) that are provided by the MPS. We attempt to
* check only if the user provided a commandline override
* Check if the MADT exists, and if so, use it to get processor
* information (ACPI_MADT_LAPIC). The MADT supports the concept
* of both logical (e.g. HT) and physical processor(s); where the
* MPS only supports physical.
*/
config_acpi_tables();
#endif
if (acpi_boot.madt) {
acpi_found_madt = acpi_table_parse(ACPI_APIC, acpi_parse_madt);
if (acpi_found_madt > 0)
acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic);
}
#endif /*CONFIG_ACPI_BOOT*/
printk("Intel MultiProcessor Specification v1.%d\n", mpf->mpf_specification);
if (mpf->mpf_feature2 & (1<<7)) {
......
......@@ -22,6 +22,7 @@
#define PCI_ASSIGN_ROMS 0x1000
#define PCI_BIOS_IRQ_SCAN 0x2000
#define PCI_ASSIGN_ALL_BUSSES 0x4000
#define PCI_NO_ACPI_ROUTING 0x8000
extern unsigned int pci_probe;
......@@ -65,6 +66,8 @@ struct irq_routing_table {
extern unsigned int pcibios_irq_mask;
extern int pci_use_acpi_routing;
void pcibios_irq_init(void);
void pcibios_fixup_irqs(void);
void pcibios_enable_irq(struct pci_dev *dev);
......@@ -12,7 +12,7 @@
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/acpi.h>
#include <asm/io.h>
#include <asm/smp.h>
#include <asm/io_apic.h>
......@@ -22,6 +22,8 @@
#define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
#define PIRQ_VERSION 0x0100
int pci_use_acpi_routing = 0;
static struct irq_routing_table *pirq_table;
/*
......@@ -512,6 +514,41 @@ static void __init pirq_find_router(void)
pirq_router_dev->slot_name);
}
static void pcibios_test_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
{
}
#ifdef CONFIG_ACPI_PCI
static int acpi_lookup_irq (
struct pci_dev *dev,
u8 pin,
int assign)
{
int result = 0;
int irq = 0;
/* TBD: Select IRQ from possible to improve routing performance. */
result = acpi_prt_get_irq(dev, pin, &irq);
if ((0 != result) || !irq) {
printk(KERN_ERR "PCI: Unable to resolve IRQ for device %s\n",
dev->slot_name);
return result;
}
printk(KERN_INFO "PCI: Found IRQ %d for device %s\n", irq,
dev->slot_name);
dev->irq = irq;
pirq_penalty[irq]++;
return 1;
}
#endif /* CONFIG_ACPI_PCI */
static struct irq_info *pirq_get_info(struct pci_dev *dev)
{
struct irq_routing_table *rt = pirq_table;
......@@ -524,38 +561,25 @@ static struct irq_info *pirq_get_info(struct pci_dev *dev)
return NULL;
}
static void pcibios_test_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
static int pirq_lookup_irq(struct pci_dev *dev, u8 pin, int assign)
{
}
static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
{
u8 pin;
struct irq_info *info;
int i, pirq, newirq;
int irq = 0;
u32 mask;
struct irq_router *r = pirq_router;
struct irq_info *info;
int newirq, pirq, i, irq = 0;
struct pci_dev *dev2;
char *msg = NULL;
u32 mask;
if (!pirq_table)
return 0;
/* Find IRQ routing entry */
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
if (!pin) {
DBG(" -> no interrupt pin\n");
return 0;
}
pin = pin - 1;
DBG("IRQ for %s:%d", dev->slot_name, pin);
info = pirq_get_info(dev);
if (!info) {
DBG(" -> not found in routing table\n");
return 0;
}
pirq = info->irq[pin].link;
mask = info->irq[pin].bitmap;
if (!pirq) {
......@@ -643,10 +667,42 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
return 1;
}
static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
{
u8 pin;
/* Find IRQ routing entry */
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
if (!pin) {
DBG("PCI: %s: no interrupt pin\n", dev->slot_name);
return 0;
}
pin -= 1;
#ifdef CONFIG_ACPI_PCI
if (pci_use_acpi_routing)
return acpi_lookup_irq(dev, pin, assign);
else
#endif
return pirq_lookup_irq(dev, pin, assign);
}
void __init pcibios_irq_init(void)
{
DBG("PCI: IRQ init\n");
#ifdef CONFIG_ACPI_PCI
if (acpi_prts.count && !(pci_probe & PCI_NO_ACPI_ROUTING)) {
printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
pci_use_acpi_routing = 1;
return;
}
if (!acpi_prts.count)
printk(KERN_INFO "PCI: Invalid acpi_prts [%d]\n", acpi_prts.count);
#endif
pirq_table = pirq_find_routing_table();
#ifdef CONFIG_PCI_BIOS
if (!pirq_table && (pci_probe & PCI_BIOS_IRQ_SCAN))
pirq_table = pcibios_get_irq_routing_table();
......
......@@ -1239,6 +1239,24 @@ void __devinit pcibios_fixup_bus(struct pci_bus *b)
}
struct pci_bus * __devinit pcibios_scan_root(int busnum)
{
struct list_head *list;
struct pci_bus *bus;
list_for_each(list, &pci_root_buses) {
bus = pci_bus_b(list);
if (bus->number == busnum) {
/* Already scanned */
return bus;
}
}
printk("PCI: Probing PCI hardware (bus %02x)\n", busnum);
return pci_scan_bus(busnum, pci_root_ops, NULL);
}
void __devinit pcibios_config_init(void)
{
/*
......@@ -1285,7 +1303,7 @@ void __init pcibios_init(void)
}
printk("PCI: Probing PCI hardware\n");
pci_root_bus = pci_scan_bus(0, pci_root_ops, NULL);
pci_root_bus = pcibios_scan_root(0);
if (clustered_apic_mode && (numnodes > 1)) {
for (quad = 1; quad < numnodes; ++quad) {
printk("Scanning PCI bus %d for quad %d\n",
......@@ -1296,7 +1314,10 @@ void __init pcibios_init(void)
}
pcibios_irq_init();
pcibios_fixup_peer_bridges();
if (!pci_use_acpi_routing)
pcibios_fixup_peer_bridges();
pcibios_fixup_irqs();
pcibios_resource_survey();
......@@ -1336,6 +1357,12 @@ char * __devinit pcibios_setup(char *str)
pci_probe = PCI_PROBE_CONF2 | PCI_NO_CHECKS;
return NULL;
}
#endif
#ifdef CONFIG_ACPI_PCI
else if (!strcmp(str, "noacpi")) {
pci_probe |= PCI_NO_ACPI_ROUTING;
return NULL;
}
#endif
else if (!strcmp(str, "rom")) {
pci_probe |= PCI_ASSIGN_ROMS;
......
......@@ -92,6 +92,7 @@
#include <linux/delay.h>
#include <linux/config.h>
#include <linux/init.h>
#include <linux/acpi.h>
#include <linux/apm_bios.h>
#ifdef CONFIG_BLK_DEV_RAM
#include <linux/blk.h>
......@@ -168,8 +169,6 @@ void __init visws_get_board_type_and_rev(void);
static int disable_x86_serial_nr __initdata = 1;
static int disable_x86_fxsr __initdata = 0;
int enable_acpi_smp_table;
/*
* This is set up by the setup-routine at boot-time
*/
......@@ -642,9 +641,6 @@ static void __init parse_mem_cmdline (char ** cmdline_p)
add_memory_region(start_at, mem_size, E820_RAM);
}
}
/* acpismp=force forces parsing and use of the ACPI SMP table */
if (c == ' ' && !memcmp(from, "acpismp=force", 13))
enable_acpi_smp_table = 1;
/*
* highmem=size forces highmem to be exactly 'size' bytes.
* This works even on boxes that have no highmem otherwise.
......@@ -869,7 +865,12 @@ void __init setup_arch(char **cmdline_p)
*/
reserve_bootmem(PAGE_SIZE, PAGE_SIZE);
#endif
#ifdef CONFIG_ACPI_SLEEP
/*
* Reserve low memory region for sleep support.
*/
acpi_reserve_bootmem();
#endif
#ifdef CONFIG_X86_LOCAL_APIC
/*
* Find and reserve possible boot-time SMP configuration:
......@@ -903,6 +904,15 @@ void __init setup_arch(char **cmdline_p)
smp_alloc_memory(); /* AP processor realmode stacks in low memory*/
#endif
paging_init();
#ifdef CONFIG_ACPI_BOOT
/*
* Initialize the ACPI boot-time table parser (gets the RSDP and SDT).
* Must do this after paging_init (due to reliance on fixmap, and thus
* the bootmem allocator) but before get_smp_config (to allow parsing
* of MADT).
*/
acpi_table_init(*cmdline_p);
#endif
#ifdef CONFIG_X86_LOCAL_APIC
/*
* get boot-time SMP configuration:
......@@ -1961,13 +1971,10 @@ extern void trap_init_f00f_bug(void);
static void __init init_intel(struct cpuinfo_x86 *c)
{
#ifndef CONFIG_M686
static int f00f_workaround_enabled = 0;
#endif
char *p = NULL;
unsigned int l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
#ifndef CONFIG_M686
#ifdef CONFIG_X86_F00F_BUG
/*
* All current models of Pentium and Pentium with MMX technology CPUs
* have the F0 0F bug, which lets nonpriviledged users lock up the system.
......@@ -1975,6 +1982,8 @@ static void __init init_intel(struct cpuinfo_x86 *c)
*/
c->f00f_bug = 0;
if ( c->x86 == 5 ) {
static int f00f_workaround_enabled = 0;
c->f00f_bug = 1;
if ( !f00f_workaround_enabled ) {
trap_init_f00f_bug();
......
......@@ -630,8 +630,8 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
info.si_signo = signr;
info.si_errno = 0;
info.si_code = SI_USER;
info.si_pid = current->p_pptr->pid;
info.si_uid = current->p_pptr->uid;
info.si_pid = current->parent->pid;
info.si_uid = current->parent->uid;
}
/* If the (new) signal is now blocked, requeue it. */
......@@ -670,7 +670,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
case SIGSTOP: {
struct signal_struct *sig;
current->exit_code = signr;
sig = current->p_pptr->sig;
sig = current->parent->sig;
preempt_disable();
current->state = TASK_STOPPED;
if (sig && !(sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP))
......
......@@ -828,7 +828,7 @@ static void __init do_boot_cpu (int apicid)
* We remove it from the pidhash and the runqueue
* once we got the process:
*/
idle = init_task.prev_task;
idle = prev_task(&init_task);
if (!idle)
panic("No idle process for CPU %d", cpu);
......
......@@ -775,35 +775,17 @@ asmlinkage void math_emulate(long arg)
#endif /* CONFIG_MATH_EMULATION */
#ifndef CONFIG_M686
#ifdef CONFIG_X86_F00F_BUG
void __init trap_init_f00f_bug(void)
{
unsigned long page;
pgd_t * pgd;
pmd_t * pmd;
pte_t * pte;
/*
* Allocate a new page in virtual address space,
* move the IDT into it and write protect this page.
*/
page = (unsigned long) vmalloc(PAGE_SIZE);
pgd = pgd_offset(&init_mm, page);
pmd = pmd_offset(pgd, page);
pte = pte_offset_kernel(pmd, page);
__free_page(pte_page(*pte));
*pte = mk_pte_phys(__pa(&idt_table), PAGE_KERNEL_RO);
/*
* Not that any PGE-capable kernel should have the f00f bug ...
*/
__flush_tlb_all();
__set_fixmap(FIX_F00F_IDT, __pa(&idt_table), PAGE_KERNEL_RO);
/*
* "idt" is magic - it overlaps the idt_descr
* variable so that updating idt will automatically
* update the idt descriptor..
*/
idt = (struct desc_struct *)page;
idt = (struct desc_struct *) fix_to_virt(FIX_F00F_IDT);
__asm__ __volatile__("lidt %0": "=m" (idt_descr));
}
#endif
......
......@@ -282,6 +282,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
return;
}
#ifdef CONFIG_X86_F00F_BUG
/*
* Pentium F0 0F C7 C8 bug workaround.
*/
......@@ -295,6 +296,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
return;
}
}
#endif
no_context:
/* Are we prepared to handle this kernel fault? */
......
mainmenu_name "Kernel configuration of Linux for IA-64 machines"
mainmenu_name "IA-64 Linux Kernel Configuration"
source init/Config.in
mainmenu_option next_comment
comment 'General setup'
comment 'Processor type and features'
define_bool CONFIG_IA64 y
......@@ -14,13 +14,6 @@ define_bool CONFIG_SBUS n
define_bool CONFIG_RWSEM_GENERIC_SPINLOCK y
define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then
define_bool CONFIG_ACPI y
define_bool CONFIG_ACPI_EFI y
define_bool CONFIG_ACPI_INTERPRETER y
define_bool CONFIG_ACPI_KERNEL_CONFIG y
fi
choice 'IA-64 processor type' \
"Itanium CONFIG_ITANIUM \
McKinley CONFIG_MCKINLEY" Itanium
......@@ -38,6 +31,13 @@ choice 'Kernel page size' \
16KB CONFIG_IA64_PAGE_SIZE_16KB \
64KB CONFIG_IA64_PAGE_SIZE_64KB" 16KB
if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then
define_bool CONFIG_ACPI y
define_bool CONFIG_ACPI_EFI y
define_bool CONFIG_ACPI_INTERPRETER y
define_bool CONFIG_ACPI_KERNEL_CONFIG y
fi
if [ "$CONFIG_ITANIUM" = "y" ]; then
define_bool CONFIG_IA64_BRL_EMU y
bool ' Enable Itanium B-step specific code' CONFIG_ITANIUM_BSTEP_SPECIFIC
......@@ -136,6 +136,17 @@ else
fi
endmenu
else # ! HP_SIM
mainmenu_option next_comment
comment 'Block devices'
tristate 'Loopback device support' CONFIG_BLK_DEV_LOOP
dep_tristate 'Network block device support' CONFIG_BLK_DEV_NBD $CONFIG_NET
tristate 'RAM disk support' CONFIG_BLK_DEV_RAM
if [ "$CONFIG_BLK_DEV_RAM" = "y" -o "$CONFIG_BLK_DEV_RAM" = "m" ]; then
int ' Default RAM disk size' CONFIG_BLK_DEV_RAM_SIZE 4096
fi
endmenu
fi # !HP_SIM
mainmenu_option next_comment
......@@ -228,15 +239,7 @@ fi
fi # !HP_SIM
if [ "$CONFIG_IA64_HP_SIM" != "n" -o "$CONFIG_IA64_GENERIC" != "n" ]; then
mainmenu_option next_comment
comment 'Simulated drivers'
bool 'Simulated Ethernet ' CONFIG_SIMETH
bool 'Simulated serial driver support' CONFIG_SIM_SERIAL
if [ "$CONFIG_SCSI" != "n" ]; then
bool 'Simulated SCSI disk' CONFIG_SCSI_SIM
fi
endmenu
source arch/ia64/hp/Config.in
fi
......@@ -258,15 +261,6 @@ if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then
bool ' Spinlock debugging' CONFIG_DEBUG_SPINLOCK
bool ' Turn on compare-and-exchange bug checking (slow!)' CONFIG_IA64_DEBUG_CMPXCHG
bool ' Turn on irq debug checks (slow!)' CONFIG_IA64_DEBUG_IRQ
bool ' Built-in Kernel Debugger support' CONFIG_KDB
dep_tristate ' KDB modules' CONFIG_KDB_MODULES $CONFIG_KDB
if [ "$CONFIG_KDB" = "y" ]; then
bool ' KDB off by default' CONFIG_KDB_OFF
comment ' Load all symbols for debugging is required for KDB'
define_bool CONFIG_KALLSYMS y
else
bool ' Load all symbols for debugging' CONFIG_KALLSYMS
fi
fi
endmenu
This diff is collapsed.
#
# ia64/platform/hp/Makefile
#
# Copyright (C) 2002 Hewlett-Packard Co.
# David Mosberger-Tang <davidm@hpl.hp.com>
# Copyright (C) 1999 Silicon Graphics, Inc.
# Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com)
#
......@@ -12,6 +14,10 @@ O_TARGET := hp.a
obj-y := hpsim_console.o hpsim_irq.o hpsim_setup.o
obj-$(CONFIG_IA64_GENERIC) += hpsim_machvec.o
obj-$(CONFIG_SIMETH) += simeth.o
obj-$(CONFIG_SIM_SERIAL) += simserial.o
obj-$(CONFIG_SCSI_SIM) += simscsi.o
clean::
include $(TOPDIR)/Rules.make
This diff is collapsed.
/*
* Simulated SCSI driver.
*
* Copyright (C) 1999, 2001-2002 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
* Stephane Eranian <eranian@hpl.hp.com>
*
* 02/01/15 David Mosberger Updated for v2.5.1
* 99/12/18 David Mosberger Added support for READ10/WRITE10 needed by linux v2.3.33
*/
#include <linux/config.h>
#include <linux/blk.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <scsi/scsi.h>
#include <asm/irq.h>
#include "../drivers/scsi/scsi.h"
#include "../drivers/scsi/sd.h"
#include "../drivers/scsi/hosts.h"
#include "simscsi.h"
#define DEBUG_SIMSCSI 1
/* Simulator system calls: */
#define SSC_OPEN 50
#define SSC_CLOSE 51
#define SSC_READ 52
#define SSC_WRITE 53
#define SSC_GET_COMPLETION 54
#define SSC_WAIT_COMPLETION 55
#define SSC_WRITE_ACCESS 2
#define SSC_READ_ACCESS 1
#if DEBUG_SIMSCSI
int simscsi_debug;
# define DBG simscsi_debug
#else
# define DBG 0
#endif
static struct Scsi_Host *host;
static void simscsi_interrupt (unsigned long val);
DECLARE_TASKLET(simscsi_tasklet, simscsi_interrupt, 0);
struct disk_req {
unsigned long addr;
unsigned len;
};
struct disk_stat {
int fd;
unsigned count;
};
extern long ia64_ssc (long arg0, long arg1, long arg2, long arg3, int nr);
static int desc[8] = { -1, -1, -1, -1, -1, -1, -1, -1 };
static struct queue_entry {
Scsi_Cmnd *sc;
} queue[SIMSCSI_REQ_QUEUE_LEN];
static int rd, wr;
static atomic_t num_reqs = ATOMIC_INIT(0);
/* base name for default disks */
static char *simscsi_root = DEFAULT_SIMSCSI_ROOT;
#define MAX_ROOT_LEN 128
/*
* used to setup a new base for disk images
* to use /foo/bar/disk[a-z] as disk images
* you have to specify simscsi=/foo/bar/disk on the command line
*/
static int __init
simscsi_setup (char *s)
{
/* XXX Fix me we may need to strcpy() ? */
if (strlen(s) > MAX_ROOT_LEN) {
printk("simscsi_setup: prefix too long---using default %s\n", simscsi_root);
}
simscsi_root = s;
return 1;
}
__setup("simscsi=", simscsi_setup);
static void
simscsi_interrupt (unsigned long val)
{
Scsi_Cmnd *sc;
while ((sc = queue[rd].sc) != 0) {
atomic_dec(&num_reqs);
queue[rd].sc = 0;
if (DBG)
printk("simscsi_interrupt: done with %ld\n", sc->serial_number);
(*sc->scsi_done)(sc);
rd = (rd + 1) % SIMSCSI_REQ_QUEUE_LEN;
}
}
int
simscsi_detect (Scsi_Host_Template *templ)
{
templ->proc_name = "simscsi";
host = scsi_register(templ, 0);
return 1; /* fake one SCSI host adapter */
}
int
simscsi_release (struct Scsi_Host *host)
{
return 0; /* this is easy... */
}
const char *
simscsi_info (struct Scsi_Host *host)
{
return "simulated SCSI host adapter";
}
int
simscsi_abort (Scsi_Cmnd *cmd)
{
printk ("simscsi_abort: unimplemented\n");
return SCSI_ABORT_SUCCESS;
}
int
simscsi_reset (Scsi_Cmnd *cmd, unsigned int reset_flags)
{
printk ("simscsi_reset: unimplemented\n");
return SCSI_RESET_SUCCESS;
}
int
simscsi_biosparam (Disk *disk, kdev_t n, int ip[])
{
int size = disk->capacity;
ip[0] = 64;
ip[1] = 32;
ip[2] = size >> 11;
return 0;
}
static void
simscsi_readwrite (Scsi_Cmnd *sc, int mode, unsigned long offset, unsigned long len)
{
struct disk_stat stat;
struct disk_req req;
req.addr = __pa(sc->request_buffer);
req.len = len; /* # of bytes to transfer */
if (sc->request_bufflen < req.len)
return;
stat.fd = desc[sc->target];
if (DBG)
printk("simscsi_%s @ %lx (off %lx)\n",
mode == SSC_READ ? "read":"write", req.addr, offset);
ia64_ssc(stat.fd, 1, __pa(&req), offset, mode);
ia64_ssc(__pa(&stat), 0, 0, 0, SSC_WAIT_COMPLETION);
if (stat.count == req.len) {
sc->result = GOOD;
} else {
sc->result = DID_ERROR << 16;
}
}
static void
simscsi_sg_readwrite (Scsi_Cmnd *sc, int mode, unsigned long offset)
{
int list_len = sc->use_sg;
struct scatterlist *sl = (struct scatterlist *)sc->buffer;
struct disk_stat stat;
struct disk_req req;
stat.fd = desc[sc->target];
while (list_len) {
req.addr = __pa(page_address(sl->page) + sl->offset);
req.len = sl->length;
if (DBG)
printk("simscsi_sg_%s @ %lx (off %lx) use_sg=%d len=%d\n",
mode == SSC_READ ? "read":"write", req.addr, offset,
list_len, sl->length);
ia64_ssc(stat.fd, 1, __pa(&req), offset, mode);
ia64_ssc(__pa(&stat), 0, 0, 0, SSC_WAIT_COMPLETION);
/* should not happen in our case */
if (stat.count != req.len) {
sc->result = DID_ERROR << 16;
return;
}
offset += sl->length;
sl++;
list_len--;
}
sc->result = GOOD;
}
/*
* function handling both READ_6/WRITE_6 (non-scatter/gather mode)
* commands.
* Added 02/26/99 S.Eranian
*/
static void
simscsi_readwrite6 (Scsi_Cmnd *sc, int mode)
{
unsigned long offset;
offset = (((sc->cmnd[1] & 0x1f) << 16) | (sc->cmnd[2] << 8) | sc->cmnd[3])*512;
if (sc->use_sg > 0)
simscsi_sg_readwrite(sc, mode, offset);
else
simscsi_readwrite(sc, mode, offset, sc->cmnd[4]*512);
}
static void
simscsi_readwrite10 (Scsi_Cmnd *sc, int mode)
{
unsigned long offset;
offset = ( (sc->cmnd[2] << 24) | (sc->cmnd[3] << 16)
| (sc->cmnd[4] << 8) | (sc->cmnd[5] << 0))*512;
if (sc->use_sg > 0)
simscsi_sg_readwrite(sc, mode, offset);
else
simscsi_readwrite(sc, mode, offset, ((sc->cmnd[7] << 8) | sc->cmnd[8])*512);
}
int
simscsi_queuecommand (Scsi_Cmnd *sc, void (*done)(Scsi_Cmnd *))
{
char fname[MAX_ROOT_LEN+16];
char *buf;
#if DEBUG_SIMSCSI
register long sp asm ("sp");
if (DBG)
printk("simscsi_queuecommand: target=%d,cmnd=%u,sc=%lu,sp=%lx,done=%p\n",
sc->target, sc->cmnd[0], sc->serial_number, sp, done);
#endif
sc->result = DID_BAD_TARGET << 16;
sc->scsi_done = done;
if (sc->target <= 7 && sc->lun == 0) {
switch (sc->cmnd[0]) {
case INQUIRY:
if (sc->request_bufflen < 35) {
break;
}
sprintf (fname, "%s%c", simscsi_root, 'a' + sc->target);
desc[sc->target] = ia64_ssc (__pa(fname), SSC_READ_ACCESS|SSC_WRITE_ACCESS,
0, 0, SSC_OPEN);
if (desc[sc->target] < 0) {
/* disk doesn't exist... */
break;
}
buf = sc->request_buffer;
buf[0] = 0; /* magnetic disk */
buf[1] = 0; /* not a removable medium */
buf[2] = 2; /* SCSI-2 compliant device */
buf[3] = 2; /* SCSI-2 response data format */
buf[4] = 31; /* additional length (bytes) */
buf[5] = 0; /* reserved */
buf[6] = 0; /* reserved */
buf[7] = 0; /* various flags */
memcpy(buf + 8, "HP SIMULATED DISK 0.00", 28);
sc->result = GOOD;
break;
case TEST_UNIT_READY:
sc->result = GOOD;
break;
case READ_6:
if (desc[sc->target] < 0 )
break;
simscsi_readwrite6(sc, SSC_READ);
break;
case READ_10:
if (desc[sc->target] < 0 )
break;
simscsi_readwrite10(sc, SSC_READ);
break;
case WRITE_6:
if (desc[sc->target] < 0)
break;
simscsi_readwrite6(sc, SSC_WRITE);
break;
case WRITE_10:
if (desc[sc->target] < 0)
break;
simscsi_readwrite10(sc, SSC_WRITE);
break;
case READ_CAPACITY:
if (desc[sc->target] < 0 || sc->request_bufflen < 8) {
break;
}
buf = sc->request_buffer;
/* pretend to be a 1GB disk (partition table contains real stuff): */
buf[0] = 0x00;
buf[1] = 0x1f;
buf[2] = 0xff;
buf[3] = 0xff;
/* set block size of 512 bytes: */
buf[4] = 0;
buf[5] = 0;
buf[6] = 2;
buf[7] = 0;
sc->result = GOOD;
break;
case MODE_SENSE:
printk("MODE_SENSE\n");
break;
case START_STOP:
printk("START_STOP\n");
break;
default:
panic("simscsi: unknown SCSI command %u\n", sc->cmnd[0]);
}
}
if (sc->result == DID_BAD_TARGET) {
sc->result |= DRIVER_SENSE << 24;
sc->sense_buffer[0] = 0x70;
sc->sense_buffer[2] = 0x00;
}
if (atomic_read(&num_reqs) >= SIMSCSI_REQ_QUEUE_LEN) {
panic("Attempt to queue command while command is pending!!");
}
atomic_inc(&num_reqs);
queue[wr].sc = sc;
wr = (wr + 1) % SIMSCSI_REQ_QUEUE_LEN;
tasklet_schedule(&simscsi_tasklet);
return 0;
}
static Scsi_Host_Template driver_template = SIMSCSI;
#define __initcall(fn) late_initcall(fn)
#include "../drivers/scsi/scsi_module.c"
/*
* Simulated SCSI driver.
*
* Copyright (C) 1999 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
*/
#ifndef SIMSCSI_H
#define SIMSCSI_H
#define SIMSCSI_REQ_QUEUE_LEN 64
#define DEFAULT_SIMSCSI_ROOT "/var/ski-disks/sd"
extern int simscsi_detect (Scsi_Host_Template *);
extern int simscsi_release (struct Scsi_Host *);
extern const char *simscsi_info (struct Scsi_Host *);
extern int simscsi_queuecommand (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
extern int simscsi_abort (Scsi_Cmnd *);
extern int simscsi_reset (Scsi_Cmnd *, unsigned int);
extern int simscsi_biosparam (Disk *, kdev_t, int[]);
#define SIMSCSI { \
detect: simscsi_detect, \
release: simscsi_release, \
info: simscsi_info, \
queuecommand: simscsi_queuecommand, \
abort: simscsi_abort, \
reset: simscsi_reset, \
bios_param: simscsi_biosparam, \
can_queue: SIMSCSI_REQ_QUEUE_LEN, \
this_id: -1, \
sg_tablesize: SG_ALL, \
cmd_per_lun: SIMSCSI_REQ_QUEUE_LEN, \
present: 0, \
unchecked_isa_dma: 0, \
use_clustering: DISABLE_CLUSTERING \
}
#endif /* SIMSCSI_H */
This diff is collapsed.
#include <asm/asmmacro.h>
#include <asm/offsets.h>
#include <asm/signal.h>
#include <asm/thread_info.h>
#include "../kernel/minstate.h"
......@@ -87,18 +88,21 @@ END(sys32_sigsuspend)
GLOBAL_ENTRY(ia32_ret_from_clone)
PT_REGS_UNWIND_INFO(0)
#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)
/*
* We need to call schedule_tail() to complete the scheduling process.
* Called by ia64_switch_to after do_fork()->copy_thread(). r8 contains the
* address of the previously executing task.
*/
br.call.sptk.many rp=ia64_invoke_schedule_tail
.ret1: adds r2=IA64_TASK_PTRACE_OFFSET,r13
.ret1:
#endif
adds r2=TI_FLAGS+IA64_TASK_SIZE,r13
;;
ld8 r2=[r2]
ld4 r2=[r2]
;;
mov r8=0
tbit.nz p6,p0=r2,PT_SYSCALLTRACE_BIT
tbit.nz p6,p0=r2,TIF_SYSCALL_TRACE
(p6) br.cond.spnt .ia32_strace_check_retval
;; // prevent RAW on r8
END(ia32_ret_from_clone)
......
......@@ -20,7 +20,7 @@ ia32_intercept (struct pt_regs *regs, unsigned long isr)
{
switch ((isr >> 16) & 0xff) {
case 0: /* Instruction intercept fault */
case 3: /* Locked Data reference fault */
case 4: /* Locked Data reference fault */
case 1: /* Gate intercept trap */
return -1;
......
......@@ -486,6 +486,7 @@ END(ia64_trace_syscall)
GLOBAL_ENTRY(ia64_ret_from_clone)
PT_REGS_UNWIND_INFO(0)
#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)
/*
* We need to call schedule_tail() to complete the scheduling process.
* Called by ia64_switch_to after do_fork()->copy_thread(). r8 contains the
......@@ -493,6 +494,7 @@ GLOBAL_ENTRY(ia64_ret_from_clone)
*/
br.call.sptk.many rp=ia64_invoke_schedule_tail
.ret8:
#endif
adds r2=TI_FLAGS+IA64_TASK_SIZE,r13
;;
ld4 r2=[r2]
......@@ -620,7 +622,7 @@ GLOBAL_ENTRY(ia64_leave_kernel)
shr.u r18=r19,16 // get byte size of existing "dirty" partition
;;
mov r16=ar.bsp // get existing backing store pointer
movl r17=PERCPU_ADDR+IA64_CPU_PHYS_STACKED_SIZE_P8_OFFSET
movl r17=THIS_CPU(ia64_phys_stacked_size_p8)
;;
ld4 r17=[r17] // r17 = cpu_data->phys_stacked_size_p8
(pKern) br.cond.dpnt skip_rbs_switch
......@@ -756,6 +758,7 @@ ENTRY(handle_syscall_error)
br.cond.sptk ia64_leave_kernel
END(handle_syscall_error)
#ifdef CONFIG_SMP
/*
* Invoke schedule_tail(task) while preserving in0-in7, which may be needed
* in case a system call gets restarted.
......@@ -772,6 +775,8 @@ GLOBAL_ENTRY(ia64_invoke_schedule_tail)
br.ret.sptk.many rp
END(ia64_invoke_schedule_tail)
#endif /* CONFIG_SMP */
#if __GNUC__ < 3
/*
......
......@@ -59,7 +59,7 @@ EXPORT_SYMBOL(clear_page);
#include <asm/processor.h>
# ifndef CONFIG_NUMA
EXPORT_SYMBOL(_cpu_data);
EXPORT_SYMBOL(cpu_info);
# endif
EXPORT_SYMBOL(kernel_thread);
......
......@@ -645,7 +645,6 @@ ENTRY(break_fault)
mov r3=255
adds r15=-1024,r15 // r15 contains the syscall number---subtract 1024
adds r2=IA64_TASK_PTRACE_OFFSET,r13 // r2 = &current->ptrace
;;
cmp.geu p6,p7=r3,r15 // (syscall > 0 && syscall <= 1024+255) ?
movl r16=sys_call_table
......
This diff is collapsed.
......@@ -193,7 +193,10 @@ ia64_save_extra (struct task_struct *task)
if ((task->thread.flags & IA64_THREAD_PM_VALID) != 0)
pfm_save_regs(task);
if (local_cpu_data->pfm_syst_wide) pfm_syst_wide_update_task(task, 0);
# ifdef CONFIG_SMP
if (local_cpu_data->pfm_syst_wide)
pfm_syst_wide_update_task(task, 0);
# endif
#endif
if (IS_IA32_PROCESS(ia64_task_regs(task)))
......@@ -210,7 +213,9 @@ ia64_load_extra (struct task_struct *task)
if ((task->thread.flags & IA64_THREAD_PM_VALID) != 0)
pfm_load_regs(task);
# ifdef CONFIG_SMP
if (local_cpu_data->pfm_syst_wide) pfm_syst_wide_update_task(task, 1);
# endif
#endif
if (IS_IA32_PROCESS(ia64_task_regs(task)))
......
......@@ -54,12 +54,10 @@
extern char _end;
#ifdef CONFIG_NUMA
struct cpuinfo_ia64 *boot_cpu_data;
#else
struct cpuinfo_ia64 _cpu_data[NR_CPUS] __attribute__ ((section ("__special_page_section")));
#endif
unsigned long __per_cpu_offset[NR_CPUS];
struct cpuinfo_ia64 cpu_info __per_cpu_data;
unsigned long ia64_phys_stacked_size_p8;
unsigned long ia64_cycles_per_usec;
struct ia64_boot_param *ia64_boot_param;
struct screen_info screen_info;
......@@ -511,6 +509,12 @@ identify_cpu (struct cpuinfo_ia64 *c)
c->unimpl_pa_mask = ~((1L<<63) | ((1L << phys_addr_size) - 1));
}
void
setup_per_cpu_areas (void)
{
/* start_kernel() requires this... */
}
/*
* cpu_init() initializes state that is per-CPU. This function acts
* as a 'CPU state barrier', nothing should get across.
......@@ -518,46 +522,21 @@ identify_cpu (struct cpuinfo_ia64 *c)
void
cpu_init (void)
{
extern char __per_cpu_start[], __phys_per_cpu_start[], __per_cpu_end[];
extern void __init ia64_mmu_init (void *);
unsigned long num_phys_stacked;
pal_vm_info_2_u_t vmi;
unsigned int max_ctx;
struct cpuinfo_ia64 *my_cpu_data;
#ifdef CONFIG_NUMA
int cpu, order;
struct cpuinfo_ia64 *my_cpu_info;
void *my_cpu_data;
int cpu = smp_processor_id();
/*
* If NUMA is configured, the cpu_data array is not preallocated. The boot cpu
* allocates entries for every possible cpu. As the remaining cpus come online,
* they reallocate a new cpu_data structure on their local node. This extra work
* is required because some boot code references all cpu_data structures
* before the cpus are actually started.
*/
if (!boot_cpu_data) {
my_cpu_data = alloc_bootmem_pages_node(NODE_DATA(numa_node_id()),
sizeof(struct cpuinfo_ia64));
boot_cpu_data = my_cpu_data;
my_cpu_data->cpu_data[0] = my_cpu_data;
for (cpu = 1; cpu < NR_CPUS; ++cpu)
my_cpu_data->cpu_data[cpu]
= alloc_bootmem_pages_node(NODE_DATA(numa_node_id()),
sizeof(struct cpuinfo_ia64));
for (cpu = 1; cpu < NR_CPUS; ++cpu)
memcpy(my_cpu_data->cpu_data[cpu]->cpu_data,
my_cpu_data->cpu_data, sizeof(my_cpu_data->cpu_data));
} else {
order = get_order(sizeof(struct cpuinfo_ia64));
my_cpu_data = page_address(alloc_pages_node(numa_node_id(), GFP_KERNEL, order));
memcpy(my_cpu_data, boot_cpu_data->cpu_data[smp_processor_id()],
sizeof(struct cpuinfo_ia64));
__free_pages(virt_to_page(boot_cpu_data->cpu_data[smp_processor_id()]),
order);
for (cpu = 0; cpu < NR_CPUS; ++cpu)
boot_cpu_data->cpu_data[cpu]->cpu_data[smp_processor_id()] = my_cpu_data;
}
#else
my_cpu_data = cpu_data(smp_processor_id());
#endif
my_cpu_data = alloc_bootmem_pages(__per_cpu_end - __per_cpu_start);
memcpy(my_cpu_data, __phys_per_cpu_start, __per_cpu_end - __per_cpu_start);
__per_cpu_offset[cpu] = (char *) my_cpu_data - __per_cpu_start;
my_cpu_info = my_cpu_data + ((char *) &cpu_info - __per_cpu_start);
/*
* We can't pass "local_cpu_data" to identify_cpu() because we haven't called
......@@ -565,7 +544,7 @@ cpu_init (void)
* depends on the data returned by identify_cpu(). We break the dependency by
* accessing cpu_data() the old way, through identity mapped space.
*/
identify_cpu(my_cpu_data);
identify_cpu(my_cpu_info);
/* Clear the stack memory reserved for pt_regs: */
memset(ia64_task_regs(current), 0, sizeof(struct pt_regs));
......@@ -626,7 +605,7 @@ cpu_init (void)
printk ("cpu_init: PAL RSE info failed, assuming 96 physical stacked regs\n");
num_phys_stacked = 96;
}
local_cpu_data->phys_stacked_size_p8 = num_phys_stacked*8 + 8;
/* size of physical stacked register partition plus 8 bytes: */
ia64_phys_stacked_size_p8 = num_phys_stacked*8 + 8;
platform_cpu_init();
}
......@@ -75,12 +75,11 @@ struct call_data_struct {
static volatile struct call_data_struct *call_data;
static spinlock_t migration_lock = SPIN_LOCK_UNLOCKED;
static task_t *migrating_task;
#define IPI_CALL_FUNC 0
#define IPI_CPU_STOP 1
#define IPI_MIGRATE_TASK 2
/* This needs to be cacheline aligned because it is written to by *other* CPUs. */
static __u64 ipi_operation __per_cpu_data ____cacheline_aligned;
static void
stop_this_cpu (void)
......@@ -99,7 +98,7 @@ void
handle_IPI (int irq, void *dev_id, struct pt_regs *regs)
{
int this_cpu = smp_processor_id();
unsigned long *pending_ipis = &local_cpu_data->ipi_operation;
unsigned long *pending_ipis = &this_cpu(ipi_operation);
unsigned long ops;
/* Count this now; we may make a call that never returns. */
......@@ -143,14 +142,6 @@ handle_IPI (int irq, void *dev_id, struct pt_regs *regs)
}
break;
case IPI_MIGRATE_TASK:
{
task_t *p = migrating_task;
spin_unlock(&migration_lock);
sched_task_migrated(p);
}
break;
case IPI_CPU_STOP:
stop_this_cpu();
break;
......@@ -167,7 +158,7 @@ handle_IPI (int irq, void *dev_id, struct pt_regs *regs)
static inline void
send_IPI_single (int dest_cpu, int op)
{
set_bit(op, &cpu_data(dest_cpu)->ipi_operation);
set_bit(op, &per_cpu(ipi_operation, dest_cpu));
platform_send_ipi(dest_cpu, IA64_IPI_VECTOR, IA64_IPI_DM_INT, 0);
}
......@@ -350,15 +341,6 @@ smp_send_stop (void)
smp_num_cpus = 1;
}
void
smp_migrate_task (int cpu, task_t *p)
{
/* The target CPU will unlock the migration spinlock: */
spin_lock(&migration_lock);
migrating_task = p;
send_IPI_single(cpu, IPI_MIGRATE_TASK);
}
int __init
setup_profiling_timer (unsigned int multiplier)
{
......
......@@ -413,7 +413,7 @@ do_boot_cpu (int sapicid)
* We remove it from the pidhash and the runqueue
* once we got the process:
*/
idle = init_task.prev_task;
idle = prev_task(&init_task);
if (!idle)
panic("No idle process for CPU %d", cpu);
......
......@@ -1305,11 +1305,7 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
* handler into reading an arbitrary kernel addresses...
*/
if (!user_mode(regs)) {
#ifdef GAS_HAS_LOCAL_TAGS
fix = search_exception_table(regs->cr_iip + ia64_psr(regs)->ri);
#else
fix = search_exception_table(regs->cr_iip);
#endif
fix = SEARCH_EXCEPTION_TABLE(regs);
}
if (user_mode(regs) || fix.cont) {
if ((current->thread.flags & IA64_THREAD_UAC_SIGBUS) != 0)
......
......@@ -18,7 +18,7 @@
# define PREFETCH_LINES 9 // magic number
#else
# define L3_LINE_SIZE 128 // McKinley L3 line size
# define PREFETCH_LINES 7 // magic number
# define PREFETCH_LINES 12 // magic number
#endif
#define saved_lc r2
......
......@@ -49,7 +49,6 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
int signal = SIGSEGV, code = SEGV_MAPERR;
struct vm_area_struct *vma, *prev_vma;
struct mm_struct *mm = current->mm;
struct exception_fixup fix;
struct siginfo si;
unsigned long mask;
......@@ -167,15 +166,8 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
return;
}
#ifdef GAS_HAS_LOCAL_TAGS
fix = search_exception_table(regs->cr_iip + ia64_psr(regs)->ri);
#else
fix = search_exception_table(regs->cr_iip);
#endif
if (fix.cont) {
handle_exception(regs, fix);
if (done_with_exception(regs))
return;
}
/*
* Oops. The kernel tried to access some bad page. We'll have to terminate things
......
......@@ -103,12 +103,12 @@ free_initmem (void)
free_page(addr);
++totalram_pages;
}
printk ("Freeing unused kernel memory: %ldkB freed\n",
(&__init_end - &__init_begin) >> 10);
printk(KERN_INFO "Freeing unused kernel memory: %ldkB freed\n",
(&__init_end - &__init_begin) >> 10);
}
void
free_initrd_mem(unsigned long start, unsigned long end)
free_initrd_mem (unsigned long start, unsigned long end)
{
/*
* EFI uses 4KB pages while the kernel can use 4KB or bigger.
......@@ -145,7 +145,7 @@ free_initrd_mem(unsigned long start, unsigned long end)
end = end & PAGE_MASK;
if (start < end)
printk ("Freeing initrd memory: %ldkB freed\n", (end - start) >> 10);
printk(KERN_INFO "Freeing initrd memory: %ldkB freed\n", (end - start) >> 10);
for (; start < end; start += PAGE_SIZE) {
if (!VALID_PAGE(virt_to_page(start)))
......
......@@ -7,12 +7,6 @@ BEGIN {
print " * This file was generated by arch/ia64/tools/print_offsets.awk."
print " *"
print " */"
#
# This is a cheesy hack. Make sure that
# PT_PTRACED == 1<<PT_PTRACED_BIT.
#
print "#define PT_PTRACED_BIT 0"
print "#define PT_SYSCALLTRACE_BIT 1"
}
# look for .tab:
......
......@@ -52,14 +52,7 @@ tab[] =
{ "SIGFRAME_SIZE", sizeof (struct sigframe) },
{ "UNW_FRAME_INFO_SIZE", sizeof (struct unw_frame_info) },
{ "", 0 }, /* spacer */
{ "IA64_TASK_PTRACE_OFFSET", offsetof (struct task_struct, ptrace) },
{ "IA64_TASK_THREAD_OFFSET", offsetof (struct task_struct, thread) },
{ "IA64_TASK_THREAD_KSP_OFFSET", offsetof (struct task_struct, thread.ksp) },
#ifdef CONFIG_PERFMON
{ "IA64_TASK_PFM_OVFL_BLOCK_RESET_OFFSET",offsetof(struct task_struct, thread.pfm_ovfl_block_reset) },
#endif
{ "IA64_TASK_PID_OFFSET", offsetof (struct task_struct, pid) },
{ "IA64_TASK_MM_OFFSET", offsetof (struct task_struct, mm) },
{ "IA64_PT_REGS_CR_IPSR_OFFSET", offsetof (struct pt_regs, cr_ipsr) },
{ "IA64_PT_REGS_CR_IIP_OFFSET", offsetof (struct pt_regs, cr_iip) },
{ "IA64_PT_REGS_CR_IFS_OFFSET", offsetof (struct pt_regs, cr_ifs) },
......@@ -169,9 +162,6 @@ tab[] =
{ "IA64_SIGFRAME_SIGCONTEXT_OFFSET", offsetof (struct sigframe, sc) },
{ "IA64_CLONE_VFORK", CLONE_VFORK },
{ "IA64_CLONE_VM", CLONE_VM },
{ "IA64_CPU_IRQ_COUNT_OFFSET", offsetof (struct cpuinfo_ia64, irq_stat.f.irq_count) },
{ "IA64_CPU_BH_COUNT_OFFSET", offsetof (struct cpuinfo_ia64, irq_stat.f.bh_count) },
{ "IA64_CPU_PHYS_STACKED_SIZE_P8_OFFSET",offsetof (struct cpuinfo_ia64, phys_stacked_size_p8)},
};
static const char *tabs = "\t\t\t\t\t\t\t\t\t\t";
......@@ -189,16 +179,6 @@ main (int argc, char **argv)
printf ("/*\n * DO NOT MODIFY\n *\n * This file was generated by "
"arch/ia64/tools/print_offsets.\n *\n */\n\n");
/* This is stretching things a bit, but entry.S needs the bit number
for PT_PTRACED and it can't include <linux/sched.h> so this seems
like a reasonably solution. At least the code won't break in
subtle ways should PT_PTRACED ever change. Ditto for
PT_TRACESYS_BIT. */
printf ("#define PT_PTRACED_BIT\t\t\t%u\n", ffs (PT_PTRACED) - 1);
#if 0
printf ("#define PT_SYSCALLTRACE_BIT\t\t\t%u\n\n", ffs (PT_SYSCALLTRACE) - 1);
#endif
for (i = 0; i < sizeof (tab) / sizeof (tab[0]); ++i)
{
if (tab[i].name[0] == '\0')
......
#include <linux/config.h>
#include <asm/cache.h>
#include <asm/ptrace.h>
#include <asm/system.h>
......@@ -70,11 +71,6 @@ SECTIONS
{ *(__ksymtab) }
__stop___ksymtab = .;
__start___kallsyms = .; /* All kernel symbols for debugging */
__kallsyms : AT(ADDR(__kallsyms) - PAGE_OFFSET)
{ *(__kallsyms) }
__stop___kallsyms = .;
/* Unwind info & table: */
. = ALIGN(8);
.IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - PAGE_OFFSET)
......@@ -124,10 +120,7 @@ SECTIONS
.data.init_task : AT(ADDR(.data.init_task) - PAGE_OFFSET)
{ *(.data.init_task) }
.data.page_aligned : AT(ADDR(.data.page_aligned) - PAGE_OFFSET)
{ *(.data.idt) }
. = ALIGN(64);
. = ALIGN(SMP_CACHE_BYTES);
.data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - PAGE_OFFSET)
{ *(.data.cacheline_aligned) }
......@@ -135,6 +128,17 @@ SECTIONS
.kstrtab : AT(ADDR(.kstrtab) - PAGE_OFFSET)
{ *(.kstrtab) }
/* Per-cpu data: */
. = ALIGN(PAGE_SIZE);
__phys_per_cpu_start = .;
.data.percpu PERCPU_ADDR : AT(__phys_per_cpu_start - PAGE_OFFSET)
{
__per_cpu_start = .;
*(.data.percpu)
__per_cpu_end = .;
}
. = __phys_per_cpu_start + 4096; /* ensure percpu fits into smallest page size (4KB) */
.data : AT(ADDR(.data) - PAGE_OFFSET)
{ *(.data) *(.gnu.linkonce.d*) CONSTRUCTORS }
......@@ -151,7 +155,7 @@ SECTIONS
{ *(.sbss) *(.scommon) }
.bss : AT(ADDR(.bss) - PAGE_OFFSET)
{ *(.bss) *(COMMON) }
. = ALIGN(64 / 8);
_end = .;
/* Stabs debugging sections. */
......
......@@ -123,7 +123,7 @@ void __init smp_boot_cpus(void)
/* Spawn a new process normally. Grab a pointer to
its task struct so we can mess with it */
do_fork(CLONE_VM|CLONE_PID, 0, &regs, 0);
p = init_task.prev_task;
p = prev_task(&init_task);
/* Schedule the first task manually */
p->processor = i;
......@@ -152,7 +152,7 @@ void __init smp_boot_cpus(void)
* Linux can schedule processes on this slave.
*/
kernel_thread(0, NULL, CLONE_PID);
p = init_task.prev_task;
p = prev_task(&init_task);
sprintf(p->comm, "%s%d", "Idle", i);
init_tasks[i] = p;
p->processor = i;
......
......@@ -491,7 +491,7 @@ void allowboot(void)
* Linux can schedule processes on this slave.
*/
kernel_thread(0, NULL, CLONE_PID);
p = init_task.prev_task;
p = prev_task(&init_task);
sprintf(p->comm, "%s%d", "Idle", num_cpus);
init_tasks[num_cpus] = p;
alloc_cpupda(cpu, num_cpus);
......
......@@ -344,7 +344,7 @@ void __init smp_boot_cpus(void)
memset(&regs, 0, sizeof(struct pt_regs));
if (do_fork(CLONE_VM|CLONE_PID, 0, &regs, 0) < 0)
panic("failed fork for CPU %d", i);
p = init_task.prev_task;
p = prev_task(&init_task);
if (!p)
panic("No idle task for CPU %d", i);
init_idle(p, i);
......
......@@ -640,7 +640,7 @@ void __init smp_boot_cpus(void)
if (do_fork(CLONE_VM|CLONE_PID, 0, &regs, 0) < 0)
panic("failed fork for CPU %d", i);
p = init_task.prev_task;
p = prev_task(&init_task);
if (!p)
panic("No idle task for CPU %d", i);
......
......@@ -528,7 +528,7 @@ static void __init do_boot_cpu(int cpu)
* We remove it from the pidhash and the runqueue
* once we got the process:
*/
idle = init_task.prev_task;
idle = prev_task(&init_task);
if (!idle)
panic("No idle process for CPU %d",cpu);
idle->processor = cpu;
......
......@@ -507,7 +507,7 @@ static void __init do_boot_cpu(int cpu)
* We remove it from the pidhash and the runqueue
* once we got the process:
*/
idle = init_task.prev_task;
idle = prev_task(&init_task);
if (!idle)
panic("No idle process for CPU %d",cpu);
idle->processor = cpu;
......
......@@ -220,7 +220,7 @@ void __init smp4d_boot_cpus(void)
cpucount++;
p = init_task.prev_task;
p = prev_task(&init_task);
p->cpu = i;
......
......@@ -193,7 +193,7 @@ void __init smp4m_boot_cpus(void)
cpucount++;
p = init_task.prev_task;
p = prev_task(&init_task);
p->cpu = i;
......
......@@ -270,7 +270,7 @@ void __init smp_boot_cpus(void)
kernel_thread(NULL, NULL, CLONE_PID);
cpucount++;
p = init_task.prev_task;
p = prev_task(&init_task);
init_idle(p, i);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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