2 #ifndef _PPC64_MACHDEP_H
3 #define _PPC64_MACHDEP_H
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #include <linux/config.h>
13 #include <linux/seq_file.h>
14 #include <linux/irq.h>
24 void (*message_pass)(int target, int msg, unsigned long data, int wait);
26 void (*kick_cpu)(int nr);
27 void (*setup_cpu)(int nr);
28 void (*take_timebase)(void);
29 void (*give_timebase)(void);
33 struct machdep_calls {
34 void (*hpte_invalidate)(unsigned long slot,
38 long (*hpte_updatepp)(unsigned long slot,
43 void (*hpte_updateboltedpp)(unsigned long newpp,
45 long (*hpte_insert)(unsigned long hpte_group,
49 unsigned long hpteflags,
52 long (*hpte_remove)(unsigned long hpte_group);
53 void (*flush_hash_range)(unsigned long context,
57 void (*tce_build)(struct TceTable * tbl,
61 void (*tce_free_one)(struct TceTable *tbl,
64 void (*setup_arch)(void);
65 /* Optional, may be NULL. */
66 void (*setup_residual)(struct seq_file *m, int cpu_id);
67 /* Optional, may be NULL. */
68 void (*get_cpuinfo)(struct seq_file *m);
70 void (*init_IRQ)(void);
71 void (*init_irq_desc)(irq_desc_t *desc);
72 int (*get_irq)(struct pt_regs *);
74 /* Optional, may be NULL. */
77 void (*restart)(char *cmd);
78 void (*power_off)(void);
81 int (*set_rtc_time)(struct rtc_time *);
82 void (*get_rtc_time)(struct rtc_time *);
83 void (*get_boot_time)(struct rtc_time *);
85 void (*calibrate_decr)(void);
87 void (*progress)(char *, unsigned short);
89 /* Debug interface. Low level I/O to some terminal device */
90 void (*udbg_putc)(unsigned char c);
91 unsigned char (*udbg_getc)(void);
92 int (*udbg_getc_poll)(void);
94 /* Interface for platform error logging */
95 void (*log_error)(char *buf, unsigned int err_type, int fatal);
97 ssize_t (*nvram_write)(char *buf, size_t count, loff_t *index);
98 ssize_t (*nvram_read)(char *buf, size_t count, loff_t *index);
101 /* functions for dealing with other cpus */
102 struct smp_ops_t smp_ops;
103 #endif /* CONFIG_SMP */
106 extern struct machdep_calls ppc_md;
107 extern char cmd_line[512];
109 /* Functions to produce codes on the leds.
110 * The SRC code should be unique for the message category and should
111 * be limited to the lower 24 bits (the upper 8 are set by these funcs),
112 * and (for boot & dump) should be sorted numerically in the order
115 /* Print a boot progress message. */
116 void ppc64_boot_msg(unsigned int src, const char *msg);
117 /* Print a termination message (print only -- does not stop the kernel) */
118 void ppc64_terminate_msg(unsigned int src, const char *msg);
119 /* Print something that needs attention (device error, etc) */
120 void ppc64_attention_msg(unsigned int src, const char *msg);
121 /* Print a dump progress message. */
122 void ppc64_dump_msg(unsigned int src, const char *msg);
124 static inline void log_error(char *buf, unsigned int err_type, int fatal)
126 if (ppc_md.log_error)
127 ppc_md.log_error(buf, err_type, fatal);
130 #endif /* _PPC64_MACHDEP_H */
131 #endif /* __KERNEL__ */