-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fox Snowpatch
committed
Feb 21, 2024
1 parent
88333f7
commit 6c48cad
Showing
32 changed files
with
176 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
#include <linux/vmalloc.h> | ||
#include <linux/mm.h> | ||
|
||
static void *__vmalloc_node_range_split(unsigned long size, unsigned long align, | ||
unsigned long start, unsigned long end, | ||
unsigned long exclusion_start, unsigned long exclusion_end, gfp_t gfp_mask, | ||
pgprot_t prot, unsigned long vm_flags, int node, | ||
const void *caller) | ||
{ | ||
void *res = NULL; | ||
|
||
res = __vmalloc_node_range(size, align, start, exclusion_start, | ||
gfp_mask, prot, vm_flags, node, caller); | ||
if (!res) | ||
res = __vmalloc_node_range(size, align, exclusion_end, end, | ||
gfp_mask, prot, vm_flags, node, caller); | ||
|
||
return res; | ||
} | ||
|
||
void *__vmalloc_node(unsigned long size, unsigned long align, | ||
gfp_t gfp_mask, unsigned long vm_flags, int node, | ||
const void *caller) | ||
{ | ||
return __vmalloc_node_range_split(size, align, VMALLOC_START, | ||
VMALLOC_END, code_region_start, code_region_end, | ||
gfp_mask, PAGE_KERNEL, vm_flags, node, caller); | ||
} | ||
|
||
void *vmalloc_huge(unsigned long size, gfp_t gfp_mask) | ||
{ | ||
return __vmalloc_node_range_split(size, 1, VMALLOC_START, VMALLOC_END, | ||
code_region_start, code_region_end, | ||
gfp_mask, PAGE_KERNEL, VM_ALLOW_HUGE_VMAP, | ||
NUMA_NO_NODE, __builtin_return_address(0)); | ||
} | ||
|
||
void *vmalloc_user(unsigned long size) | ||
{ | ||
return __vmalloc_node_range_split(size, SHMLBA, VMALLOC_START, VMALLOC_END, | ||
code_region_start, code_region_end, | ||
GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL, | ||
VM_USERMAP, NUMA_NO_NODE, | ||
__builtin_return_address(0)); | ||
} | ||
|
||
void *vmalloc_32_user(unsigned long size) | ||
{ | ||
return __vmalloc_node_range_split(size, SHMLBA, VMALLOC_START, VMALLOC_END, | ||
code_region_start, code_region_end, | ||
GFP_VMALLOC32 | __GFP_ZERO, PAGE_KERNEL, | ||
VM_USERMAP, NUMA_NO_NODE, | ||
__builtin_return_address(0)); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.