• Home
  • Raw
  • Download

Lines Matching +full:pre +full:- +full:processing

1 // SPDX-License-Identifier: GPL-2.0-only
9 #include <linux/firmware-map.h>
18 * Data types ------------------------------------------------------------------
39 * Forward declarations --------------------------------------------------------
51 * Static data -----------------------------------------------------------------
83 * by boot mem after the system is up. So when we hot-remove memory whose
85 * reuse it when the memory is hot-added again.
104 * the memory is hot-added again. The entry will be added to in release_firmware_map_entry()
109 list_add(&entry->list, &map_entries_bootmem); in release_firmware_map_entry()
125 * Registration functions ------------------------------------------------------
129 * firmware_map_add_entry() - Does the real work to add a firmware memmap entry.
133 * @entry: Pre-allocated (either kmalloc() or bootmem allocator), uninitialised
137 * which expects a pre-allocated struct firmware_map_entry.
147 entry->start = start; in firmware_map_add_entry()
148 entry->end = end - 1; in firmware_map_add_entry()
149 entry->type = type; in firmware_map_add_entry()
150 INIT_LIST_HEAD(&entry->list); in firmware_map_add_entry()
151 kobject_init(&entry->kobj, &memmap_ktype); in firmware_map_add_entry()
154 list_add_tail(&entry->list, &map_entries); in firmware_map_add_entry()
161 * firmware_map_remove_entry() - Does the real work to remove a firmware
169 list_del(&entry->list); in firmware_map_remove_entry()
180 if (entry->kobj.state_in_sysfs) in add_sysfs_fw_map_entry()
181 return -EEXIST; in add_sysfs_fw_map_entry()
186 return -ENOMEM; in add_sysfs_fw_map_entry()
189 entry->kobj.kset = mmap_kset; in add_sysfs_fw_map_entry()
190 if (kobject_add(&entry->kobj, NULL, "%d", map_entries_nr++)) in add_sysfs_fw_map_entry()
191 kobject_put(&entry->kobj); in add_sysfs_fw_map_entry()
201 kobject_put(&entry->kobj); in remove_sysfs_fw_map_entry()
205 * firmware_map_find_entry_in_list() - Search memmap entry in a given list.
213 * the lock until the processing of the returned entry has completed.
224 if ((entry->start == start) && (entry->end == end) && in firmware_map_find_entry_in_list()
225 (!strcmp(entry->type, type))) { in firmware_map_find_entry_in_list()
233 * firmware_map_find_entry() - Search memmap entry in map_entries.
240 * until the processing of the returned entry has completed.
251 * firmware_map_find_entry_bootmem() - Search memmap entry in map_entries_bootmem.
269 * firmware_map_add_hotplug() - Adds a firmware mapping entry when we do
279 * Return: 0 on success, or -ENOMEM if no memory could be allocated.
285 entry = firmware_map_find_entry(start, end - 1, type); in firmware_map_add_hotplug()
289 entry = firmware_map_find_entry_bootmem(start, end - 1, type); in firmware_map_add_hotplug()
293 return -ENOMEM; in firmware_map_add_hotplug()
297 list_del(&entry->list); in firmware_map_add_hotplug()
311 * firmware_map_add_early() - Adds a firmware mapping entry.
321 * Return: 0 on success, or -ENOMEM if no memory could be allocated.
330 return -ENOMEM; in firmware_map_add_early()
336 * firmware_map_remove() - remove a firmware mapping entry
343 * Return: 0 on success, or -EINVAL if no entry.
350 entry = firmware_map_find_entry(start, end - 1, type); in firmware_map_remove()
353 return -EINVAL; in firmware_map_remove()
366 * Sysfs functions -------------------------------------------------------------
372 (unsigned long long)entry->start); in start_show()
378 (unsigned long long)entry->end); in end_show()
383 return snprintf(buf, PAGE_SIZE, "%s\n", entry->type); in type_show()
397 return memmap_attr->show(entry, buf); in memmap_attr_show()