Skip to content
Snippets Groups Projects
Select Git revision
  • pkt-ptr-revert-v1
  • bpf-spectre default protected
  • vf-baseline
  • bpf-spectre-baseline
  • v6.5-rc6-bpf-spectre-nospec
  • master
  • spectector-bpf
  • bpftask protected
  • bpftask-no-unused-args
  • bpftask-master
  • v5.9-bpftask
  • v5.8-amd-17h-em protected
  • v5.8-amd-17h-eas protected
  • freqinv-amd3950x-v5.8
  • v5.8-scale-inv-acc-amd-ryzen-3950x
  • 23186e43-amd-17h-eas protected
  • caffb99b6929-perf-x86-rapl-Enable-RAPL-for-AMD-Fam17h
  • 6a9ee74800a1-amd-17h-eas protected
  • add2fae34926-amd_17h_em
  • 3643c88e5545-Add-support-for-frequency-invariance-for-some-x86
  • v5.7-rc6
21 results

drbg.c

Blame
  • memory.c 14.06 KiB
    /*
     * drivers/base/memory.c - basic Memory class support
     *
     * Written by Matt Tolentino <matthew.e.tolentino@intel.com>
     *            Dave Hansen <haveblue@us.ibm.com>
     *
     * This file provides the necessary infrastructure to represent
     * a SPARSEMEM-memory-model system's physical memory in /sysfs.
     * All arch-independent code that assumes MEMORY_HOTPLUG requires
     * SPARSEMEM should be contained here, or in mm/memory_hotplug.c.
     */
    
    #include <linux/sysdev.h>
    #include <linux/module.h>
    #include <linux/init.h>
    #include <linux/topology.h>
    #include <linux/capability.h>
    #include <linux/device.h>
    #include <linux/memory.h>
    #include <linux/kobject.h>
    #include <linux/memory_hotplug.h>
    #include <linux/mm.h>
    #include <linux/mutex.h>
    #include <linux/stat.h>
    #include <linux/slab.h>
    
    #include <asm/atomic.h>
    #include <asm/uaccess.h>
    
    #define MEMORY_CLASS_NAME	"memory"
    
    static struct sysdev_class memory_sysdev_class = {
    	.name = MEMORY_CLASS_NAME,
    };
    
    static const char *memory_uevent_name(struct kset *kset, struct kobject *kobj)
    {
    	return MEMORY_CLASS_NAME;
    }
    
    static int memory_uevent(struct kset *kset, struct kobject *obj, struct kobj_uevent_env *env)
    {
    	int retval = 0;
    
    	return retval;
    }
    
    static const struct kset_uevent_ops memory_uevent_ops = {
    	.name		= memory_uevent_name,
    	.uevent		= memory_uevent,
    };
    
    static BLOCKING_NOTIFIER_HEAD(memory_chain);
    
    int register_memory_notifier(struct notifier_block *nb)
    {
            return blocking_notifier_chain_register(&memory_chain, nb);
    }
    EXPORT_SYMBOL(register_memory_notifier);
    
    void unregister_memory_notifier(struct notifier_block *nb)
    {
            blocking_notifier_chain_unregister(&memory_chain, nb);
    }
    EXPORT_SYMBOL(unregister_memory_notifier);
    
    static ATOMIC_NOTIFIER_HEAD(memory_isolate_chain);
    
    int register_memory_isolate_notifier(struct notifier_block *nb)
    {