Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00d76710 authored by David Howells's avatar David Howells Committed by Linus Torvalds
Browse files

[PATCH] frv: add module support stubs



Add stubs for FRV module support.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a90a72c8
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -21,3 +21,4 @@ obj-$(CONFIG_PM) += pm.o cmode.o
obj-$(CONFIG_MB93093_PDK)	+= pm-mb93093.o
obj-$(CONFIG_MB93093_PDK)	+= pm-mb93093.o
obj-$(CONFIG_SYSCTL)		+= sysctl.o
obj-$(CONFIG_SYSCTL)		+= sysctl.o
obj-$(CONFIG_FUTEX)		+= futex.o
obj-$(CONFIG_FUTEX)		+= futex.o
obj-$(CONFIG_MODULES)		+= module.o
+80 −0
Original line number Original line Diff line number Diff line
/* module.c: FRV specific module loading bits
 *
 * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
 * Written by David Howells (dhowells@redhat.com)
 * - 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)
{
}
+12 −4
Original line number Original line Diff line number Diff line
@@ -11,10 +11,18 @@
#ifndef _ASM_MODULE_H
#ifndef _ASM_MODULE_H
#define _ASM_MODULE_H
#define _ASM_MODULE_H


#define module_map(x)		vmalloc(x)
struct mod_arch_specific
#define module_unmap(x)		vfree(x)
{
#define module_arch_init(x)	(0)
};
#define arch_init_modules(x)	do { } while (0)

#define Elf_Shdr	Elf32_Shdr
#define Elf_Sym		Elf32_Sym
#define Elf_Ehdr	Elf32_Ehdr

/*
 * Include the architecture version.
 */
#define MODULE_ARCH_VERMAGIC __stringify(PROCESSOR_MODEL_NAME) " "


#endif /* _ASM_MODULE_H */
#endif /* _ASM_MODULE_H */