mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-20 11:13:58 +08:00
fab95c55e3
do_longjmp used to be needed when UML didn't have its own implementation of setjmp and longjmp. They came from libc, and couldn't be called directly from kernel code, as the libc jmp_buf couldn't be imported there. do_longjmp was a userspace function which served to provide longjmp access to kernel code. This is gone, and a number of void * pointers can now be jmp_buf *. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
33 lines
694 B
C
33 lines
694 B
C
/*
|
|
* Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk)
|
|
* Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
|
|
* Licensed under the GPL
|
|
*/
|
|
|
|
#include <stddef.h>
|
|
#include "longjmp.h"
|
|
|
|
unsigned long __do_user_copy(void *to, const void *from, int n,
|
|
void **fault_addr, jmp_buf **fault_catcher,
|
|
void (*op)(void *to, const void *from,
|
|
int n), int *faulted_out)
|
|
{
|
|
unsigned long *faddrp = (unsigned long *) fault_addr, ret;
|
|
|
|
jmp_buf jbuf;
|
|
*fault_catcher = &jbuf;
|
|
if(UML_SETJMP(&jbuf) == 0){
|
|
(*op)(to, from, n);
|
|
ret = 0;
|
|
*faulted_out = 0;
|
|
}
|
|
else {
|
|
ret = *faddrp;
|
|
*faulted_out = 1;
|
|
}
|
|
*fault_addr = NULL;
|
|
*fault_catcher = NULL;
|
|
return ret;
|
|
}
|
|
|