arch/powerpc/include/asm/fsl_hcalls.h
Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/fsl_hcalls.h
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/include/asm/fsl_hcalls.h- Extension
.h- Size
- 17615 bytes
- Lines
- 656
- 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/types.hlinux/errno.hasm/byteorder.hasm/epapr_hcalls.h
Detected Declarations
struct fh_sg_listfunction fh_send_nmifunction fh_partition_get_dtpropfunction fh_partition_set_dtpropfunction fh_partition_restartfunction fh_partition_get_statusfunction fh_partition_startfunction fh_partition_stopfunction fh_partition_memcpyfunction fh_dma_enablefunction fh_dma_disablefunction fh_vmpic_get_msirfunction fh_system_resetfunction fh_err_get_infofunction fh_get_core_statefunction fh_enter_napfunction fh_exit_napfunction fh_claim_devicefunction fh_partition_stop_dma
Annotated Snippet
struct fh_sg_list {
uint64_t source; /**< guest physical address to copy from */
uint64_t target; /**< guest physical address to copy to */
uint64_t size; /**< number of bytes to copy */
uint64_t reserved; /**< reserved, must be zero */
} __attribute__ ((aligned(32)));
/**
* fh_partition_memcpy - copies data from one guest to another
* @source: the ID of the partition to copy from
* @target: the ID of the partition to copy to
* @sg_list: guest physical address of an array of &fh_sg_list structures
* @count: the number of entries in @sg_list
*
* Returns 0 for success, or an error code.
*/
static inline unsigned int fh_partition_memcpy(unsigned int source,
unsigned int target, phys_addr_t sg_list, unsigned int count)
{
register uintptr_t r11 __asm__("r11");
register uintptr_t r3 __asm__("r3");
register uintptr_t r4 __asm__("r4");
register uintptr_t r5 __asm__("r5");
register uintptr_t r6 __asm__("r6");
register uintptr_t r7 __asm__("r7");
r11 = FH_HCALL_TOKEN(FH_PARTITION_MEMCPY);
r3 = source;
r4 = target;
r5 = (uint32_t) sg_list;
#ifdef CONFIG_PHYS_64BIT
r6 = sg_list >> 32;
#else
r6 = 0;
#endif
r7 = count;
asm volatile("bl epapr_hypercall_start"
: "+r" (r11),
"+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7)
: : EV_HCALL_CLOBBERS5
);
return r3;
}
/**
* fh_dma_enable - enable DMA for the specified device
* @liodn: the LIODN of the I/O device for which to enable DMA
*
* Returns 0 for success, or an error code.
*/
static inline unsigned int fh_dma_enable(unsigned int liodn)
{
register uintptr_t r11 __asm__("r11");
register uintptr_t r3 __asm__("r3");
r11 = FH_HCALL_TOKEN(FH_DMA_ENABLE);
r3 = liodn;
asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1
);
return r3;
}
/**
* fh_dma_disable - disable DMA for the specified device
* @liodn: the LIODN of the I/O device for which to disable DMA
*
* Returns 0 for success, or an error code.
*/
static inline unsigned int fh_dma_disable(unsigned int liodn)
{
register uintptr_t r11 __asm__("r11");
register uintptr_t r3 __asm__("r3");
r11 = FH_HCALL_TOKEN(FH_DMA_DISABLE);
r3 = liodn;
asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1
);
return r3;
}
Annotation
- Immediate include surface: `linux/types.h`, `linux/errno.h`, `asm/byteorder.h`, `asm/epapr_hcalls.h`.
- Detected declarations: `struct fh_sg_list`, `function fh_send_nmi`, `function fh_partition_get_dtprop`, `function fh_partition_set_dtprop`, `function fh_partition_restart`, `function fh_partition_get_status`, `function fh_partition_start`, `function fh_partition_stop`, `function fh_partition_memcpy`, `function fh_dma_enable`.
- 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.