arch/powerpc/include/asm/machdep.h

Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/machdep.h

File Facts

System
Linux kernel
Corpus path
arch/powerpc/include/asm/machdep.h
Extension
.h
Size
8947 bytes
Lines
273
Domain
Architecture Layer
Bucket
arch/powerpc
Inferred role
Architecture Layer: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

struct machdep_calls {
	const char	*name;
	const char	*compatible;
	const char * const *compatibles;
#ifdef CONFIG_PPC64
#ifdef CONFIG_PM
	void		(*iommu_restore)(void);
#endif
#ifdef CONFIG_MEMORY_HOTPLUG
	unsigned long	(*memory_block_size)(void);
#endif
#endif /* CONFIG_PPC64 */

	void		(*dma_set_mask)(struct device *dev, u64 dma_mask);

	int		(*probe)(void);
	void		(*setup_arch)(void); /* Optional, may be NULL */
	/* Optional, may be NULL. */
	void		(*show_cpuinfo)(struct seq_file *m);
	/* Returns the current operating frequency of "cpu" in Hz */
	unsigned long  	(*get_proc_freq)(unsigned int cpu);

	void		(*init_IRQ)(void);

	/* Return an irq, or 0 to indicate there are none pending. */
	unsigned int	(*get_irq)(void);

	/* PCI stuff */
	/* Called after allocating resources */
	void		(*pcibios_fixup)(void);
	void		(*pci_irq_fixup)(struct pci_dev *dev);
	int		(*pcibios_root_bridge_prepare)(struct pci_host_bridge
				*bridge);

	/* finds all the pci_controllers present at boot */
	void 		(*discover_phbs)(void);

	/* To setup PHBs when using automatic OF platform driver for PCI */
	int		(*pci_setup_phb)(struct pci_controller *host);

	void __noreturn	(*restart)(char *cmd);
	void __noreturn (*halt)(void);
	void		(*panic)(char *str);

	long		(*time_init)(void); /* Optional, may be NULL */

	int		(*set_rtc_time)(struct rtc_time *);
	void		(*get_rtc_time)(struct rtc_time *);
	time64_t	(*get_boot_time)(void);

	void		(*calibrate_decr)(void);

	void		(*progress)(char *, unsigned short);

	/* Interface for platform error logging */
	void 		(*log_error)(char *buf, unsigned int err_type, int fatal);

	unsigned char 	(*nvram_read_val)(int addr);
	void		(*nvram_write_val)(int addr, unsigned char val);
	ssize_t		(*nvram_write)(char *buf, size_t count, loff_t *index);
	ssize_t		(*nvram_read)(char *buf, size_t count, loff_t *index);
	ssize_t		(*nvram_size)(void);
	void		(*nvram_sync)(void);

	/* Exception handlers */
	int		(*system_reset_exception)(struct pt_regs *regs);
	int 		(*machine_check_exception)(struct pt_regs *regs);
	int		(*handle_hmi_exception)(struct pt_regs *regs);

	/* Early exception handlers called in realmode */
	int		(*hmi_exception_early)(struct pt_regs *regs);
	long		(*machine_check_early)(struct pt_regs *regs);

	/* Called during machine check exception to retrive fixup address. */
	bool		(*mce_check_early_recovery)(struct pt_regs *regs);

	void            (*machine_check_log_err)(void);

	/* Motherboard/chipset features. This is a kind of general purpose
	 * hook used to control some machine specific features (like reset
	 * lines, chip power control, etc...).
	 */
	long	 	(*feature_call)(unsigned int feature, ...);

	/* Get legacy PCI/IDE interrupt mapping */
	int		(*pci_get_legacy_ide_irq)(struct pci_dev *dev, int channel);

	/* Get access protection for /dev/mem */
	pgprot_t	(*phys_mem_access_prot)(unsigned long pfn,
						unsigned long size,

Annotation

Implementation Notes