Files
RedBear-OS/local/recipes/gpu/amdgpu-source/include/linux/bootmem_info.h
T
vasilito dc68054305 restore lost packages from 0.2.3 + fix overwritten 0.2.4 files
- Restore 29 recipe symlinks (libdrm, qtbase, dbus, sddm, pipewire, etc.)
- Restore 33 patches (KDE, libdrm, mesa, pipewire, sddm, wireplumber)
- Restore 20+ local/scripts (audit, lint, test, build helpers)
- Restore src/cook/scheduler.rs, status.rs, gnu-config/
- Restore scripts/patch-inclusion-gate.sh, run_mini1.sh, validate-collision-log.sh
- Recover TLC source from HEAD (was overwritten by 0.2.3 checkout)
- Recover 11 local/docs plans from HEAD (were overwritten)
- Recover qt6-wayland-smoke symlink from HEAD
- Fix MOTD: remove garbled ASCII art, use clean text
- Update version: 0.2.0 -> 0.2.4 in os-release, motd, config
- Reduce filesystem_size: 1536 -> 512 MiB
- Add ABSOLUTE RULE to AGENTS.md: never delete/ignore packages
- Reduce pcid scheme log verbosity: info -> debug
2026-06-19 12:39:14 +03:00

91 lines
2.2 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LINUX_BOOTMEM_INFO_H
#define __LINUX_BOOTMEM_INFO_H
#include <linux/mm.h>
#include <linux/kmemleak.h>
/*
* Types for free bootmem stored in the low bits of page->private.
*/
enum bootmem_type {
MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE = 1,
SECTION_INFO = MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE,
MIX_SECTION_INFO,
NODE_INFO,
MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO,
};
#ifdef CONFIG_HAVE_BOOTMEM_INFO_NODE
void __init register_page_bootmem_info_node(struct pglist_data *pgdat);
void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
unsigned long nr_pages);
void get_page_bootmem(unsigned long info, struct page *page,
enum bootmem_type type);
void put_page_bootmem(struct page *page);
static inline enum bootmem_type bootmem_type(const struct page *page)
{
return (unsigned long)page->private & 0xf;
}
static inline unsigned long bootmem_info(const struct page *page)
{
return (unsigned long)page->private >> 4;
}
/*
* Any memory allocated via the memblock allocator and not via the
* buddy will be marked reserved already in the memmap. For those
* pages, we can call this function to free it to buddy allocator.
*/
static inline void free_bootmem_page(struct page *page)
{
enum bootmem_type type = bootmem_type(page);
VM_BUG_ON_PAGE(page_ref_count(page) != 2, page);
if (type == SECTION_INFO || type == MIX_SECTION_INFO)
put_page_bootmem(page);
else
VM_BUG_ON_PAGE(1, page);
}
#else
static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
{
}
static inline void register_page_bootmem_memmap(unsigned long section_nr,
struct page *map, unsigned long nr_pages)
{
}
static inline void put_page_bootmem(struct page *page)
{
}
static inline enum bootmem_type bootmem_type(const struct page *page)
{
return SECTION_INFO;
}
static inline unsigned long bootmem_info(const struct page *page)
{
return 0;
}
static inline void get_page_bootmem(unsigned long info, struct page *page,
enum bootmem_type type)
{
}
static inline void free_bootmem_page(struct page *page)
{
kmemleak_free_part_phys(PFN_PHYS(page_to_pfn(page)), PAGE_SIZE);
free_reserved_page(page);
}
#endif
#endif /* __LINUX_BOOTMEM_INFO_H */