arch/sh/boot/compressed/misc.c
Source file repositories/reference/linux-study-clean/arch/sh/boot/compressed/misc.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sh/boot/compressed/misc.c- Extension
.c- Size
- 2710 bytes
- Lines
- 142
- Domain
- Architecture Layer
- Bucket
- arch/sh
- 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/uaccess.hasm/addrspace.hasm/page.hmisc.h../../../../lib/decompress_inflate.c../../../../lib/decompress_bunzip2.c../../../../lib/decompress_unlzma.c../../../../lib/decompress_unxz.c../../../../lib/decompress_unlzo.c
Detected Declarations
function putsfunction memsetfunction memcpyfunction errorfunction __stack_chk_failfunction ftrace_stubfunction decompress_kernel
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* arch/sh/boot/compressed/misc.c
*
* This is a collection of several routines from gzip-1.0.3
* adapted for Linux.
*
* malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
*
* Adapted for SH by Stuart Menefy, Aug 1999
*
* Modified to use standard LinuxSH BIOS by Greg Banks 7Jul2000
*/
#include <linux/uaccess.h>
#include <asm/addrspace.h>
#include <asm/page.h>
#include "misc.h"
/*
* gzip declarations
*/
#define STATIC static
#undef memset
#undef memcpy
#define memzero(s, n) memset ((s), 0, (n))
extern char input_data[];
extern int input_len;
static unsigned char *output;
static void error(char *m);
int puts(const char *);
extern int _text; /* Defined in vmlinux.lds.S */
extern int _end;
static unsigned long free_mem_ptr;
static unsigned long free_mem_end_ptr;
#ifdef CONFIG_HAVE_KERNEL_BZIP2
#define HEAP_SIZE 0x400000
#else
#define HEAP_SIZE 0x10000
#endif
#ifdef CONFIG_KERNEL_GZIP
#include "../../../../lib/decompress_inflate.c"
#endif
#ifdef CONFIG_KERNEL_BZIP2
#include "../../../../lib/decompress_bunzip2.c"
#endif
#ifdef CONFIG_KERNEL_LZMA
#include "../../../../lib/decompress_unlzma.c"
#endif
#ifdef CONFIG_KERNEL_XZ
#include "../../../../lib/decompress_unxz.c"
#endif
#ifdef CONFIG_KERNEL_LZO
#include "../../../../lib/decompress_unlzo.c"
#endif
int puts(const char *s)
{
/* This should be updated to use the sh-sci routines */
return 0;
}
void* memset(void* s, int c, size_t n)
{
int i;
char *ss = (char*)s;
for (i=0;i<n;i++) ss[i] = c;
return s;
}
void* memcpy(void* __dest, __const void* __src,
size_t __n)
{
int i;
char *d = (char *)__dest, *s = (char *)__src;
Annotation
- Immediate include surface: `linux/uaccess.h`, `asm/addrspace.h`, `asm/page.h`, `misc.h`, `../../../../lib/decompress_inflate.c`, `../../../../lib/decompress_bunzip2.c`, `../../../../lib/decompress_unlzma.c`, `../../../../lib/decompress_unxz.c`.
- Detected declarations: `function puts`, `function memset`, `function memcpy`, `function error`, `function __stack_chk_fail`, `function ftrace_stub`, `function decompress_kernel`.
- Atlas domain: Architecture Layer / arch/sh.
- 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.