arch/mips/include/asm/octeon/cvmx-pow.h
Source file repositories/reference/linux-study-clean/arch/mips/include/asm/octeon/cvmx-pow.h
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/include/asm/octeon/cvmx-pow.h- Extension
.h- Size
- 65382 bytes
- Lines
- 2216
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/octeon/cvmx-pow-defs.hasm/octeon/cvmx-scratch.hasm/octeon/cvmx-wqe.h
Detected Declarations
enum cvmx_pow_tag_typefunction cvmx_pow_get_current_tagfunction __cvmx_pow_warn_if_pending_switchfunction cvmx_pow_tag_sw_waitfunction cvmx_pow_work_request_null_rdfunction cvmx_pow_work_request_async_nocheckfunction cvmx_pow_work_request_asyncfunction invalidfunction cvmx_pow_tag_sw_fullfunction cvmx_pow_tag_sw_fullfunction cvmx_pow_tag_sw_full_nocheckfunction cvmx_pow_tag_sw_fullfunction cvmx_pow_tag_sw_null_nocheckfunction cvmx_pow_tag_sw_nullfunction cvmx_pow_work_submitfunction cvmx_pow_set_group_maskfunction cvmx_pow_set_priorityfunction cvmx_pow_deschedfunction cvmx_pow_tag_composefunction cvmx_pow_tag_get_sw_bitsfunction Returns
Annotated Snippet
if (unlikely(cvmx_get_cycle() > start_cycle + MAX_CYCLES)) {
pr_warn("Tag switch is taking a long time, possible deadlock\n");
start_cycle = -MAX_CYCLES - 1;
}
}
}
/**
* Synchronous work request. Requests work from the POW.
* This function does NOT wait for previous tag switches to complete,
* so the caller must ensure that there is not a pending tag switch.
*
* @wait: When set, call stalls until work becomes available, or times out.
* If not set, returns immediately.
*
* Returns: the WQE pointer from POW. Returns NULL if no work
* was available.
*/
static inline struct cvmx_wqe *cvmx_pow_work_request_sync_nocheck(cvmx_pow_wait_t
wait)
{
cvmx_pow_load_addr_t ptr;
cvmx_pow_tag_load_resp_t result;
if (CVMX_ENABLE_POW_CHECKS)
__cvmx_pow_warn_if_pending_switch(__func__);
ptr.u64 = 0;
ptr.swork.mem_region = CVMX_IO_SEG;
ptr.swork.is_io = 1;
ptr.swork.did = CVMX_OCT_DID_TAG_SWTAG;
ptr.swork.wait = wait;
result.u64 = cvmx_read_csr(ptr.u64);
if (result.s_work.no_work)
return NULL;
else
return (struct cvmx_wqe *) cvmx_phys_to_ptr(result.s_work.addr);
}
/**
* Synchronous work request. Requests work from the POW.
* This function waits for any previous tag switch to complete before
* requesting the new work.
*
* @wait: When set, call stalls until work becomes available, or times out.
* If not set, returns immediately.
*
* Returns: the WQE pointer from POW. Returns NULL if no work
* was available.
*/
static inline struct cvmx_wqe *cvmx_pow_work_request_sync(cvmx_pow_wait_t wait)
{
if (CVMX_ENABLE_POW_CHECKS)
__cvmx_pow_warn_if_pending_switch(__func__);
/* Must not have a switch pending when requesting work */
cvmx_pow_tag_sw_wait();
return cvmx_pow_work_request_sync_nocheck(wait);
}
/**
* Synchronous null_rd request. Requests a switch out of NULL_NULL POW state.
* This function waits for any previous tag switch to complete before
* requesting the null_rd.
*
* Returns: the POW state of type cvmx_pow_tag_type_t.
*/
static inline enum cvmx_pow_tag_type cvmx_pow_work_request_null_rd(void)
{
cvmx_pow_load_addr_t ptr;
cvmx_pow_tag_load_resp_t result;
if (CVMX_ENABLE_POW_CHECKS)
__cvmx_pow_warn_if_pending_switch(__func__);
/* Must not have a switch pending when requesting work */
cvmx_pow_tag_sw_wait();
ptr.u64 = 0;
ptr.snull_rd.mem_region = CVMX_IO_SEG;
ptr.snull_rd.is_io = 1;
ptr.snull_rd.did = CVMX_OCT_DID_TAG_NULL_RD;
result.u64 = cvmx_read_csr(ptr.u64);
return (enum cvmx_pow_tag_type) result.s_null_rd.state;
}
Annotation
- Immediate include surface: `asm/octeon/cvmx-pow-defs.h`, `asm/octeon/cvmx-scratch.h`, `asm/octeon/cvmx-wqe.h`.
- Detected declarations: `enum cvmx_pow_tag_type`, `function cvmx_pow_get_current_tag`, `function __cvmx_pow_warn_if_pending_switch`, `function cvmx_pow_tag_sw_wait`, `function cvmx_pow_work_request_null_rd`, `function cvmx_pow_work_request_async_nocheck`, `function cvmx_pow_work_request_async`, `function invalid`, `function cvmx_pow_tag_sw_full`, `function cvmx_pow_tag_sw_full`.
- Atlas domain: Architecture Layer / arch/mips.
- Implementation status: source implementation candidate.
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.