The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/include/asm-mips64/module.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #ifndef _ASM_MIPS64_MODULE_H
    2 #define _ASM_MIPS64_MODULE_H
    3 /*
    4  * This file contains the mips64 architecture specific module code.
    5  */
    6 
    7 #include <linux/module.h>
    8 #include <asm/uaccess.h>
    9 
   10 #define module_map(x)           vmalloc(x)
   11 #define module_unmap(x)         vfree(x)
   12 #define module_arch_init(x)     mips64_module_init(x)
   13 #define arch_init_modules(x)    mips64_init_modules(x)
   14 
   15 /*
   16  * This must match in size and layout the data created by
   17  * modutils/obj/obj-mips64.c
   18  */
   19 struct archdata {
   20         const struct exception_table_entry *dbe_table_start;
   21         const struct exception_table_entry *dbe_table_end;
   22 };
   23 
   24 static inline int
   25 mips64_module_init(struct module *mod)
   26 {
   27         struct archdata *archdata;
   28 
   29         if (!mod_member_present(mod, archdata_end))
   30                 return 0;
   31 
   32         archdata = (struct archdata *)(mod->archdata_start);
   33         if (!mod_archdata_member_present(mod, struct archdata, dbe_table_end))
   34                 return 0;
   35 
   36         if (archdata->dbe_table_start > archdata->dbe_table_end ||
   37             (archdata->dbe_table_start &&
   38              !((unsigned long)archdata->dbe_table_start >=
   39                ((unsigned long)mod + mod->size_of_struct) &&
   40                ((unsigned long)archdata->dbe_table_end <
   41                 (unsigned long)mod + mod->size))) ||
   42             (((unsigned long)archdata->dbe_table_start -
   43               (unsigned long)archdata->dbe_table_end) %
   44              sizeof(struct exception_table_entry))) {
   45                 printk(KERN_ERR
   46                         "module_arch_init: archdata->dbe_table_* invalid.\n");
   47                 return 1;
   48         }
   49 
   50         return 0;
   51 }
   52 
   53 static inline void
   54 mips64_init_modules(struct module *mod)
   55 {
   56         extern const struct exception_table_entry __start___dbe_table[];
   57         extern const struct exception_table_entry __stop___dbe_table[];
   58         static struct archdata archdata = {
   59                 .dbe_table_start        = __start___dbe_table,
   60                 .dbe_table_end          = __stop___dbe_table,
   61         };
   62 
   63         mod->archdata_start = (char *)&archdata;
   64         mod->archdata_end = mod->archdata_start + sizeof(archdata);
   65 }
   66 
   67 #endif /* _ASM_MIPS64_MODULE_H */

Cache object: a6651acc7941bf9a73c79ddb986965cc


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.