2 * Copyright (c) 2010 Isilon Systems, Inc.
3 * Copyright (c) 2010 iX Systems, Inc.
4 * Copyright (c) 2010 Panasas, Inc.
5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
6 * Copyright (c) 2020 François Tigeot <ftigeot@wolfpond.org>
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice unmodified, this list of conditions, and the following
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #include <sys/param.h>
32 #include <linux/rbtree.h>
35 panic_cmp(struct rb_node
*one
, struct rb_node
*two
)
40 RB_GENERATE(linux_root
, rb_node
, __entry
, panic_cmp
);
42 #include <linux/string.h>
43 #include <linux/slab.h>
46 kmemdup(const void *src
, size_t len
, gfp_t gfp
)
50 dst
= kmalloc(len
, M_DRM
, gfp
);
52 memcpy(dst
, src
, len
);
59 framebuffer_alloc(size_t size
, struct device
*dev
)
61 return kzalloc(sizeof(struct fb_info
), GFP_KERNEL
);
65 framebuffer_release(struct fb_info
*info
)
70 #include <asm/processor.h>
72 struct cpuinfo_x86 boot_cpu_data
;
75 init_boot_cpu_data(void *arg
)
77 boot_cpu_data
.x86_clflush_size
= cpu_clflush_line_size
;
82 SYSINIT(boot_cpu_data_init
, SI_SUB_DRIVERS
, SI_ORDER_MIDDLE
, init_boot_cpu_data
, NULL
);
84 #include <linux/sched.h>
86 pid_t
get_task_pid(struct task_struct
*task
, enum pid_type type
)
88 if (task
->dfly_td
== NULL
)
91 if (task
->dfly_td
->td_proc
== NULL
)
94 return task
->dfly_td
->td_proc
->p_pid
;
100 si_meminfo(struct sysinfo
*si
)
102 si
->totalram
= physmem
;
104 si
->mem_unit
= PAGE_SIZE
;