arch/s390/hypfs/hypfs_diag_fs.c
Source file repositories/reference/linux-study-clean/arch/s390/hypfs/hypfs_diag_fs.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/hypfs/hypfs_diag_fs.c- Extension
.c- Size
- 10601 bytes
- Lines
- 378
- Domain
- Architecture Layer
- Bucket
- arch/s390
- 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.
- 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/types.hlinux/errno.hlinux/slab.hlinux/string.hlinux/vmalloc.hlinux/mm.hasm/machine.hasm/diag.hasm/ebcdic.hhypfs_diag.hhypfs.h
Detected Declarations
function info_blk_hdr__sizefunction info_blk_hdr__nparfunction info_blk_hdr__flagsfunction part_hdr__sizefunction part_hdr__rcpusfunction part_hdr__part_namefunction cpu_info__sizefunction cpu_info__ctidxfunction cpu_info__cpu_addrfunction cpu_info__acc_timefunction cpu_info__lp_timefunction cpu_info__online_timefunction phys_hdr__sizefunction phys_hdr__cpusfunction phys_cpu__sizefunction phys_cpu__cpu_addrfunction phys_cpu__mgm_timefunction phys_cpu__ctidxfunction hypfs_create_cpu_filesfunction hypfs_create_phys_cpu_filesfunction hypfs_diag_create_filesfunction diag224_idx2namefunction diag224_get_name_tablefunction diag224_delete_name_tablefunction __hypfs_diag_fs_initfunction __hypfs_diag_fs_exit
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Hypervisor filesystem for Linux on s390. Diag 204 and 224
* implementation.
*
* Copyright IBM Corp. 2006, 2008
* Author(s): Michael Holzheu <holzheu@de.ibm.com>
*/
#define pr_fmt(fmt) "hypfs: " fmt
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/vmalloc.h>
#include <linux/mm.h>
#include <asm/machine.h>
#include <asm/diag.h>
#include <asm/ebcdic.h>
#include "hypfs_diag.h"
#include "hypfs.h"
#define TMP_SIZE 64 /* size of temporary buffers */
static char *diag224_cpu_names; /* diag 224 name table */
static int diag224_idx2name(int index, char *name);
/*
* DIAG 204 member access functions.
*
* Since we have two different diag 204 data formats for old and new s390
* machines, we do not access the structs directly, but use getter functions for
* each struct member instead. This should make the code more readable.
*/
/* Time information block */
static inline int info_blk_hdr__size(enum diag204_format type)
{
if (type == DIAG204_INFO_SIMPLE)
return sizeof(struct diag204_info_blk_hdr);
else /* DIAG204_INFO_EXT */
return sizeof(struct diag204_x_info_blk_hdr);
}
static inline __u8 info_blk_hdr__npar(enum diag204_format type, void *hdr)
{
if (type == DIAG204_INFO_SIMPLE)
return ((struct diag204_info_blk_hdr *)hdr)->npar;
else /* DIAG204_INFO_EXT */
return ((struct diag204_x_info_blk_hdr *)hdr)->npar;
}
static inline __u8 info_blk_hdr__flags(enum diag204_format type, void *hdr)
{
if (type == DIAG204_INFO_SIMPLE)
return ((struct diag204_info_blk_hdr *)hdr)->flags;
else /* DIAG204_INFO_EXT */
return ((struct diag204_x_info_blk_hdr *)hdr)->flags;
}
/* Partition header */
static inline int part_hdr__size(enum diag204_format type)
{
if (type == DIAG204_INFO_SIMPLE)
return sizeof(struct diag204_part_hdr);
else /* DIAG204_INFO_EXT */
return sizeof(struct diag204_x_part_hdr);
}
static inline __u8 part_hdr__rcpus(enum diag204_format type, void *hdr)
{
if (type == DIAG204_INFO_SIMPLE)
return ((struct diag204_part_hdr *)hdr)->cpus;
else /* DIAG204_INFO_EXT */
return ((struct diag204_x_part_hdr *)hdr)->rcpus;
}
static inline void part_hdr__part_name(enum diag204_format type, void *hdr,
char *name)
{
if (type == DIAG204_INFO_SIMPLE)
memcpy(name, ((struct diag204_part_hdr *)hdr)->part_name,
DIAG204_LPAR_NAME_LEN);
else /* DIAG204_INFO_EXT */
memcpy(name, ((struct diag204_x_part_hdr *)hdr)->part_name,
DIAG204_LPAR_NAME_LEN);
EBCASC(name, DIAG204_LPAR_NAME_LEN);
Annotation
- Immediate include surface: `linux/types.h`, `linux/errno.h`, `linux/slab.h`, `linux/string.h`, `linux/vmalloc.h`, `linux/mm.h`, `asm/machine.h`, `asm/diag.h`.
- Detected declarations: `function info_blk_hdr__size`, `function info_blk_hdr__npar`, `function info_blk_hdr__flags`, `function part_hdr__size`, `function part_hdr__rcpus`, `function part_hdr__part_name`, `function cpu_info__size`, `function cpu_info__ctidx`, `function cpu_info__cpu_addr`, `function cpu_info__acc_time`.
- Atlas domain: Architecture Layer / arch/s390.
- 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.