drivers/soc/samsung/s3c-pm-check.c
Source file repositories/reference/linux-study-clean/drivers/soc/samsung/s3c-pm-check.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/soc/samsung/s3c-pm-check.c- Extension
.c- Size
- 5425 bytes
- Lines
- 234
- Domain
- Driver Families
- Bucket
- drivers/soc
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/suspend.hlinux/init.hlinux/crc32.hlinux/ioport.hlinux/slab.hlinux/soc/samsung/s3c-pm.h
Detected Declarations
function s3c_pm_run_resfunction s3c_pm_run_sysramfunction s3c_pm_check_preparefunction s3c_pm_check_storefunction in_regionfunction s3c_pm_runcheckfunction s3c_pm_check_restorefunction s3c_pm_check_cleanup
Annotated Snippet
if (in_region(ptr, left, stkpage, 4096)) {
S3C_PMDBG("skipping %08lx, has stack in\n", addr);
goto skip_check;
}
if (in_region(ptr, left, crcs, crc_size)) {
S3C_PMDBG("skipping %08lx, has crc block in\n", addr);
goto skip_check;
}
/* calculate and check the checksum */
calc = crc32_le(~0, ptr, left);
if (calc != *val) {
printk(KERN_ERR "Restore CRC error at "
"%08lx (%08x vs %08x)\n", addr, calc, *val);
S3C_PMDBG("Restore CRC error at %08lx (%08x vs %08x)\n",
addr, calc, *val);
}
skip_check:
val++;
}
return val;
}
/**
* s3c_pm_check_restore() - memory check called on resume
*
* check the CRCs after the restore event and free the memory used
* to hold them
*/
void s3c_pm_check_restore(void)
{
if (crcs != NULL)
s3c_pm_run_sysram(s3c_pm_runcheck, crcs);
}
/**
* s3c_pm_check_cleanup() - free memory resources
*
* Free the resources that where allocated by the suspend
* memory check code. We do this separately from the
* s3c_pm_check_restore() function as we cannot call any
* functions that might sleep during that resume.
*/
void s3c_pm_check_cleanup(void)
{
kfree(crcs);
crcs = NULL;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/suspend.h`, `linux/init.h`, `linux/crc32.h`, `linux/ioport.h`, `linux/slab.h`, `linux/soc/samsung/s3c-pm.h`.
- Detected declarations: `function s3c_pm_run_res`, `function s3c_pm_run_sysram`, `function s3c_pm_check_prepare`, `function s3c_pm_check_store`, `function in_region`, `function s3c_pm_runcheck`, `function s3c_pm_check_restore`, `function s3c_pm_check_cleanup`.
- Atlas domain: Driver Families / drivers/soc.
- 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.