Deleted Added
full compact
freebsd32_misc.c (217151) freebsd32_misc.c (220158)
1/*-
2 * Copyright (c) 2002 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 217151 2011-01-08 16:13:44Z kib $");
28__FBSDID("$FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 220158 2011-03-30 14:46:12Z kib $");
29
30#include "opt_compat.h"
31#include "opt_inet.h"
32#include "opt_inet6.h"
33
34#define __ELF_WORD_SIZE 32
35
36#include <sys/param.h>
37#include <sys/bus.h>
38#include <sys/clock.h>
39#include <sys/exec.h>
40#include <sys/fcntl.h>
41#include <sys/filedesc.h>
42#include <sys/imgact.h>
43#include <sys/jail.h>
44#include <sys/kernel.h>
45#include <sys/limits.h>
29
30#include "opt_compat.h"
31#include "opt_inet.h"
32#include "opt_inet6.h"
33
34#define __ELF_WORD_SIZE 32
35
36#include <sys/param.h>
37#include <sys/bus.h>
38#include <sys/clock.h>
39#include <sys/exec.h>
40#include <sys/fcntl.h>
41#include <sys/filedesc.h>
42#include <sys/imgact.h>
43#include <sys/jail.h>
44#include <sys/kernel.h>
45#include <sys/limits.h>
46#include <sys/linker.h>
46#include <sys/lock.h>
47#include <sys/malloc.h>
48#include <sys/file.h> /* Must come after sys/malloc.h */
49#include <sys/imgact.h>
50#include <sys/mbuf.h>
51#include <sys/mman.h>
52#include <sys/module.h>
53#include <sys/mount.h>

--- 2610 unchanged lines hidden (view full) ---

2664 }
2665
2666 /* end of vector table is a null pointer */
2667 suword32(vectp, 0);
2668
2669 return ((register_t *)stack_base);
2670}
2671
47#include <sys/lock.h>
48#include <sys/malloc.h>
49#include <sys/file.h> /* Must come after sys/malloc.h */
50#include <sys/imgact.h>
51#include <sys/mbuf.h>
52#include <sys/mman.h>
53#include <sys/module.h>
54#include <sys/mount.h>

--- 2610 unchanged lines hidden (view full) ---

2665 }
2666
2667 /* end of vector table is a null pointer */
2668 suword32(vectp, 0);
2669
2670 return ((register_t *)stack_base);
2671}
2672
2673int
2674freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap)
2675{
2676 struct kld_file_stat stat;
2677 struct kld32_file_stat stat32;
2678 int error, version;
2679
2680 if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
2681 != 0)
2682 return (error);
2683 if (version != sizeof(struct kld32_file_stat_1) &&
2684 version != sizeof(struct kld32_file_stat))
2685 return (EINVAL);
2686
2687 error = kern_kldstat(td, uap->fileid, &stat);
2688 if (error != 0)
2689 return (error);
2690
2691 bcopy(&stat.name[0], &stat32.name[0], sizeof(stat.name));
2692 CP(stat, stat32, refs);
2693 CP(stat, stat32, id);
2694 PTROUT_CP(stat, stat32, address);
2695 CP(stat, stat32, size);
2696 bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname));
2697 return (copyout(&stat32, uap->stat, version));
2698}