Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/*
2 * Copyright 2006 IBM Corporation.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#ifndef _PSERIES_PSERIES_H
11#define _PSERIES_PSERIES_H
12
13#include <linux/interrupt.h>
14#include <asm/rtas.h>
15
16struct device_node;
17
18extern void request_event_sources_irqs(struct device_node *np,
19 irq_handler_t handler, const char *name);
20
21#include <linux/of.h>
22
23struct pt_regs;
24
25extern int pSeries_system_reset_exception(struct pt_regs *regs);
26extern int pSeries_machine_check_exception(struct pt_regs *regs);
27extern long pseries_machine_check_realmode(struct pt_regs *regs);
28
29#ifdef CONFIG_SMP
30extern void smp_init_pseries(void);
31
32/* Get state of physical CPU from query_cpu_stopped */
33int smp_query_cpu_stopped(unsigned int pcpu);
34#define QCSS_STOPPED 0
35#define QCSS_STOPPING 1
36#define QCSS_NOT_STOPPED 2
37#define QCSS_HARDWARE_ERROR -1
38#define QCSS_HARDWARE_BUSY -2
39#else
40static inline void smp_init_pseries(void) { };
41#endif
42
43extern void pseries_kexec_cpu_down(int crash_shutdown, int secondary);
44
45extern void pSeries_final_fixup(void);
46
47/* Poweron flag used for enabling auto ups restart */
48extern unsigned long rtas_poweron_auto;
49
50/* Provided by HVC VIO */
51extern void hvc_vio_init_early(void);
52
53/* Dynamic logical Partitioning/Mobility */
54extern void dlpar_free_cc_nodes(struct device_node *);
55extern void dlpar_free_cc_property(struct property *);
56extern struct device_node *dlpar_configure_connector(__be32,
57 struct device_node *);
58extern int dlpar_attach_node(struct device_node *, struct device_node *);
59extern int dlpar_detach_node(struct device_node *);
60extern int dlpar_acquire_drc(u32 drc_index);
61extern int dlpar_release_drc(u32 drc_index);
62
63void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog);
64int handle_dlpar_errorlog(struct pseries_hp_errorlog *hp_errlog);
65
66#ifdef CONFIG_MEMORY_HOTPLUG
67int dlpar_memory(struct pseries_hp_errorlog *hp_elog);
68int dlpar_hp_pmem(struct pseries_hp_errorlog *hp_elog);
69#else
70static inline int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
71{
72 return -EOPNOTSUPP;
73}
74static inline int dlpar_hp_pmem(struct pseries_hp_errorlog *hp_elog)
75{
76 return -EOPNOTSUPP;
77}
78#endif
79
80#ifdef CONFIG_HOTPLUG_CPU
81int dlpar_cpu(struct pseries_hp_errorlog *hp_elog);
82#else
83static inline int dlpar_cpu(struct pseries_hp_errorlog *hp_elog)
84{
85 return -EOPNOTSUPP;
86}
87#endif
88
89/* PCI root bridge prepare function override for pseries */
90struct pci_host_bridge;
91int pseries_root_bridge_prepare(struct pci_host_bridge *bridge);
92
93extern struct pci_controller_ops pseries_pci_controller_ops;
94
95unsigned long pseries_memory_block_size(void);
96
97extern int CMO_PrPSP;
98extern int CMO_SecPSP;
99extern unsigned long CMO_PageSize;
100
101static inline int cmo_get_primary_psp(void)
102{
103 return CMO_PrPSP;
104}
105
106static inline int cmo_get_secondary_psp(void)
107{
108 return CMO_SecPSP;
109}
110
111static inline unsigned long cmo_get_page_size(void)
112{
113 return CMO_PageSize;
114}
115
116int dlpar_workqueue_init(void);
117
118void pseries_setup_rfi_flush(void);
119
120#endif /* _PSERIES_PSERIES_H */