arch/powerpc/include/asm/rtas.h
Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/rtas.h
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/include/asm/rtas.h- Extension
.h- Size
- 24630 bytes
- Lines
- 580
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mutex.hlinux/spinlock.hasm/page.hasm/rtas-types.hlinux/time.hlinux/cpumask.h
Detected Declarations
struct rtc_timeenum rtas_function_indexfunction rtas_callfunction rtas_error_dispositionfunction rtas_set_disposition_recoveredfunction rtas_error_extendedfunction rtas_error_initiatorfunction rtas_error_extended_log_lengthfunction rtas_ext_event_log_formatfunction rtas_ext_event_company_idfunction pseries_errorlog_idfunction pseries_errorlog_lengthfunction rtas_function_implementedfunction clobbering_unread_rtas_eventfunction rtas_syscall_dispatch_ibm_suspend_mefunction rtas_cancel_event_scanfunction rtas_config_addrfunction page_is_rtas_user_buffunction page_is_rtas_user_buffunction pSeries_coalesce_initfunction read_24x7_sys_info
Annotated Snippet
static inline int clobbering_unread_rtas_event(void) { return 0; }
static inline int rtas_syscall_dispatch_ibm_suspend_me(u64 handle)
{
return -EINVAL;
}
#endif
#ifdef CONFIG_PPC_RTAS_DAEMON
void rtas_cancel_event_scan(void);
#else
static inline void rtas_cancel_event_scan(void) { }
#endif
/* Error types logged. */
#define ERR_FLAG_ALREADY_LOGGED 0x0
#define ERR_FLAG_BOOT 0x1 /* log was pulled from NVRAM on boot */
#define ERR_TYPE_RTAS_LOG 0x2 /* from rtas event-scan */
#define ERR_TYPE_KERNEL_PANIC 0x4 /* from die()/panic() */
#define ERR_TYPE_KERNEL_PANIC_GZ 0x8 /* ditto, compressed */
/* All the types and not flags */
#define ERR_TYPE_MASK \
(ERR_TYPE_RTAS_LOG | ERR_TYPE_KERNEL_PANIC | ERR_TYPE_KERNEL_PANIC_GZ)
#define RTAS_DEBUG KERN_DEBUG "RTAS: "
#define RTAS_ERROR_LOG_MAX 2048
/*
* Return the firmware-specified size of the error log buffer
* for all rtas calls that require an error buffer argument.
* This includes 'check-exception' and 'rtas-last-error'.
*/
int rtas_get_error_log_max(void);
/* Event Scan Parameters */
#define EVENT_SCAN_ALL_EVENTS 0xf0000000
#define SURVEILLANCE_TOKEN 9000
#define LOG_NUMBER 64 /* must be a power of two */
#define LOG_NUMBER_MASK (LOG_NUMBER-1)
/* Some RTAS ops require a data buffer and that buffer must be < 4G.
* Rather than having a memory allocator, just use this buffer
* (get the lock first), make the RTAS call. Copy the data instead
* of holding the buffer for long.
*/
#define RTAS_DATA_BUF_SIZE 4096
extern spinlock_t rtas_data_buf_lock;
extern char rtas_data_buf[RTAS_DATA_BUF_SIZE];
/* RMO buffer reserved for user-space RTAS use */
extern unsigned long rtas_rmo_buf;
extern struct mutex rtas_ibm_get_vpd_lock;
extern struct mutex rtas_ibm_get_indices_lock;
extern struct mutex rtas_ibm_set_dynamic_indicator_lock;
extern struct mutex rtas_ibm_get_dynamic_sensor_state_lock;
extern struct mutex rtas_ibm_physical_attestation_lock;
extern struct mutex rtas_ibm_send_hvpipe_msg_lock;
#define GLOBAL_INTERRUPT_QUEUE 9005
/**
* rtas_config_addr - Format a busno, devfn and reg for RTAS.
* @busno: The bus number.
* @devfn: The device and function number as encoded by PCI_DEVFN().
* @reg: The register number.
*
* This function encodes the given busno, devfn and register number as
* required for RTAS calls that take a "config_addr" parameter.
* See PAPR requirement 7.3.4-1 for more info.
*/
static inline u32 rtas_config_addr(int busno, int devfn, int reg)
{
return ((reg & 0xf00) << 20) | ((busno & 0xff) << 16) |
(devfn << 8) | (reg & 0xff);
}
void rtas_give_timebase(void);
void rtas_take_timebase(void);
#ifdef CONFIG_PPC_RTAS
static inline int page_is_rtas_user_buf(unsigned long pfn)
{
unsigned long paddr = (pfn << PAGE_SHIFT);
if (paddr >= rtas_rmo_buf && paddr < (rtas_rmo_buf + RTAS_USER_REGION_SIZE))
return 1;
return 0;
}
Annotation
- Immediate include surface: `linux/mutex.h`, `linux/spinlock.h`, `asm/page.h`, `asm/rtas-types.h`, `linux/time.h`, `linux/cpumask.h`.
- Detected declarations: `struct rtc_time`, `enum rtas_function_index`, `function rtas_call`, `function rtas_error_disposition`, `function rtas_set_disposition_recovered`, `function rtas_error_extended`, `function rtas_error_initiator`, `function rtas_error_extended_log_length`, `function rtas_ext_event_log_format`, `function rtas_ext_event_company_id`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.