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

Commit 5d01e6ce authored by Mikael Starvik's avatar Mikael Starvik Committed by Linus Torvalds
Browse files

[PATCH] CRIS update: updates for 2.6.12



Patches to make CRIS work with 2.6.12.

Signed-off-by: default avatarMikael Starvik <starvik@axis.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent dcf1310b
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#include <linux/ptrace.h>
#include <linux/user.h>
#include <linux/signal.h>
#include <linux/security.h>

#include <asm/uaccess.h>
#include <asm/page.h>
@@ -86,9 +87,13 @@ sys_ptrace(long request, long pid, long addr, long data)
	ret = -EPERM;
	
	if (request == PTRACE_TRACEME) {
		/* are we already being traced? */
		if (current->ptrace & PT_PTRACED)
			goto out;

		ret = security_ptrace(current->parent, current);
		if (ret)
			goto out;
		/* set the ptrace bit in the process flags. */
		current->ptrace |= PT_PTRACED;
		ret = 0;
		goto out;
@@ -207,7 +212,7 @@ sys_ptrace(long request, long pid, long addr, long data)
		case PTRACE_KILL:
			ret = 0;
			
			if (child->state == TASK_ZOMBIE)
			if (child->exit_state == EXIT_ZOMBIE)
				break;
			
			child->exit_code = SIGKILL;
+16 −23
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ void *module_alloc(unsigned long size)
{
	if (size == 0)
		return NULL;
	return vmalloc(size);
	return vmalloc_exec(size);
}


@@ -59,26 +59,8 @@ int apply_relocate(Elf32_Shdr *sechdrs,
		   unsigned int relsec,
		   struct module *me)
{
	unsigned int i;
	Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr;
	Elf32_Sym *sym;
	uint32_t *location;

	DEBUGP("Applying relocate section %u to %u\n", relsec,
	       sechdrs[relsec].sh_info);
	for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
		/* This is where to make the change */
		location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_offset
			+ rel[i].r_offset;
		/* This is the symbol it is referring to.  Note that all
		   undefined symbols have been resolved.  */
		sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
			+ ELF32_R_SYM(rel[i].r_info);

                /* We add the value into the location given */
                *location += sym->st_value;
	}
	return 0;
	printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
	return -ENOEXEC;
}

int apply_relocate_add(Elf32_Shdr *sechdrs,
@@ -90,7 +72,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
  	unsigned int i;
	Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr;

	DEBUGP ("Applying relocate section %u to %u\n", relsec,
	DEBUGP ("Applying add relocate section %u to %u\n", relsec,
		sechdrs[relsec].sh_info);

	for (i = 0; i < sechdrs[relsec].sh_size / sizeof (*rela); i++) {
@@ -103,7 +85,18 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
		Elf32_Sym *sym
			= ((Elf32_Sym *)sechdrs[symindex].sh_addr
			   + ELF32_R_SYM (rela[i].r_info));
		switch (ELF32_R_TYPE(rela[i].r_info)) {
		case R_CRIS_32:
			*loc = sym->st_value + rela[i].r_addend;
			break;
		case R_CRIS_32_PCREL:
			*loc = sym->st_value - (unsigned)loc + rela[i].r_addend - 4;
			 break;
		default:
			printk(KERN_ERR "module %s: Unknown relocation: %u\n",
			       me->name, ELF32_R_TYPE(rela[i].r_info));
			return -ENOEXEC;
		}
	}

	return 0;
+23 −8
Original line number Diff line number Diff line
/* $Id: process.c,v 1.17 2004/04/05 13:53:48 starvik Exp $
/* $Id: process.c,v 1.21 2005/03/04 08:16:17 starvik Exp $
 * 
 *  linux/arch/cris/kernel/process.c
 *
@@ -8,6 +8,18 @@
 *  Authors:   Bjorn Wesen (bjornw@axis.com)
 *
 *  $Log: process.c,v $
 *  Revision 1.21  2005/03/04 08:16:17  starvik
 *  Merge of Linux 2.6.11.
 *
 *  Revision 1.20  2005/01/18 05:57:22  starvik
 *  Renamed hlt_counter to cris_hlt_counter and made it global.
 *
 *  Revision 1.19  2004/10/19 13:07:43  starvik
 *  Merge of Linux 2.6.9
 *
 *  Revision 1.18  2004/08/16 12:37:23  starvik
 *  Merge of Linux 2.6.8
 *
 *  Revision 1.17  2004/04/05 13:53:48  starvik
 *  Merge of Linux 2.6.5
 *
@@ -161,18 +173,18 @@ EXPORT_SYMBOL(init_task);
 * region by enable_hlt/disable_hlt.
 */

static int hlt_counter=0;
int cris_hlt_counter=0;

void disable_hlt(void)
{
	hlt_counter++;
	cris_hlt_counter++;
}

EXPORT_SYMBOL(disable_hlt);

void enable_hlt(void)
{
	hlt_counter--;
	cris_hlt_counter--;
}

EXPORT_SYMBOL(enable_hlt);
@@ -195,16 +207,19 @@ void cpu_idle (void)
	/* endless idle loop with no priority at all */
	while (1) {
		while (!need_resched()) {
			void (*idle)(void) = pm_idle;

			void (*idle)(void);
			/*
			 * Mark this as an RCU critical section so that
			 * synchronize_kernel() in the unload path waits
			 * for our completion.
			 */
			idle = pm_idle;
			if (!idle)
				idle = default_idle;

			idle();
		}
		schedule();
	}

}

void hard_reset_now (void);
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ extern inline unsigned long ffz(unsigned long w)
 *
 * Undefined if no bit exists, so code should check against 0 first.
 */
extern __inline__ unsigned long __ffs(unsigned long word)
extern inline unsigned long __ffs(unsigned long word)
{
	return cris_swapnwbrlz(~word);
}
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
#define THREAD_usp 4 /* offsetof(struct thread_struct, usp) */
#define THREAD_dccr 8 /* offsetof(struct thread_struct, dccr) */

#define TASK_pid 133 /* offsetof(struct task_struct, pid) */
#define TASK_pid 141 /* offsetof(struct task_struct, pid) */

#define LCLONE_VM 256 /* CLONE_VM */
#define LCLONE_UNTRACED 8388608 /* CLONE_UNTRACED */
Loading