arch/mips/boot/compressed/string.c
Source file repositories/reference/linux-study-clean/arch/mips/boot/compressed/string.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/boot/compressed/string.c- Extension
.c- Size
- 779 bytes
- Lines
- 48
- 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.
Dependency Surface
linux/compiler_attributes.hlinux/types.hasm/string.h
Detected Declarations
function memmove
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* arch/mips/boot/compressed/string.c
*
* Very small subset of simple string routines
*/
#include <linux/compiler_attributes.h>
#include <linux/types.h>
#include <asm/string.h>
void *memcpy(void *dest, const void *src, size_t n)
{
int i;
const char *s = src;
char *d = dest;
for (i = 0; i < n; i++)
d[i] = s[i];
return dest;
}
void *memset(void *s, int c, size_t n)
{
int i;
char *ss = s;
for (i = 0; i < n; i++)
ss[i] = c;
return s;
}
void * __weak memmove(void *dest, const void *src, size_t n)
{
unsigned int i;
const char *s = src;
char *d = dest;
if ((uintptr_t)dest < (uintptr_t)src) {
for (i = 0; i < n; i++)
d[i] = s[i];
} else {
for (i = n; i > 0; i--)
d[i - 1] = s[i - 1];
}
return dest;
}
Annotation
- Immediate include surface: `linux/compiler_attributes.h`, `linux/types.h`, `asm/string.h`.
- Detected declarations: `function memmove`.
- 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.