lib/dhry_1.c
Source file repositories/reference/linux-study-clean/lib/dhry_1.c
File Facts
- System
- Linux kernel
- Corpus path
lib/dhry_1.c- Extension
.c- Size
- 8077 bytes
- Lines
- 291
- Domain
- Kernel Services
- Bucket
- lib
- Inferred role
- Kernel Services: implementation source
- Status
- source implementation candidate
Why This File Exists
Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
Dependency Surface
dhry.hlinux/ktime.hlinux/slab.hlinux/string.h
Detected Declarations
function Proc_3
Annotated Snippet
if (Ch_1_Glob == 'A') {
/* then, executed */
Int_Loc -= 1;
*Int_Par_Ref = Int_Loc - Int_Glob;
Enum_Loc = Ident_1;
} /* if */
} while (Enum_Loc != Ident_1); /* true */
} /* Proc_2 */
static void Proc_4(void)
/*******/
/* executed once */
{
Boolean Bool_Loc;
Bool_Loc = Ch_1_Glob == 'A';
Bool_Glob = Bool_Loc | Bool_Glob;
Ch_2_Glob = 'B';
} /* Proc_4 */
static void Proc_5(void)
/*******/
/* executed once */
{
Ch_1_Glob = 'A';
Bool_Glob = false;
} /* Proc_5 */
int dhry(int n)
/*****/
/* main program, corresponds to procedures */
/* Main and Proc_0 in the Ada version */
{
One_Fifty Int_1_Loc;
One_Fifty Int_2_Loc;
One_Fifty Int_3_Loc;
char Ch_Index;
Enumeration Enum_Loc;
Str_30 Str_1_Loc;
Str_30 Str_2_Loc;
int Run_Index;
int Number_Of_Runs;
ktime_t Begin_Time, End_Time;
u32 User_Time;
/* Initializations */
Next_Ptr_Glob = (Rec_Pointer) kzalloc_obj(Rec_Type, GFP_ATOMIC);
if (!Next_Ptr_Glob)
return -ENOMEM;
Ptr_Glob = (Rec_Pointer) kzalloc_obj(Rec_Type, GFP_ATOMIC);
if (!Ptr_Glob) {
kfree(Next_Ptr_Glob);
return -ENOMEM;
}
Ptr_Glob->Ptr_Comp = Next_Ptr_Glob;
Ptr_Glob->Discr = Ident_1;
Ptr_Glob->variant.var_1.Enum_Comp = Ident_3;
Ptr_Glob->variant.var_1.Int_Comp = 40;
strcpy(Ptr_Glob->variant.var_1.Str_Comp,
"DHRYSTONE PROGRAM, SOME STRING");
strcpy(Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
Arr_2_Glob[8][7] = 10;
/* Was missing in published program. Without this statement, */
/* Arr_2_Glob[8][7] would have an undefined value. */
/* Warning: With 16-Bit processors and Number_Of_Runs > 32000, */
/* overflow may occur for this array element. */
pr_debug("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
Number_Of_Runs = n;
pr_debug("Execution starts, %d runs through Dhrystone\n",
Number_Of_Runs);
/***************/
/* Start timer */
/***************/
Begin_Time = ktime_get();
for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index) {
Proc_5();
Annotation
- Immediate include surface: `dhry.h`, `linux/ktime.h`, `linux/slab.h`, `linux/string.h`.
- Detected declarations: `function Proc_3`.
- Atlas domain: Kernel Services / lib.
- 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.