forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PATCH] frv: add module support stubs
Add stubs for FRV module support. Signed-off-by: David Howells <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information
Showing
3 changed files
with
93 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* module.c: FRV specific module loading bits | ||
* | ||
* Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. | ||
* Written by David Howells ([email protected]) | ||
* - Derived from arch/i386/kernel/module.c, Copyright (C) 2001 Rusty Russell. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version | ||
* 2 of the License, or (at your option) any later version. | ||
*/ | ||
#include <linux/moduleloader.h> | ||
#include <linux/elf.h> | ||
#include <linux/vmalloc.h> | ||
#include <linux/fs.h> | ||
#include <linux/string.h> | ||
#include <linux/kernel.h> | ||
|
||
#if 0 | ||
#define DEBUGP printk | ||
#else | ||
#define DEBUGP(fmt...) | ||
#endif | ||
|
||
void *module_alloc(unsigned long size) | ||
{ | ||
if (size == 0) | ||
return NULL; | ||
|
||
return vmalloc_exec(size); | ||
} | ||
|
||
|
||
/* Free memory returned from module_alloc */ | ||
void module_free(struct module *mod, void *module_region) | ||
{ | ||
vfree(module_region); | ||
/* FIXME: If module_region == mod->init_region, trim exception | ||
table entries. */ | ||
} | ||
|
||
/* We don't need anything special. */ | ||
int module_frob_arch_sections(Elf_Ehdr *hdr, | ||
Elf_Shdr *sechdrs, | ||
char *secstrings, | ||
struct module *mod) | ||
{ | ||
return 0; | ||
} | ||
|
||
int apply_relocate(Elf32_Shdr *sechdrs, | ||
const char *strtab, | ||
unsigned int symindex, | ||
unsigned int relsec, | ||
struct module *me) | ||
{ | ||
printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n", me->name); | ||
return -ENOEXEC; | ||
} | ||
|
||
int apply_relocate_add(Elf32_Shdr *sechdrs, | ||
const char *strtab, | ||
unsigned int symindex, | ||
unsigned int relsec, | ||
struct module *me) | ||
{ | ||
printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n", me->name); | ||
return -ENOEXEC; | ||
} | ||
|
||
int module_finalize(const Elf_Ehdr *hdr, | ||
const Elf_Shdr *sechdrs, | ||
struct module *me) | ||
{ | ||
return 0; | ||
} | ||
|
||
void module_arch_cleanup(struct module *mod) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters