提交 45bfe98b 编写于 作者: L Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge

Fix up delete/modify conflict of arch/ppc/kernel/process.c by hand (it's
gone, gone, gone).
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
...@@ -11,7 +11,8 @@ CFLAGS_btext.o += -fPIC ...@@ -11,7 +11,8 @@ CFLAGS_btext.o += -fPIC
endif endif
obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ obj-y := semaphore.o cputable.o ptrace.o syscalls.o \
irq.o align.o signal_32.o pmc.o vdso.o irq.o align.o signal_32.o pmc.o vdso.o \
init_task.o process.o
obj-y += vdso32/ obj-y += vdso32/
obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \
signal_64.o ptrace32.o systbl.o \ signal_64.o ptrace32.o systbl.o \
...@@ -44,8 +45,7 @@ extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o ...@@ -44,8 +45,7 @@ extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o
extra-$(CONFIG_8xx) := head_8xx.o extra-$(CONFIG_8xx) := head_8xx.o
extra-y += vmlinux.lds extra-y += vmlinux.lds
obj-y += process.o init_task.o time.o \ obj-y += time.o prom.o traps.o setup-common.o udbg.o
prom.o traps.o setup-common.o udbg.o
obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o systbl.o obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o systbl.o
obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o
obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o
......
...@@ -53,6 +53,7 @@ EXPORT_SYMBOL(io_page_mask); ...@@ -53,6 +53,7 @@ EXPORT_SYMBOL(io_page_mask);
#ifdef CONFIG_PPC_MULTIPLATFORM #ifdef CONFIG_PPC_MULTIPLATFORM
static void fixup_resource(struct resource *res, struct pci_dev *dev); static void fixup_resource(struct resource *res, struct pci_dev *dev);
static void do_bus_setup(struct pci_bus *bus); static void do_bus_setup(struct pci_bus *bus);
static void phbs_remap_io(void);
#endif #endif
/* pci_io_base -- the base address from which io bars are offsets. /* pci_io_base -- the base address from which io bars are offsets.
...@@ -251,6 +252,7 @@ void pcibios_free_controller(struct pci_controller *phb) ...@@ -251,6 +252,7 @@ void pcibios_free_controller(struct pci_controller *phb)
kfree(phb); kfree(phb);
} }
#ifndef CONFIG_PPC_ISERIES
void __devinit pcibios_claim_one_bus(struct pci_bus *b) void __devinit pcibios_claim_one_bus(struct pci_bus *b)
{ {
struct pci_dev *dev; struct pci_dev *dev;
...@@ -275,7 +277,6 @@ void __devinit pcibios_claim_one_bus(struct pci_bus *b) ...@@ -275,7 +277,6 @@ void __devinit pcibios_claim_one_bus(struct pci_bus *b)
EXPORT_SYMBOL_GPL(pcibios_claim_one_bus); EXPORT_SYMBOL_GPL(pcibios_claim_one_bus);
#endif #endif
#ifndef CONFIG_PPC_ISERIES
static void __init pcibios_claim_of_setup(void) static void __init pcibios_claim_of_setup(void)
{ {
struct pci_bus *b; struct pci_bus *b;
...@@ -1218,7 +1219,7 @@ int remap_bus_range(struct pci_bus *bus) ...@@ -1218,7 +1219,7 @@ int remap_bus_range(struct pci_bus *bus)
} }
EXPORT_SYMBOL(remap_bus_range); EXPORT_SYMBOL(remap_bus_range);
void phbs_remap_io(void) static void phbs_remap_io(void)
{ {
struct pci_controller *hose, *tmp; struct pci_controller *hose, *tmp;
......
...@@ -201,13 +201,13 @@ int dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs) ...@@ -201,13 +201,13 @@ int dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs)
} }
#endif /* CONFIG_SPE */ #endif /* CONFIG_SPE */
#ifndef CONFIG_SMP
/* /*
* If we are doing lazy switching of CPU state (FP, altivec or SPE), * If we are doing lazy switching of CPU state (FP, altivec or SPE),
* and the current task has some state, discard it. * and the current task has some state, discard it.
*/ */
static inline void discard_lazy_cpu_state(void) void discard_lazy_cpu_state(void)
{ {
#ifndef CONFIG_SMP
preempt_disable(); preempt_disable();
if (last_task_used_math == current) if (last_task_used_math == current)
last_task_used_math = NULL; last_task_used_math = NULL;
...@@ -220,9 +220,10 @@ static inline void discard_lazy_cpu_state(void) ...@@ -220,9 +220,10 @@ static inline void discard_lazy_cpu_state(void)
last_task_used_spe = NULL; last_task_used_spe = NULL;
#endif #endif
preempt_enable(); preempt_enable();
#endif /* CONFIG_SMP */
} }
#endif /* CONFIG_SMP */
#ifdef CONFIG_PPC_MERGE /* XXX for now */
int set_dabr(unsigned long dabr) int set_dabr(unsigned long dabr)
{ {
if (ppc_md.set_dabr) if (ppc_md.set_dabr)
...@@ -231,6 +232,7 @@ int set_dabr(unsigned long dabr) ...@@ -231,6 +232,7 @@ int set_dabr(unsigned long dabr)
mtspr(SPRN_DABR, dabr); mtspr(SPRN_DABR, dabr);
return 0; return 0;
} }
#endif
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array); DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array);
......
...@@ -1100,17 +1100,37 @@ static int __init early_init_dt_scan_memory(unsigned long node, ...@@ -1100,17 +1100,37 @@ static int __init early_init_dt_scan_memory(unsigned long node,
static void __init early_reserve_mem(void) static void __init early_reserve_mem(void)
{ {
unsigned long base, size; u64 base, size;
unsigned long *reserve_map; u64 *reserve_map;
reserve_map = (unsigned long *)(((unsigned long)initial_boot_params) + reserve_map = (u64 *)(((unsigned long)initial_boot_params) +
initial_boot_params->off_mem_rsvmap); initial_boot_params->off_mem_rsvmap);
#ifdef CONFIG_PPC32
/*
* Handle the case where we might be booting from an old kexec
* image that setup the mem_rsvmap as pairs of 32-bit values
*/
if (*reserve_map > 0xffffffffull) {
u32 base_32, size_32;
u32 *reserve_map_32 = (u32 *)reserve_map;
while (1) {
base_32 = *(reserve_map_32++);
size_32 = *(reserve_map_32++);
if (size_32 == 0)
break;
DBG("reserving: %lx -> %lx\n", base_32, size_32);
lmb_reserve(base_32, size_32);
}
return;
}
#endif
while (1) { while (1) {
base = *(reserve_map++); base = *(reserve_map++);
size = *(reserve_map++); size = *(reserve_map++);
if (size == 0) if (size == 0)
break; break;
DBG("reserving: %lx -> %lx\n", base, size); DBG("reserving: %llx -> %llx\n", base, size);
lmb_reserve(base, size); lmb_reserve(base, size);
} }
......
...@@ -137,8 +137,8 @@ struct prom_t { ...@@ -137,8 +137,8 @@ struct prom_t {
}; };
struct mem_map_entry { struct mem_map_entry {
unsigned long base; u64 base;
unsigned long size; u64 size;
}; };
typedef u32 cell_t; typedef u32 cell_t;
...@@ -897,9 +897,9 @@ static unsigned long __init prom_next_cell(int s, cell_t **cellp) ...@@ -897,9 +897,9 @@ static unsigned long __init prom_next_cell(int s, cell_t **cellp)
* If problems seem to show up, it would be a good start to track * If problems seem to show up, it would be a good start to track
* them down. * them down.
*/ */
static void reserve_mem(unsigned long base, unsigned long size) static void reserve_mem(u64 base, u64 size)
{ {
unsigned long top = base + size; u64 top = base + size;
unsigned long cnt = RELOC(mem_reserve_cnt); unsigned long cnt = RELOC(mem_reserve_cnt);
if (size == 0) if (size == 0)
......
...@@ -497,6 +497,15 @@ static long restore_user_regs(struct pt_regs *regs, ...@@ -497,6 +497,15 @@ static long restore_user_regs(struct pt_regs *regs,
if (err) if (err)
return 1; return 1;
/*
* Do this before updating the thread state in
* current->thread.fpr/vr/evr. That way, if we get preempted
* and another task grabs the FPU/Altivec/SPE, it won't be
* tempted to save the current CPU state into the thread_struct
* and corrupt what we are writing there.
*/
discard_lazy_cpu_state();
/* force the process to reload the FP registers from /* force the process to reload the FP registers from
current->thread when it next does FP instructions */ current->thread when it next does FP instructions */
regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1); regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1);
...@@ -538,18 +547,6 @@ static long restore_user_regs(struct pt_regs *regs, ...@@ -538,18 +547,6 @@ static long restore_user_regs(struct pt_regs *regs,
return 1; return 1;
#endif /* CONFIG_SPE */ #endif /* CONFIG_SPE */
#ifndef CONFIG_SMP
preempt_disable();
if (last_task_used_math == current)
last_task_used_math = NULL;
if (last_task_used_altivec == current)
last_task_used_altivec = NULL;
#ifdef CONFIG_SPE
if (last_task_used_spe == current)
last_task_used_spe = NULL;
#endif
preempt_enable();
#endif
return 0; return 0;
} }
......
...@@ -207,10 +207,20 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig, ...@@ -207,10 +207,20 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig,
if (!sig) if (!sig)
regs->gpr[13] = save_r13; regs->gpr[13] = save_r13;
err |= __copy_from_user(&current->thread.fpr, &sc->fp_regs, FP_REGS_SIZE);
if (set != NULL) if (set != NULL)
err |= __get_user(set->sig[0], &sc->oldmask); err |= __get_user(set->sig[0], &sc->oldmask);
/*
* Do this before updating the thread state in
* current->thread.fpr/vr. That way, if we get preempted
* and another task grabs the FPU/Altivec, it won't be
* tempted to save the current CPU state into the thread_struct
* and corrupt what we are writing there.
*/
discard_lazy_cpu_state();
err |= __copy_from_user(&current->thread.fpr, &sc->fp_regs, FP_REGS_SIZE);
#ifdef CONFIG_ALTIVEC #ifdef CONFIG_ALTIVEC
err |= __get_user(v_regs, &sc->v_regs); err |= __get_user(v_regs, &sc->v_regs);
err |= __get_user(msr, &sc->gp_regs[PT_MSR]); err |= __get_user(msr, &sc->gp_regs[PT_MSR]);
...@@ -229,14 +239,6 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig, ...@@ -229,14 +239,6 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig,
current->thread.vrsave = 0; current->thread.vrsave = 0;
#endif /* CONFIG_ALTIVEC */ #endif /* CONFIG_ALTIVEC */
#ifndef CONFIG_SMP
preempt_disable();
if (last_task_used_math == current)
last_task_used_math = NULL;
if (last_task_used_altivec == current)
last_task_used_altivec = NULL;
preempt_enable();
#endif
/* Force reload of FP/VEC */ /* Force reload of FP/VEC */
regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1 | MSR_VEC); regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1 | MSR_VEC);
......
...@@ -142,7 +142,7 @@ static void cbe_idle(void) ...@@ -142,7 +142,7 @@ static void cbe_idle(void)
} }
} }
int cbe_system_reset_exception(struct pt_regs *regs) static int cbe_system_reset_exception(struct pt_regs *regs)
{ {
switch (regs->msr & SRR1_WAKEMASK) { switch (regs->msr & SRR1_WAKEMASK) {
case SRR1_WAKEEE: case SRR1_WAKEEE:
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
#define DBG(fmt...) #define DBG(fmt...)
#endif #endif
void cell_show_cpuinfo(struct seq_file *m) static void cell_show_cpuinfo(struct seq_file *m)
{ {
struct device_node *root; struct device_node *root;
const char *model = ""; const char *model = "";
......
...@@ -29,7 +29,9 @@ ...@@ -29,7 +29,9 @@
* value of the spu_status register after the SPU has stopped. * value of the spu_status register after the SPU has stopped.
* *
*/ */
long do_spu_run(struct file *filp, __u32 __user *unpc, __u32 __user *ustatus) static long do_spu_run(struct file *filp,
__u32 __user *unpc,
__u32 __user *ustatus)
{ {
long ret; long ret;
struct spufs_inode_info *i; struct spufs_inode_info *i;
......
EXTRA_CFLAGS += -mno-minimal-toc EXTRA_CFLAGS += -mno-minimal-toc
obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o mf.o lpevents.o \ obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o mf.o lpevents.o \
hvcall.o proc.o htab.o iommu.o misc.o hvcall.o proc.o htab.o iommu.o misc.o irq.o
obj-$(CONFIG_PCI) += pci.o irq.o vpdinfo.o obj-$(CONFIG_PCI) += pci.o vpdinfo.o
obj-$(CONFIG_IBMVIO) += vio.o obj-$(CONFIG_IBMVIO) += vio.o
obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_VIOPATH) += viopath.o obj-$(CONFIG_VIOPATH) += viopath.o
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <asm/iseries/hv_call_xm.h> #include <asm/iseries/hv_call_xm.h>
#include "iommu.h"
extern struct list_head iSeries_Global_Device_List; extern struct list_head iSeries_Global_Device_List;
......
#ifndef _PLATFORMS_ISERIES_IOMMU_H
#define _PLATFORMS_ISERIES_IOMMU_H
/*
* Copyright (C) 2005 Stephen Rothwell, IBM Corporation
*
* 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
*/
struct device_node;
struct iommu_table;
/* Creates table for an individual device node */
extern void iommu_devnode_init_iSeries(struct device_node *dn);
/* Get table parameters from HV */
extern void iommu_table_getparms_iSeries(unsigned long busno,
unsigned char slotno, unsigned char virtbus,
struct iommu_table *tbl);
#endif /* _PLATFORMS_ISERIES_IOMMU_H */
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
extern void iSeries_smp_message_recv(struct pt_regs *); extern void iSeries_smp_message_recv(struct pt_regs *);
#endif #endif
#ifdef CONFIG_PCI
enum pci_event_type { enum pci_event_type {
pe_bus_created = 0, /* PHB has been created */ pe_bus_created = 0, /* PHB has been created */
pe_bus_error = 1, /* PHB has failed */ pe_bus_error = 1, /* PHB has failed */
...@@ -147,20 +149,11 @@ static void int_received(struct pci_event *event, struct pt_regs *regs) ...@@ -147,20 +149,11 @@ static void int_received(struct pci_event *event, struct pt_regs *regs)
static void pci_event_handler(struct HvLpEvent *event, struct pt_regs *regs) static void pci_event_handler(struct HvLpEvent *event, struct pt_regs *regs)
{ {
if (event && (event->xType == HvLpEvent_Type_PciIo)) { if (event && (event->xType == HvLpEvent_Type_PciIo)) {
switch (event->xFlags.xFunction) { if (hvlpevent_is_int(event))
case HvLpEvent_Function_Int:
int_received((struct pci_event *)event, regs); int_received((struct pci_event *)event, regs);
break; else
case HvLpEvent_Function_Ack:
printk(KERN_ERR printk(KERN_ERR
"pci_event_handler: unexpected ack received\n"); "pci_event_handler: unexpected ack received\n");
break;
default:
printk(KERN_ERR
"pci_event_handler: unexpected event function %d\n",
(int)event->xFlags.xFunction);
break;
}
} else if (event) } else if (event)
printk(KERN_ERR printk(KERN_ERR
"pci_event_handler: Unrecognized PCI event type 0x%x\n", "pci_event_handler: Unrecognized PCI event type 0x%x\n",
...@@ -334,6 +327,8 @@ int __init iSeries_allocate_IRQ(HvBusNumber bus, ...@@ -334,6 +327,8 @@ int __init iSeries_allocate_IRQ(HvBusNumber bus,
return virtirq; return virtirq;
} }
#endif /* CONFIG_PCI */
/* /*
* Get the next pending IRQ. * Get the next pending IRQ.
*/ */
...@@ -353,6 +348,7 @@ int iSeries_get_irq(struct pt_regs *regs) ...@@ -353,6 +348,7 @@ int iSeries_get_irq(struct pt_regs *regs)
if (hvlpevent_is_pending()) if (hvlpevent_is_pending())
process_hvlpevents(regs); process_hvlpevents(regs);
#ifdef CONFIG_PCI
if (num_pending_irqs) { if (num_pending_irqs) {
spin_lock(&pending_irqs_lock); spin_lock(&pending_irqs_lock);
for (irq = 0; irq < NR_IRQS; irq++) { for (irq = 0; irq < NR_IRQS; irq++) {
...@@ -366,6 +362,7 @@ int iSeries_get_irq(struct pt_regs *regs) ...@@ -366,6 +362,7 @@ int iSeries_get_irq(struct pt_regs *regs)
if (irq >= NR_IRQS) if (irq >= NR_IRQS)
irq = -2; irq = -2;
} }
#endif
return irq; return irq;
} }
...@@ -93,10 +93,7 @@ struct ItLpNaca itLpNaca = { ...@@ -93,10 +93,7 @@ struct ItLpNaca itLpNaca = {
.xPirEnvironMode = 0, /* Piranha stuff */ .xPirEnvironMode = 0, /* Piranha stuff */
.xPirConsoleMode = 0, .xPirConsoleMode = 0,
.xPirDasdMode = 0, .xPirDasdMode = 0,
.xLparInstalled = 0, .flags = 0,
.xSysPartitioned = 0,
.xHwSyncedTBs = 0,
.xIntProcUtilHmt = 0,
.xSpVpdFormat = 0, .xSpVpdFormat = 0,
.xIntProcRatio = 0, .xIntProcRatio = 0,
.xPlicVrmIndex = 0, /* VRM index of PLIC */ .xPlicVrmIndex = 0, /* VRM index of PLIC */
......
...@@ -53,7 +53,7 @@ static struct HvLpEvent * get_next_hvlpevent(void) ...@@ -53,7 +53,7 @@ static struct HvLpEvent * get_next_hvlpevent(void)
struct HvLpEvent * event; struct HvLpEvent * event;
event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr; event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;
if (event->xFlags.xValid) { if (hvlpevent_is_valid(event)) {
/* rmb() needed only for weakly consistent machines (regatta) */ /* rmb() needed only for weakly consistent machines (regatta) */
rmb(); rmb();
/* Set pointer to next potential event */ /* Set pointer to next potential event */
...@@ -84,7 +84,7 @@ int hvlpevent_is_pending(void) ...@@ -84,7 +84,7 @@ int hvlpevent_is_pending(void)
next_event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr; next_event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;
return next_event->xFlags.xValid | return hvlpevent_is_valid(next_event) ||
hvlpevent_queue.xPlicOverflowIntPending; hvlpevent_queue.xPlicOverflowIntPending;
} }
...@@ -101,18 +101,18 @@ static void hvlpevent_clear_valid(struct HvLpEvent * event) ...@@ -101,18 +101,18 @@ static void hvlpevent_clear_valid(struct HvLpEvent * event)
switch (extra) { switch (extra) {
case 3: case 3:
tmp = (struct HvLpEvent*)((char*)event + 3 * LpEventAlign); tmp = (struct HvLpEvent*)((char*)event + 3 * LpEventAlign);
tmp->xFlags.xValid = 0; hvlpevent_invalidate(tmp);
case 2: case 2:
tmp = (struct HvLpEvent*)((char*)event + 2 * LpEventAlign); tmp = (struct HvLpEvent*)((char*)event + 2 * LpEventAlign);
tmp->xFlags.xValid = 0; hvlpevent_invalidate(tmp);
case 1: case 1:
tmp = (struct HvLpEvent*)((char*)event + 1 * LpEventAlign); tmp = (struct HvLpEvent*)((char*)event + 1 * LpEventAlign);
tmp->xFlags.xValid = 0; hvlpevent_invalidate(tmp);
} }
mb(); mb();
event->xFlags.xValid = 0; hvlpevent_invalidate(event);
} }
void process_hvlpevents(struct pt_regs *regs) void process_hvlpevents(struct pt_regs *regs)
......
...@@ -251,10 +251,7 @@ static struct pending_event *new_pending_event(void) ...@@ -251,10 +251,7 @@ static struct pending_event *new_pending_event(void)
} }
memset(ev, 0, sizeof(struct pending_event)); memset(ev, 0, sizeof(struct pending_event));
hev = &ev->event.hp_lp_event; hev = &ev->event.hp_lp_event;
hev->xFlags.xValid = 1; hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DO_ACK | HV_LP_EVENT_INT;
hev->xFlags.xAckType = HvLpEvent_AckType_ImmediateAck;
hev->xFlags.xAckInd = HvLpEvent_AckInd_DoAck;
hev->xFlags.xFunction = HvLpEvent_Function_Int;
hev->xType = HvLpEvent_Type_MachineFac; hev->xType = HvLpEvent_Type_MachineFac;
hev->xSourceLp = HvLpConfig_getLpIndex(); hev->xSourceLp = HvLpConfig_getLpIndex();
hev->xTargetLp = primary_lp; hev->xTargetLp = primary_lp;
...@@ -518,17 +515,10 @@ static void handle_ack(struct io_mf_lp_event *event) ...@@ -518,17 +515,10 @@ static void handle_ack(struct io_mf_lp_event *event)
static void hv_handler(struct HvLpEvent *event, struct pt_regs *regs) static void hv_handler(struct HvLpEvent *event, struct pt_regs *regs)
{ {
if ((event != NULL) && (event->xType == HvLpEvent_Type_MachineFac)) { if ((event != NULL) && (event->xType == HvLpEvent_Type_MachineFac)) {
switch(event->xFlags.xFunction) { if (hvlpevent_is_ack(event))
case HvLpEvent_Function_Ack:
handle_ack((struct io_mf_lp_event *)event); handle_ack((struct io_mf_lp_event *)event);
break; else
case HvLpEvent_Function_Int:
handle_int((struct io_mf_lp_event *)event); handle_int((struct io_mf_lp_event *)event);
break;
default:
printk(KERN_ERR "mf.c: non ack/int event received\n");
break;
}
} else } else
printk(KERN_ERR "mf.c: alien event received\n"); printk(KERN_ERR "mf.c: alien event received\n");
} }
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "irq.h" #include "irq.h"
#include "pci.h" #include "pci.h"
#include "call_pci.h" #include "call_pci.h"
#include "iommu.h"
extern unsigned long io_page_mask; extern unsigned long io_page_mask;
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <asm/iseries/hv_lp_config.h> #include <asm/iseries/hv_lp_config.h>
#include <asm/iseries/hv_call_xm.h> #include <asm/iseries/hv_call_xm.h>
#include "iommu.h"
struct device *iSeries_vio_dev = &vio_bus_device.dev; struct device *iSeries_vio_dev = &vio_bus_device.dev;
EXPORT_SYMBOL(iSeries_vio_dev); EXPORT_SYMBOL(iSeries_vio_dev);
......
...@@ -270,7 +270,7 @@ static void handleMonitorEvent(struct HvLpEvent *event) ...@@ -270,7 +270,7 @@ static void handleMonitorEvent(struct HvLpEvent *event)
* First see if this is just a normal monitor message from the * First see if this is just a normal monitor message from the
* other partition * other partition
*/ */
if (event->xFlags.xFunction == HvLpEvent_Function_Int) { if (hvlpevent_is_int(event)) {
remoteLp = event->xSourceLp; remoteLp = event->xSourceLp;
if (!viopathStatus[remoteLp].isActive) if (!viopathStatus[remoteLp].isActive)
sendMonMsg(remoteLp); sendMonMsg(remoteLp);
...@@ -331,13 +331,12 @@ static void handleConfig(struct HvLpEvent *event) ...@@ -331,13 +331,12 @@ static void handleConfig(struct HvLpEvent *event)
{ {
if (!event) if (!event)
return; return;
if (event->xFlags.xFunction == HvLpEvent_Function_Int) { if (hvlpevent_is_int(event)) {
printk(VIOPATH_KERN_WARN printk(VIOPATH_KERN_WARN
"unexpected config request from partition %d", "unexpected config request from partition %d",
event->xSourceLp); event->xSourceLp);
if ((event->xFlags.xFunction == HvLpEvent_Function_Int) && if (hvlpevent_need_ack(event)) {
(event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) {
event->xRc = HvLpEvent_Rc_InvalidSubtype; event->xRc = HvLpEvent_Rc_InvalidSubtype;
HvCallEvent_ackLpEvent(event); HvCallEvent_ackLpEvent(event);
} }
...@@ -377,7 +376,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) ...@@ -377,7 +376,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
int subtype = (event->xSubtype & VIOMAJOR_SUBTYPE_MASK) int subtype = (event->xSubtype & VIOMAJOR_SUBTYPE_MASK)
>> VIOMAJOR_SUBTYPE_SHIFT; >> VIOMAJOR_SUBTYPE_SHIFT;
if (event->xFlags.xFunction == HvLpEvent_Function_Int) { if (hvlpevent_is_int(event)) {
remoteLp = event->xSourceLp; remoteLp = event->xSourceLp;
/* /*
* The isActive is checked because if the hosting partition * The isActive is checked because if the hosting partition
...@@ -436,8 +435,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) ...@@ -436,8 +435,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
"unexpected virtual io event subtype %d from partition %d\n", "unexpected virtual io event subtype %d from partition %d\n",
event->xSubtype, remoteLp); event->xSubtype, remoteLp);
/* No handler. Ack if necessary */ /* No handler. Ack if necessary */
if ((event->xFlags.xFunction == HvLpEvent_Function_Int) && if (hvlpevent_is_int(event) && hvlpevent_need_ack(event)) {
(event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) {
event->xRc = HvLpEvent_Rc_InvalidSubtype; event->xRc = HvLpEvent_Rc_InvalidSubtype;
HvCallEvent_ackLpEvent(event); HvCallEvent_ackLpEvent(event);
} }
......
...@@ -278,7 +278,7 @@ static void __init l2cr_init(void) ...@@ -278,7 +278,7 @@ static void __init l2cr_init(void)
} }
#endif #endif
void __init pmac_setup_arch(void) static void __init pmac_setup_arch(void)
{ {
struct device_node *cpu, *ic; struct device_node *cpu, *ic;
int *fp; int *fp;
......
...@@ -208,10 +208,11 @@ static void __eeh_mark_slot (struct device_node *dn, int mode_flag) ...@@ -208,10 +208,11 @@ static void __eeh_mark_slot (struct device_node *dn, int mode_flag)
{ {
while (dn) { while (dn) {
if (PCI_DN(dn)) { if (PCI_DN(dn)) {
PCI_DN(dn)->eeh_mode |= mode_flag;
/* Mark the pci device driver too */ /* Mark the pci device driver too */
struct pci_dev *dev = PCI_DN(dn)->pcidev; struct pci_dev *dev = PCI_DN(dn)->pcidev;
PCI_DN(dn)->eeh_mode |= mode_flag;
if (dev && dev->driver) if (dev && dev->driver)
dev->error_state = pci_channel_io_frozen; dev->error_state = pci_channel_io_frozen;
......
...@@ -40,7 +40,7 @@ MODULE_VERSION(HVCS_ARCH_VERSION); ...@@ -40,7 +40,7 @@ MODULE_VERSION(HVCS_ARCH_VERSION);
* functions aren't performance sensitive, so this conversion isn't an * functions aren't performance sensitive, so this conversion isn't an
* issue. * issue.
*/ */
int hvcs_convert(long to_convert) static int hvcs_convert(long to_convert)
{ {
switch (to_convert) { switch (to_convert) {
case H_Success: case H_Success:
...@@ -91,7 +91,7 @@ int hvcs_free_partner_info(struct list_head *head) ...@@ -91,7 +91,7 @@ int hvcs_free_partner_info(struct list_head *head)
EXPORT_SYMBOL(hvcs_free_partner_info); EXPORT_SYMBOL(hvcs_free_partner_info);
/* Helper function for hvcs_get_partner_info */ /* Helper function for hvcs_get_partner_info */
int hvcs_next_partner(uint32_t unit_address, static int hvcs_next_partner(uint32_t unit_address,
unsigned long last_p_partition_ID, unsigned long last_p_partition_ID,
unsigned long last_p_unit_address, unsigned long *pi_buff) unsigned long last_p_unit_address, unsigned long *pi_buff)
......
...@@ -51,8 +51,6 @@ ...@@ -51,8 +51,6 @@
#define DBG(fmt...) #define DBG(fmt...)
extern int is_python(struct device_node *);
static void tce_build_pSeries(struct iommu_table *tbl, long index, static void tce_build_pSeries(struct iommu_table *tbl, long index,
long npages, unsigned long uaddr, long npages, unsigned long uaddr,
enum dma_data_direction direction) enum dma_data_direction direction)
......
...@@ -192,7 +192,7 @@ struct file_operations scanlog_fops = { ...@@ -192,7 +192,7 @@ struct file_operations scanlog_fops = {
.release = scanlog_release, .release = scanlog_release,
}; };
int __init scanlog_init(void) static int __init scanlog_init(void)
{ {
struct proc_dir_entry *ent; struct proc_dir_entry *ent;
...@@ -222,7 +222,7 @@ int __init scanlog_init(void) ...@@ -222,7 +222,7 @@ int __init scanlog_init(void)
return 0; return 0;
} }
void __exit scanlog_cleanup(void) static void __exit scanlog_cleanup(void)
{ {
if (proc_ppc64_scan_log_dump) { if (proc_ppc64_scan_log_dump) {
kfree(proc_ppc64_scan_log_dump->data); kfree(proc_ppc64_scan_log_dump->data);
......
...@@ -86,7 +86,7 @@ static void pseries_dedicated_idle(void); ...@@ -86,7 +86,7 @@ static void pseries_dedicated_idle(void);
struct mpic *pSeries_mpic; struct mpic *pSeries_mpic;
void pSeries_show_cpuinfo(struct seq_file *m) static void pSeries_show_cpuinfo(struct seq_file *m)
{ {
struct device_node *root; struct device_node *root;
const char *model = ""; const char *model = "";
......
...@@ -93,7 +93,7 @@ static int query_cpu_stopped(unsigned int pcpu) ...@@ -93,7 +93,7 @@ static int query_cpu_stopped(unsigned int pcpu)
return cpu_status; return cpu_status;
} }
int pSeries_cpu_disable(void) static int pSeries_cpu_disable(void)
{ {
int cpu = smp_processor_id(); int cpu = smp_processor_id();
...@@ -109,7 +109,7 @@ int pSeries_cpu_disable(void) ...@@ -109,7 +109,7 @@ int pSeries_cpu_disable(void)
return 0; return 0;
} }
void pSeries_cpu_die(unsigned int cpu) static void pSeries_cpu_die(unsigned int cpu)
{ {
int tries; int tries;
int cpu_status; int cpu_status;
......
...@@ -381,7 +381,7 @@ int xics_get_irq(struct pt_regs *regs) ...@@ -381,7 +381,7 @@ int xics_get_irq(struct pt_regs *regs)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
irqreturn_t xics_ipi_action(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t xics_ipi_action(int irq, void *dev_id, struct pt_regs *regs)
{ {
int cpu = smp_processor_id(); int cpu = smp_processor_id();
......
...@@ -139,7 +139,6 @@ static void dart_build(struct iommu_table *tbl, long index, ...@@ -139,7 +139,6 @@ static void dart_build(struct iommu_table *tbl, long index,
*(dp++) = DARTMAP_VALID | (rpn & DARTMAP_RPNMASK); *(dp++) = DARTMAP_VALID | (rpn & DARTMAP_RPNMASK);
rpn++;
uaddr += DART_PAGE_SIZE; uaddr += DART_PAGE_SIZE;
} }
......
...@@ -311,7 +311,7 @@ static void release_output_lock(void) ...@@ -311,7 +311,7 @@ static void release_output_lock(void)
} }
#endif #endif
int xmon_core(struct pt_regs *regs, int fromipi) static int xmon_core(struct pt_regs *regs, int fromipi)
{ {
int cmd = 0; int cmd = 0;
unsigned long msr; unsigned long msr;
...@@ -528,7 +528,7 @@ xmon_irq(int irq, void *d, struct pt_regs *regs) ...@@ -528,7 +528,7 @@ xmon_irq(int irq, void *d, struct pt_regs *regs)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
int xmon_bpt(struct pt_regs *regs) static int xmon_bpt(struct pt_regs *regs)
{ {
struct bpt *bp; struct bpt *bp;
unsigned long offset; unsigned long offset;
...@@ -554,7 +554,7 @@ int xmon_bpt(struct pt_regs *regs) ...@@ -554,7 +554,7 @@ int xmon_bpt(struct pt_regs *regs)
return 1; return 1;
} }
int xmon_sstep(struct pt_regs *regs) static int xmon_sstep(struct pt_regs *regs)
{ {
if (user_mode(regs)) if (user_mode(regs))
return 0; return 0;
...@@ -562,7 +562,7 @@ int xmon_sstep(struct pt_regs *regs) ...@@ -562,7 +562,7 @@ int xmon_sstep(struct pt_regs *regs)
return 1; return 1;
} }
int xmon_dabr_match(struct pt_regs *regs) static int xmon_dabr_match(struct pt_regs *regs)
{ {
if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF)) if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF))
return 0; return 0;
...@@ -572,7 +572,7 @@ int xmon_dabr_match(struct pt_regs *regs) ...@@ -572,7 +572,7 @@ int xmon_dabr_match(struct pt_regs *regs)
return 1; return 1;
} }
int xmon_iabr_match(struct pt_regs *regs) static int xmon_iabr_match(struct pt_regs *regs)
{ {
if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF)) if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF))
return 0; return 0;
...@@ -582,7 +582,7 @@ int xmon_iabr_match(struct pt_regs *regs) ...@@ -582,7 +582,7 @@ int xmon_iabr_match(struct pt_regs *regs)
return 1; return 1;
} }
int xmon_ipi(struct pt_regs *regs) static int xmon_ipi(struct pt_regs *regs)
{ {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
if (in_xmon && !cpu_isset(smp_processor_id(), cpus_in_xmon)) if (in_xmon && !cpu_isset(smp_processor_id(), cpus_in_xmon))
...@@ -591,7 +591,7 @@ int xmon_ipi(struct pt_regs *regs) ...@@ -591,7 +591,7 @@ int xmon_ipi(struct pt_regs *regs)
return 0; return 0;
} }
int xmon_fault_handler(struct pt_regs *regs) static int xmon_fault_handler(struct pt_regs *regs)
{ {
struct bpt *bp; struct bpt *bp;
unsigned long offset; unsigned long offset;
......
...@@ -13,7 +13,6 @@ extra-$(CONFIG_POWER4) += idle_power4.o ...@@ -13,7 +13,6 @@ extra-$(CONFIG_POWER4) += idle_power4.o
extra-y += vmlinux.lds extra-y += vmlinux.lds
obj-y := entry.o traps.o idle.o time.o misc.o \ obj-y := entry.o traps.o idle.o time.o misc.o \
process.o \
setup.o \ setup.o \
ppc_htab.o ppc_htab.o
obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o
......
此差异已折叠。
...@@ -293,6 +293,7 @@ static int send_request(struct request *req) ...@@ -293,6 +293,7 @@ static int send_request(struct request *req)
u16 viocmd; u16 viocmd;
HvLpEvent_Rc hvrc; HvLpEvent_Rc hvrc;
struct vioblocklpevent *bevent; struct vioblocklpevent *bevent;
struct HvLpEvent *hev;
struct scatterlist sg[VIOMAXBLOCKDMA]; struct scatterlist sg[VIOMAXBLOCKDMA];
int sgindex; int sgindex;
int statindex; int statindex;
...@@ -347,22 +348,19 @@ static int send_request(struct request *req) ...@@ -347,22 +348,19 @@ static int send_request(struct request *req)
* token so we can match the response up later * token so we can match the response up later
*/ */
memset(bevent, 0, sizeof(struct vioblocklpevent)); memset(bevent, 0, sizeof(struct vioblocklpevent));
bevent->event.xFlags.xValid = 1; hev = &bevent->event;
bevent->event.xFlags.xFunction = HvLpEvent_Function_Int; hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DO_ACK |
bevent->event.xFlags.xAckInd = HvLpEvent_AckInd_DoAck; HV_LP_EVENT_INT;
bevent->event.xFlags.xAckType = HvLpEvent_AckType_ImmediateAck; hev->xType = HvLpEvent_Type_VirtualIo;
bevent->event.xType = HvLpEvent_Type_VirtualIo; hev->xSubtype = viocmd;
bevent->event.xSubtype = viocmd; hev->xSourceLp = HvLpConfig_getLpIndex();
bevent->event.xSourceLp = HvLpConfig_getLpIndex(); hev->xTargetLp = viopath_hostLp;
bevent->event.xTargetLp = viopath_hostLp; hev->xSizeMinus1 =
bevent->event.xSizeMinus1 =
offsetof(struct vioblocklpevent, u.rw_data.dma_info) + offsetof(struct vioblocklpevent, u.rw_data.dma_info) +
(sizeof(bevent->u.rw_data.dma_info[0]) * nsg) - 1; (sizeof(bevent->u.rw_data.dma_info[0]) * nsg) - 1;
bevent->event.xSourceInstanceId = hev->xSourceInstanceId = viopath_sourceinst(viopath_hostLp);
viopath_sourceinst(viopath_hostLp); hev->xTargetInstanceId = viopath_targetinst(viopath_hostLp);
bevent->event.xTargetInstanceId = hev->xCorrelationToken = (u64)req;
viopath_targetinst(viopath_hostLp);
bevent->event.xCorrelationToken = (u64)req;
bevent->version = VIOVERSION; bevent->version = VIOVERSION;
bevent->disk = DEVICE_NO(d); bevent->disk = DEVICE_NO(d);
bevent->u.rw_data.offset = start; bevent->u.rw_data.offset = start;
...@@ -649,10 +647,10 @@ static void handle_block_event(struct HvLpEvent *event) ...@@ -649,10 +647,10 @@ static void handle_block_event(struct HvLpEvent *event)
/* Notification that a partition went away! */ /* Notification that a partition went away! */
return; return;
/* First, we should NEVER get an int here...only acks */ /* First, we should NEVER get an int here...only acks */
if (event->xFlags.xFunction == HvLpEvent_Function_Int) { if (hvlpevent_is_int(event)) {
printk(VIOD_KERN_WARNING printk(VIOD_KERN_WARNING
"Yikes! got an int in viodasd event handler!\n"); "Yikes! got an int in viodasd event handler!\n");
if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { if (hvlpevent_need_ack(event)) {
event->xRc = HvLpEvent_Rc_InvalidSubtype; event->xRc = HvLpEvent_Rc_InvalidSubtype;
HvCallEvent_ackLpEvent(event); HvCallEvent_ackLpEvent(event);
} }
...@@ -695,7 +693,7 @@ static void handle_block_event(struct HvLpEvent *event) ...@@ -695,7 +693,7 @@ static void handle_block_event(struct HvLpEvent *event)
default: default:
printk(VIOD_KERN_WARNING "invalid subtype!"); printk(VIOD_KERN_WARNING "invalid subtype!");
if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { if (hvlpevent_need_ack(event)) {
event->xRc = HvLpEvent_Rc_InvalidSubtype; event->xRc = HvLpEvent_Rc_InvalidSubtype;
HvCallEvent_ackLpEvent(event); HvCallEvent_ackLpEvent(event);
} }
......
...@@ -542,10 +542,10 @@ static void vio_handle_cd_event(struct HvLpEvent *event) ...@@ -542,10 +542,10 @@ static void vio_handle_cd_event(struct HvLpEvent *event)
/* Notification that a partition went away! */ /* Notification that a partition went away! */
return; return;
/* First, we should NEVER get an int here...only acks */ /* First, we should NEVER get an int here...only acks */
if (event->xFlags.xFunction == HvLpEvent_Function_Int) { if (hvlpevent_is_int(event)) {
printk(VIOCD_KERN_WARNING printk(VIOCD_KERN_WARNING
"Yikes! got an int in viocd event handler!\n"); "Yikes! got an int in viocd event handler!\n");
if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { if (hvlpevent_need_ack(event)) {
event->xRc = HvLpEvent_Rc_InvalidSubtype; event->xRc = HvLpEvent_Rc_InvalidSubtype;
HvCallEvent_ackLpEvent(event); HvCallEvent_ackLpEvent(event);
} }
...@@ -616,7 +616,7 @@ static void vio_handle_cd_event(struct HvLpEvent *event) ...@@ -616,7 +616,7 @@ static void vio_handle_cd_event(struct HvLpEvent *event)
printk(VIOCD_KERN_WARNING printk(VIOCD_KERN_WARNING
"message with invalid subtype %0x04X!\n", "message with invalid subtype %0x04X!\n",
event->xSubtype & VIOMINOR_SUBTYPE_MASK); event->xSubtype & VIOMINOR_SUBTYPE_MASK);
if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { if (hvlpevent_need_ack(event)) {
event->xRc = HvLpEvent_Rc_InvalidSubtype; event->xRc = HvLpEvent_Rc_InvalidSubtype;
HvCallEvent_ackLpEvent(event); HvCallEvent_ackLpEvent(event);
} }
......
...@@ -534,7 +534,7 @@ static ssize_t write_kmem(struct file * file, const char __user * buf, ...@@ -534,7 +534,7 @@ static ssize_t write_kmem(struct file * file, const char __user * buf,
return virtr + wrote; return virtr + wrote;
} }
#if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI)) #if defined(CONFIG_ISA) || !defined(__mc68000__)
static ssize_t read_port(struct file * file, char __user * buf, static ssize_t read_port(struct file * file, char __user * buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
...@@ -795,7 +795,7 @@ static struct file_operations null_fops = { ...@@ -795,7 +795,7 @@ static struct file_operations null_fops = {
.write = write_null, .write = write_null,
}; };
#if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI)) #if defined(CONFIG_ISA) || !defined(__mc68000__)
static struct file_operations port_fops = { static struct file_operations port_fops = {
.llseek = memory_lseek, .llseek = memory_lseek,
.read = read_port, .read = read_port,
...@@ -865,7 +865,7 @@ static int memory_open(struct inode * inode, struct file * filp) ...@@ -865,7 +865,7 @@ static int memory_open(struct inode * inode, struct file * filp)
case 3: case 3:
filp->f_op = &null_fops; filp->f_op = &null_fops;
break; break;
#if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI)) #if defined(CONFIG_ISA) || !defined(__mc68000__)
case 4: case 4:
filp->f_op = &port_fops; filp->f_op = &port_fops;
break; break;
...@@ -912,7 +912,7 @@ static const struct { ...@@ -912,7 +912,7 @@ static const struct {
{1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops}, {1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops},
{2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops}, {2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops},
{3, "null", S_IRUGO | S_IWUGO, &null_fops}, {3, "null", S_IRUGO | S_IWUGO, &null_fops},
#if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI)) #if defined(CONFIG_ISA) || !defined(__mc68000__)
{4, "port", S_IRUSR | S_IWUSR | S_IRGRP, &port_fops}, {4, "port", S_IRUSR | S_IWUSR | S_IRGRP, &port_fops},
#endif #endif
{5, "zero", S_IRUGO | S_IWUGO, &zero_fops}, {5, "zero", S_IRUGO | S_IWUGO, &zero_fops},
......
...@@ -476,19 +476,19 @@ static struct port_info *get_port_data(struct tty_struct *tty) ...@@ -476,19 +476,19 @@ static struct port_info *get_port_data(struct tty_struct *tty)
*/ */
static void initDataEvent(struct viocharlpevent *viochar, HvLpIndex lp) static void initDataEvent(struct viocharlpevent *viochar, HvLpIndex lp)
{ {
struct HvLpEvent *hev = &viochar->event;
memset(viochar, 0, sizeof(struct viocharlpevent)); memset(viochar, 0, sizeof(struct viocharlpevent));
viochar->event.xFlags.xValid = 1; hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DEFERRED_ACK |
viochar->event.xFlags.xFunction = HvLpEvent_Function_Int; HV_LP_EVENT_INT;
viochar->event.xFlags.xAckInd = HvLpEvent_AckInd_NoAck; hev->xType = HvLpEvent_Type_VirtualIo;
viochar->event.xFlags.xAckType = HvLpEvent_AckType_DeferredAck; hev->xSubtype = viomajorsubtype_chario | viochardata;
viochar->event.xType = HvLpEvent_Type_VirtualIo; hev->xSourceLp = HvLpConfig_getLpIndex();
viochar->event.xSubtype = viomajorsubtype_chario | viochardata; hev->xTargetLp = lp;
viochar->event.xSourceLp = HvLpConfig_getLpIndex(); hev->xSizeMinus1 = sizeof(struct viocharlpevent);
viochar->event.xTargetLp = lp; hev->xSourceInstanceId = viopath_sourceinst(lp);
viochar->event.xSizeMinus1 = sizeof(struct viocharlpevent); hev->xTargetInstanceId = viopath_targetinst(lp);
viochar->event.xSourceInstanceId = viopath_sourceinst(lp);
viochar->event.xTargetInstanceId = viopath_targetinst(lp);
} }
/* /*
...@@ -752,7 +752,7 @@ static void vioHandleOpenEvent(struct HvLpEvent *event) ...@@ -752,7 +752,7 @@ static void vioHandleOpenEvent(struct HvLpEvent *event)
struct port_info *pi; struct port_info *pi;
int reject = 0; int reject = 0;
if (event->xFlags.xFunction == HvLpEvent_Function_Ack) { if (hvlpevent_is_ack(event)) {
if (port >= VTTY_PORTS) if (port >= VTTY_PORTS)
return; return;
...@@ -788,7 +788,7 @@ static void vioHandleOpenEvent(struct HvLpEvent *event) ...@@ -788,7 +788,7 @@ static void vioHandleOpenEvent(struct HvLpEvent *event)
} }
/* This had better require an ack, otherwise complain */ /* This had better require an ack, otherwise complain */
if (event->xFlags.xAckInd != HvLpEvent_AckInd_DoAck) { if (!hvlpevent_need_ack(event)) {
printk(VIOCONS_KERN_WARN "viocharopen without ack bit!\n"); printk(VIOCONS_KERN_WARN "viocharopen without ack bit!\n");
return; return;
} }
...@@ -856,7 +856,7 @@ static void vioHandleCloseEvent(struct HvLpEvent *event) ...@@ -856,7 +856,7 @@ static void vioHandleCloseEvent(struct HvLpEvent *event)
struct viocharlpevent *cevent = (struct viocharlpevent *)event; struct viocharlpevent *cevent = (struct viocharlpevent *)event;
u8 port = cevent->virtual_device; u8 port = cevent->virtual_device;
if (event->xFlags.xFunction == HvLpEvent_Function_Int) { if (hvlpevent_is_int(event)) {
if (port >= VTTY_PORTS) { if (port >= VTTY_PORTS) {
printk(VIOCONS_KERN_WARN printk(VIOCONS_KERN_WARN
"close message from invalid virtual device.\n"); "close message from invalid virtual device.\n");
...@@ -1056,8 +1056,7 @@ static void vioHandleCharEvent(struct HvLpEvent *event) ...@@ -1056,8 +1056,7 @@ static void vioHandleCharEvent(struct HvLpEvent *event)
vioHandleConfig(event); vioHandleConfig(event);
break; break;
default: default:
if ((event->xFlags.xFunction == HvLpEvent_Function_Int) && if (hvlpevent_is_int(event) && hvlpevent_need_ack(event)) {
(event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) {
event->xRc = HvLpEvent_Rc_InvalidSubtype; event->xRc = HvLpEvent_Rc_InvalidSubtype;
HvCallEvent_ackLpEvent(event); HvCallEvent_ackLpEvent(event);
} }
......
...@@ -590,9 +590,9 @@ static void veth_handle_event(struct HvLpEvent *event, struct pt_regs *regs) ...@@ -590,9 +590,9 @@ static void veth_handle_event(struct HvLpEvent *event, struct pt_regs *regs)
{ {
struct veth_lpevent *veth_event = (struct veth_lpevent *)event; struct veth_lpevent *veth_event = (struct veth_lpevent *)event;
if (event->xFlags.xFunction == HvLpEvent_Function_Ack) if (hvlpevent_is_ack(event))
veth_handle_ack(veth_event); veth_handle_ack(veth_event);
else if (event->xFlags.xFunction == HvLpEvent_Function_Int) else
veth_handle_int(veth_event); veth_handle_int(veth_event);
} }
......
...@@ -64,25 +64,6 @@ extern void iommu_free_table(struct device_node *dn); ...@@ -64,25 +64,6 @@ extern void iommu_free_table(struct device_node *dn);
#endif /* CONFIG_PPC_MULTIPLATFORM */ #endif /* CONFIG_PPC_MULTIPLATFORM */
#ifdef CONFIG_PPC_PSERIES
/* Creates table for an individual device node */
extern void iommu_devnode_init_pSeries(struct device_node *dn);
#endif /* CONFIG_PPC_PSERIES */
#ifdef CONFIG_PPC_ISERIES
/* Creates table for an individual device node */
extern void iommu_devnode_init_iSeries(struct device_node *dn);
/* Get table parameters from HV */
extern void iommu_table_getparms_iSeries(unsigned long busno,
unsigned char slotno,
unsigned char virtbus,
struct iommu_table* tbl);
#endif /* CONFIG_PPC_ISERIES */
/* Initializes an iommu_table based in values set in the passed-in /* Initializes an iommu_table based in values set in the passed-in
* structure * structure
*/ */
......
/* /*
* HvCall.h
* Copyright (C) 2001 Mike Corrigan IBM Corporation * Copyright (C) 2001 Mike Corrigan IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -15,8 +14,7 @@ ...@@ -15,8 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ *
/*
* This file contains the "hypervisor call" interface which is used to * This file contains the "hypervisor call" interface which is used to
* drive the hypervisor from the OS. * drive the hypervisor from the OS.
*/ */
......
/* /*
* HvCallEvent.h
* Copyright (C) 2001 Mike Corrigan IBM Corporation * Copyright (C) 2001 Mike Corrigan IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -15,8 +14,7 @@ ...@@ -15,8 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ *
/*
* This file contains the "hypervisor call" interface which is used to * This file contains the "hypervisor call" interface which is used to
* drive the hypervisor from the OS. * drive the hypervisor from the OS.
*/ */
...@@ -33,32 +31,9 @@ typedef u8 HvLpEvent_Type; ...@@ -33,32 +31,9 @@ typedef u8 HvLpEvent_Type;
typedef u8 HvLpEvent_AckInd; typedef u8 HvLpEvent_AckInd;
typedef u8 HvLpEvent_AckType; typedef u8 HvLpEvent_AckType;
struct HvCallEvent_PackedParms {
u8 xAckType:1;
u8 xAckInd:1;
u8 xRsvd:1;
u8 xTargetLp:5;
u8 xType;
u16 xSubtype;
HvLpInstanceId xSourceInstId;
HvLpInstanceId xTargetInstId;
};
typedef u8 HvLpDma_Direction; typedef u8 HvLpDma_Direction;
typedef u8 HvLpDma_AddressType; typedef u8 HvLpDma_AddressType;
struct HvCallEvent_PackedDmaParms {
u8 xDirection:1;
u8 xLocalAddrType:1;
u8 xRemoteAddrType:1;
u8 xRsvd1:5;
HvLpIndex xRemoteLp;
u8 xType;
u8 xRsvd2;
HvLpInstanceId xLocalInstId;
HvLpInstanceId xRemoteInstId;
};
typedef u64 HvLpEvent_Rc; typedef u64 HvLpEvent_Rc;
typedef u64 HvLpDma_Rc; typedef u64 HvLpDma_Rc;
...@@ -92,11 +67,8 @@ static inline void HvCallEvent_setInterLpQueueIndex(u8 queueIndex) ...@@ -92,11 +67,8 @@ static inline void HvCallEvent_setInterLpQueueIndex(u8 queueIndex)
static inline void HvCallEvent_setLpEventStack(u8 queueIndex, static inline void HvCallEvent_setLpEventStack(u8 queueIndex,
char *eventStackAddr, u32 eventStackSize) char *eventStackAddr, u32 eventStackSize)
{ {
u64 abs_addr; HvCall3(HvCallEventSetLpEventStack, queueIndex,
virt_to_abs(eventStackAddr), eventStackSize);
abs_addr = virt_to_abs(eventStackAddr);
HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr,
eventStackSize);
} }
static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex, static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex,
...@@ -108,14 +80,7 @@ static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex, ...@@ -108,14 +80,7 @@ static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex,
static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event) static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event)
{ {
u64 abs_addr; return HvCall1(HvCallEventSignalLpEvent, virt_to_abs(event));
#ifdef DEBUG_SENDEVENT
printk("HvCallEvent_signalLpEvent: *event = %016lx\n ",
(unsigned long)event);
#endif
abs_addr = virt_to_abs(event);
return HvCall1(HvCallEventSignalLpEvent, abs_addr);
} }
static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
...@@ -127,17 +92,21 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, ...@@ -127,17 +92,21 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
{ {
/* Pack the misc bits into a single Dword to pass to PLIC */ /* Pack the misc bits into a single Dword to pass to PLIC */
union { union {
struct HvCallEvent_PackedParms parms; struct {
u8 ack_and_target;
u8 type;
u16 subtype;
HvLpInstanceId src_inst;
HvLpInstanceId target_inst;
} parms;
u64 dword; u64 dword;
} packed; } packed;
packed.parms.xAckType = ackType;
packed.parms.xAckInd = ackInd; packed.parms.ack_and_target = (ackType << 7) | (ackInd << 6) | targetLp;
packed.parms.xRsvd = 0; packed.parms.type = type;
packed.parms.xTargetLp = targetLp; packed.parms.subtype = subtype;
packed.parms.xType = type; packed.parms.src_inst = sourceInstanceId;
packed.parms.xSubtype = subtype; packed.parms.target_inst = targetInstanceId;
packed.parms.xSourceInstId = sourceInstanceId;
packed.parms.xTargetInstId = targetInstanceId;
return HvCall7(HvCallEventSignalLpEventParms, packed.dword, return HvCall7(HvCallEventSignalLpEventParms, packed.dword,
correlationToken, eventData1, eventData2, correlationToken, eventData1, eventData2,
...@@ -146,18 +115,12 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, ...@@ -146,18 +115,12 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event) static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event)
{ {
u64 abs_addr; return HvCall1(HvCallEventAckLpEvent, virt_to_abs(event));
abs_addr = virt_to_abs(event);
return HvCall1(HvCallEventAckLpEvent, abs_addr);
} }
static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event) static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event)
{ {
u64 abs_addr; return HvCall1(HvCallEventCancelLpEvent, virt_to_abs(event));
abs_addr = virt_to_abs(event);
return HvCall1(HvCallEventCancelLpEvent, abs_addr);
} }
static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId( static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId(
...@@ -195,59 +158,34 @@ static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type, ...@@ -195,59 +158,34 @@ static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type,
{ {
/* Pack the misc bits into a single Dword to pass to PLIC */ /* Pack the misc bits into a single Dword to pass to PLIC */
union { union {
struct HvCallEvent_PackedDmaParms parms; struct {
u8 flags;
HvLpIndex remote;
u8 type;
u8 reserved;
HvLpInstanceId local_inst;
HvLpInstanceId remote_inst;
} parms;
u64 dword; u64 dword;
} packed; } packed;
packed.parms.xDirection = direction; packed.parms.flags = (direction << 7) |
packed.parms.xLocalAddrType = localAddressType; (localAddressType << 6) | (remoteAddressType << 5);
packed.parms.xRemoteAddrType = remoteAddressType; packed.parms.remote = remoteLp;
packed.parms.xRsvd1 = 0; packed.parms.type = type;
packed.parms.xRemoteLp = remoteLp; packed.parms.reserved = 0;
packed.parms.xType = type; packed.parms.local_inst = localInstanceId;
packed.parms.xRsvd2 = 0; packed.parms.remote_inst = remoteInstanceId;
packed.parms.xLocalInstId = localInstanceId;
packed.parms.xRemoteInstId = remoteInstanceId;
return HvCall4(HvCallEventDmaBufList, packed.dword, localBufList, return HvCall4(HvCallEventDmaBufList, packed.dword, localBufList,
remoteBufList, transferLength); remoteBufList, transferLength);
} }
static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type,
HvLpIndex remoteLp, HvLpDma_Direction direction,
HvLpInstanceId localInstanceId,
HvLpInstanceId remoteInstanceId,
HvLpDma_AddressType localAddressType,
HvLpDma_AddressType remoteAddressType,
u64 localAddrOrTce, u64 remoteAddrOrTce, u32 transferLength)
{
/* Pack the misc bits into a single Dword to pass to PLIC */
union {
struct HvCallEvent_PackedDmaParms parms;
u64 dword;
} packed;
packed.parms.xDirection = direction;
packed.parms.xLocalAddrType = localAddressType;
packed.parms.xRemoteAddrType = remoteAddressType;
packed.parms.xRsvd1 = 0;
packed.parms.xRemoteLp = remoteLp;
packed.parms.xType = type;
packed.parms.xRsvd2 = 0;
packed.parms.xLocalInstId = localInstanceId;
packed.parms.xRemoteInstId = remoteInstanceId;
return (HvLpDma_Rc)HvCall4(HvCallEventDmaSingle, packed.dword,
localAddrOrTce, remoteAddrOrTce, transferLength);
}
static inline HvLpDma_Rc HvCallEvent_dmaToSp(void *local, u32 remote, static inline HvLpDma_Rc HvCallEvent_dmaToSp(void *local, u32 remote,
u32 length, HvLpDma_Direction dir) u32 length, HvLpDma_Direction dir)
{ {
u64 abs_addr; return HvCall4(HvCallEventDmaToSp, virt_to_abs(local), remote,
length, dir);
abs_addr = virt_to_abs(local);
return HvCall4(HvCallEventDmaToSp, abs_addr, remote, length, dir);
} }
#endif /* _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H */ #endif /* _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H */
/* /*
* HvCallSc.h
* Copyright (C) 2001 Mike Corrigan IBM Corporation * Copyright (C) 2001 Mike Corrigan IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
......
/* /*
* HvLpConfig.h
* Copyright (C) 2001 Mike Corrigan IBM Corporation * Copyright (C) 2001 Mike Corrigan IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
......
/* /*
* HvLpEvent.h
* Copyright (C) 2001 Mike Corrigan IBM Corporation * Copyright (C) 2001 Mike Corrigan IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -32,17 +31,8 @@ ...@@ -32,17 +31,8 @@
* partitions through PLIC. * partitions through PLIC.
*/ */
struct HvEventFlags {
u8 xValid:1; /* Indicates a valid request x00-x00 */
u8 xRsvd1:4; /* Reserved ... */
u8 xAckType:1; /* Immediate or deferred ... */
u8 xAckInd:1; /* Indicates if ACK required ... */
u8 xFunction:1; /* Interrupt or Acknowledge ... */
};
struct HvLpEvent { struct HvLpEvent {
struct HvEventFlags xFlags; /* Event flags x00-x00 */ u8 flags; /* Event flags x00-x00 */
u8 xType; /* Type of message x01-x01 */ u8 xType; /* Type of message x01-x01 */
u16 xSubtype; /* Subtype for event x02-x03 */ u16 xSubtype; /* Subtype for event x02-x03 */
u8 xSourceLp; /* Source LP x04-x04 */ u8 xSourceLp; /* Source LP x04-x04 */
...@@ -126,6 +116,11 @@ extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex); ...@@ -126,6 +116,11 @@ extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex);
#define HvLpEvent_AckType_ImmediateAck 0 #define HvLpEvent_AckType_ImmediateAck 0
#define HvLpEvent_AckType_DeferredAck 1 #define HvLpEvent_AckType_DeferredAck 1
#define HV_LP_EVENT_INT 0x01
#define HV_LP_EVENT_DO_ACK 0x02
#define HV_LP_EVENT_DEFERRED_ACK 0x04
#define HV_LP_EVENT_VALID 0x80
#define HvLpDma_Direction_LocalToRemote 0 #define HvLpDma_Direction_LocalToRemote 0
#define HvLpDma_Direction_RemoteToLocal 1 #define HvLpDma_Direction_RemoteToLocal 1
...@@ -139,4 +134,29 @@ extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex); ...@@ -139,4 +134,29 @@ extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex);
#define HvLpDma_Rc_InvalidAddress 4 #define HvLpDma_Rc_InvalidAddress 4
#define HvLpDma_Rc_InvalidLength 5 #define HvLpDma_Rc_InvalidLength 5
static inline int hvlpevent_is_valid(struct HvLpEvent *h)
{
return h->flags & HV_LP_EVENT_VALID;
}
static inline void hvlpevent_invalidate(struct HvLpEvent *h)
{
h->flags &= ~ HV_LP_EVENT_VALID;
}
static inline int hvlpevent_is_int(struct HvLpEvent *h)
{
return h->flags & HV_LP_EVENT_INT;
}
static inline int hvlpevent_is_ack(struct HvLpEvent *h)
{
return !hvlpevent_is_int(h);
}
static inline int hvlpevent_need_ack(struct HvLpEvent *h)
{
return h->flags & HV_LP_EVENT_DO_ACK;
}
#endif /* _ASM_POWERPC_ISERIES_HV_LP_EVENT_H */ #endif /* _ASM_POWERPC_ISERIES_HV_LP_EVENT_H */
/* /*
* HvTypes.h
* Copyright (C) 2001 Mike Corrigan IBM Corporation * Copyright (C) 2001 Mike Corrigan IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
#include <linux/types.h> #include <linux/types.h>
/* /*
* File iSeries_io.h created by Allan Trautman on Thu Dec 28 2000. * Created by Allan Trautman on Thu Dec 28 2000.
* *
* Remaps the io.h for the iSeries Io * Remaps the io.h for the iSeries Io
* Copyright (C) 2000 Allan H Trautman, IBM Corporation * Copyright (C) 2000 Allan H Trautman, IBM Corporation
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
* End Change Activity * End Change Activity
*/ */
#ifdef CONFIG_PCI
extern u8 iSeries_Read_Byte(const volatile void __iomem * IoAddress); extern u8 iSeries_Read_Byte(const volatile void __iomem * IoAddress);
extern u16 iSeries_Read_Word(const volatile void __iomem * IoAddress); extern u16 iSeries_Read_Word(const volatile void __iomem * IoAddress);
extern u32 iSeries_Read_Long(const volatile void __iomem * IoAddress); extern u32 iSeries_Read_Long(const volatile void __iomem * IoAddress);
...@@ -44,6 +45,17 @@ extern void iSeries_memcpy_toio(volatile void __iomem *dest, void *source, ...@@ -44,6 +45,17 @@ extern void iSeries_memcpy_toio(volatile void __iomem *dest, void *source,
size_t n); size_t n);
extern void iSeries_memcpy_fromio(void *dest, extern void iSeries_memcpy_fromio(void *dest,
const volatile void __iomem *source, size_t n); const volatile void __iomem *source, size_t n);
#else
static inline u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)
{
return 0xff;
}
static inline void iSeries_Write_Byte(u8 IoData,
volatile void __iomem *IoAddress)
{
}
#endif /* CONFIG_PCI */
#endif /* CONFIG_PPC_ISERIES */ #endif /* CONFIG_PPC_ISERIES */
#endif /* _ASM_POWERPC_ISERIES_ISERIES_IO_H */ #endif /* _ASM_POWERPC_ISERIES_ISERIES_IO_H */
/* /*
* ItExtVpdPanel.h
* Copyright (C) 2002 Dave Boutcher IBM Corporation * Copyright (C) 2002 Dave Boutcher IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
......
/* /*
* ItLpNaca.h
* Copyright (C) 2001 Mike Corrigan IBM Corporation * Copyright (C) 2001 Mike Corrigan IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -37,17 +36,13 @@ struct ItLpNaca { ...@@ -37,17 +36,13 @@ struct ItLpNaca {
u8 xLpIndex; // LP Index x0B-x0B u8 xLpIndex; // LP Index x0B-x0B
u16 xMaxLpQueues; // Number of allocated queues x0C-x0D u16 xMaxLpQueues; // Number of allocated queues x0C-x0D
u16 xLpQueueOffset; // Offset to start of LP queues x0E-x0F u16 xLpQueueOffset; // Offset to start of LP queues x0E-x0F
u8 xPirEnvironMode:8; // Piranha or hardware x10-x10 u8 xPirEnvironMode; // Piranha or hardware x10-x10
u8 xPirConsoleMode:8; // Piranha console indicator x11-x11 u8 xPirConsoleMode; // Piranha console indicator x11-x11
u8 xPirDasdMode:8; // Piranha dasd indicator x12-x12 u8 xPirDasdMode; // Piranha dasd indicator x12-x12
u8 xRsvd1_0[5]; // Reserved for Piranha related x13-x17 u8 xRsvd1_0[5]; // Reserved for Piranha related x13-x17
u8 xLparInstalled:1; // Is LPAR installed on system x18-x1F u8 flags; // flags, see below x18-x1F
u8 xSysPartitioned:1; // Is the system partitioned ... u8 xSpVpdFormat; // VPD areas are in CSP format ...
u8 xHwSyncedTBs:1; // Hardware synced TBs ... u8 xIntProcRatio; // Ratio of int procs to procs ...
u8 xIntProcUtilHmt:1; // Utilize HMT for interrupts ...
u8 xRsvd1_1:4; // Reserved ...
u8 xSpVpdFormat:8; // VPD areas are in CSP format ...
u8 xIntProcRatio:8; // Ratio of int procs to procs ...
u8 xRsvd1_2[5]; // Reserved ... u8 xRsvd1_2[5]; // Reserved ...
u16 xRsvd1_3; // Reserved x20-x21 u16 xRsvd1_3; // Reserved x20-x21
u16 xPlicVrmIndex; // VRM index of PLIC x22-x23 u16 xPlicVrmIndex; // VRM index of PLIC x22-x23
...@@ -77,4 +72,9 @@ struct ItLpNaca { ...@@ -77,4 +72,9 @@ struct ItLpNaca {
extern struct ItLpNaca itLpNaca; extern struct ItLpNaca itLpNaca;
#define ITLPNACA_LPAR 0x80 /* Is LPAR installed on the system */
#define ITLPNACA_PARTITIONED 0x40 /* Is the system partitioned */
#define ITLPNACA_HWSYNCEDTBS 0x20 /* Hardware synced TBs */
#define ITLPNACA_HMTINT 0x10 /* Utilize MHT for interrupts */
#endif /* _ASM_POWERPC_ISERIES_IT_LP_NACA_H */ #endif /* _ASM_POWERPC_ISERIES_IT_LP_NACA_H */
/* /*
* ItLpQueue.h
* Copyright (C) 2001 Mike Corrigan IBM Corporation * Copyright (C) 2001 Mike Corrigan IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
......
/* /*
* ItLpRegSave.h
* Copyright (C) 2001 Mike Corrigan IBM Corporation * Copyright (C) 2001 Mike Corrigan IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -83,4 +82,4 @@ struct ItLpRegSave { ...@@ -83,4 +82,4 @@ struct ItLpRegSave {
extern struct ItLpRegSave iseries_reg_save[]; extern struct ItLpRegSave iseries_reg_save[];
#endif /* _ITLPREGSAVE_H */ #endif /* _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H */
/* /*
* LparMap.h
* Copyright (C) 2001 Mike Corrigan IBM Corporation * Copyright (C) 2001 Mike Corrigan IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
......
/* /*
* mf.h
* Copyright (C) 2001 Troy D. Armstrong IBM Corporation * Copyright (C) 2001 Troy D. Armstrong IBM Corporation
* Copyright (C) 2004 Stephen Rothwell IBM Corporation * Copyright (C) 2004 Stephen Rothwell IBM Corporation
* *
......
/* -*- linux-c -*- /* -*- linux-c -*-
* drivers/char/vio.h
* *
* iSeries Virtual I/O Message Path header * iSeries Virtual I/O Message Path header
* *
......
...@@ -142,8 +142,6 @@ void pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus); ...@@ -142,8 +142,6 @@ void pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus);
extern int pcibios_remove_root_bus(struct pci_controller *phb); extern int pcibios_remove_root_bus(struct pci_controller *phb);
extern void phbs_remap_io(void);
static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
{ {
struct device_node *busdn = bus->sysdata; struct device_node *busdn = bus->sysdata;
......
...@@ -133,6 +133,14 @@ extern int fix_alignment(struct pt_regs *); ...@@ -133,6 +133,14 @@ extern int fix_alignment(struct pt_regs *);
extern void cvt_fd(float *from, double *to, struct thread_struct *thread); extern void cvt_fd(float *from, double *to, struct thread_struct *thread);
extern void cvt_df(double *from, float *to, struct thread_struct *thread); extern void cvt_df(double *from, float *to, struct thread_struct *thread);
#ifndef CONFIG_SMP
extern void discard_lazy_cpu_state(void);
#else
static inline void discard_lazy_cpu_state(void)
{
}
#endif
#ifdef CONFIG_ALTIVEC #ifdef CONFIG_ALTIVEC
extern void flush_altivec_to_thread(struct task_struct *); extern void flush_altivec_to_thread(struct task_struct *);
#else #else
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#ifndef __PPC_SYSTEM_H #ifndef __PPC_SYSTEM_H
#define __PPC_SYSTEM_H #define __PPC_SYSTEM_H
#include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <asm/atomic.h> #include <asm/atomic.h>
...@@ -39,7 +38,7 @@ ...@@ -39,7 +38,7 @@
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#define smp_mb() mb() #define smp_mb() mb()
#define smp_rmb() rmb() #define smp_rmb() rmb()
#define smp_wmb() wmb() #define smp_wmb() __asm__ __volatile__ ("eieio" : : : "memory")
#define smp_read_barrier_depends() read_barrier_depends() #define smp_read_barrier_depends() read_barrier_depends()
#else #else
#define smp_mb() barrier() #define smp_mb() barrier()
...@@ -74,6 +73,7 @@ extern void chrp_nvram_init(void); ...@@ -74,6 +73,7 @@ extern void chrp_nvram_init(void);
extern void read_rtc_time(void); extern void read_rtc_time(void);
extern void pmac_find_display(void); extern void pmac_find_display(void);
extern void giveup_fpu(struct task_struct *); extern void giveup_fpu(struct task_struct *);
extern void disable_kernel_fp(void);
extern void enable_kernel_fp(void); extern void enable_kernel_fp(void);
extern void flush_fp_to_thread(struct task_struct *); extern void flush_fp_to_thread(struct task_struct *);
extern void enable_kernel_altivec(void); extern void enable_kernel_altivec(void);
...@@ -86,6 +86,14 @@ extern int fix_alignment(struct pt_regs *); ...@@ -86,6 +86,14 @@ extern int fix_alignment(struct pt_regs *);
extern void cvt_fd(float *from, double *to, struct thread_struct *thread); extern void cvt_fd(float *from, double *to, struct thread_struct *thread);
extern void cvt_df(double *from, float *to, struct thread_struct *thread); extern void cvt_df(double *from, float *to, struct thread_struct *thread);
#ifndef CONFIG_SMP
extern void discard_lazy_cpu_state(void);
#else
static inline void discard_lazy_cpu_state(void)
{
}
#endif
#ifdef CONFIG_ALTIVEC #ifdef CONFIG_ALTIVEC
extern void flush_altivec_to_thread(struct task_struct *); extern void flush_altivec_to_thread(struct task_struct *);
#else #else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册