DTrace: fix a few problems introduced by the recent ZFS update (expected problems from the OpenSolaris merge).diff -r1.3 -r1.4 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h
(darran)
--- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h 2010/02/27 23:43:52 1.3
+++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h 2010/03/01 11:19:40 1.4
@@ -30,27 +30,26 @@ | @@ -30,27 +30,26 @@ | |||
30 | #include <sys/param.h> | 30 | #include <sys/param.h> | |
31 | #include <sys/objfs.h> | 31 | #include <sys/objfs.h> | |
32 | #if !defined(sun) | 32 | #if !defined(sun) | |
33 | #include <sys/bitmap.h> | 33 | #include <sys/bitmap.h> | |
34 | #include <sys/utsname.h> | 34 | #include <sys/utsname.h> | |
35 | #include <sys/ioccom.h> | 35 | #include <sys/ioccom.h> | |
36 | #include <sys/time.h> | 36 | #include <sys/time.h> | |
37 | #include <string.h> | 37 | #include <string.h> | |
38 | #endif | 38 | #endif | |
39 | #include <setjmp.h> | 39 | #include <setjmp.h> | |
40 | #include <libctf.h> | 40 | #include <libctf.h> | |
41 | #include <dtrace.h> | 41 | #include <dtrace.h> | |
42 | #include <gelf.h> | 42 | #include <gelf.h> | |
43 | #include <synch.h> | |||
44 | 43 | |||
45 | #ifdef __cplusplus | 44 | #ifdef __cplusplus | |
46 | extern "C" { | 45 | extern "C" { | |
47 | #endif | 46 | #endif | |
48 | 47 | |||
49 | #include <dt_parser.h> | 48 | #include <dt_parser.h> | |
50 | #include <dt_regset.h> | 49 | #include <dt_regset.h> | |
51 | #include <dt_inttab.h> | 50 | #include <dt_inttab.h> | |
52 | #include <dt_strtab.h> | 51 | #include <dt_strtab.h> | |
53 | #include <dt_ident.h> | 52 | #include <dt_ident.h> | |
54 | #include <dt_list.h> | 53 | #include <dt_list.h> | |
55 | #include <dt_decl.h> | 54 | #include <dt_decl.h> | |
56 | #include <dt_as.h> | 55 | #include <dt_as.h> | |
@@ -590,26 +589,39 @@ extern int dt_gmatch(const char *, const | @@ -590,26 +589,39 @@ extern int dt_gmatch(const char *, const | |||
590 | extern char *dt_basename(char *); | 589 | extern char *dt_basename(char *); | |
591 | 590 | |||
592 | extern ulong_t dt_popc(ulong_t); | 591 | extern ulong_t dt_popc(ulong_t); | |
593 | extern ulong_t dt_popcb(const ulong_t *, ulong_t); | 592 | extern ulong_t dt_popcb(const ulong_t *, ulong_t); | |
594 | 593 | |||
595 | extern int dt_buffered_enable(dtrace_hdl_t *); | 594 | extern int dt_buffered_enable(dtrace_hdl_t *); | |
596 | extern int dt_buffered_flush(dtrace_hdl_t *, dtrace_probedata_t *, | 595 | extern int dt_buffered_flush(dtrace_hdl_t *, dtrace_probedata_t *, | |
597 | const dtrace_recdesc_t *, const dtrace_aggdata_t *, uint32_t flags); | 596 | const dtrace_recdesc_t *, const dtrace_aggdata_t *, uint32_t flags); | |
598 | extern void dt_buffered_disable(dtrace_hdl_t *); | 597 | extern void dt_buffered_disable(dtrace_hdl_t *); | |
599 | extern void dt_buffered_destroy(dtrace_hdl_t *); | 598 | extern void dt_buffered_destroy(dtrace_hdl_t *); | |
600 | 599 | |||
601 | extern uint64_t dt_stddev(uint64_t *, uint64_t); | 600 | extern uint64_t dt_stddev(uint64_t *, uint64_t); | |
602 | 601 | |||
602 | #define DT_MUTEX_HELD(x) dt_mutex_held(x) | |||
603 | ||||
604 | static inline int | |||
605 | dt_mutex_held(pthread_mutex_t *lock) | |||
606 | { | |||
607 | #if defined(sun) | |||
608 | extern int _mutex_held(struct _lwp_mutex *); | |||
609 | return (_mutex_held((struct _lwp_mutex *)lock)); | |||
610 | #else | |||
611 | return (1); | |||
612 | #endif | |||
613 | } | |||
614 | ||||
603 | extern int dt_options_load(dtrace_hdl_t *); | 615 | extern int dt_options_load(dtrace_hdl_t *); | |
604 | 616 | |||
605 | extern void dt_dprintf(const char *, ...); | 617 | extern void dt_dprintf(const char *, ...); | |
606 | 618 | |||
607 | extern void dt_setcontext(dtrace_hdl_t *, dtrace_probedesc_t *); | 619 | extern void dt_setcontext(dtrace_hdl_t *, dtrace_probedesc_t *); | |
608 | extern void dt_endcontext(dtrace_hdl_t *); | 620 | extern void dt_endcontext(dtrace_hdl_t *); | |
609 | 621 | |||
610 | extern void dt_pragma(dt_node_t *); | 622 | extern void dt_pragma(dt_node_t *); | |
611 | extern int dt_reduce(dtrace_hdl_t *, dt_version_t); | 623 | extern int dt_reduce(dtrace_hdl_t *, dt_version_t); | |
612 | extern void dt_cg(dt_pcb_t *, dt_node_t *); | 624 | extern void dt_cg(dt_pcb_t *, dt_node_t *); | |
613 | extern dtrace_difo_t *dt_as(dt_pcb_t *); | 625 | extern dtrace_difo_t *dt_as(dt_pcb_t *); | |
614 | extern void dt_dis(const dtrace_difo_t *, FILE *); | 626 | extern void dt_dis(const dtrace_difo_t *, FILE *); | |
615 | 627 |
--- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c 2010/02/27 23:43:52 1.4
+++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c 2010/03/01 11:19:40 1.5
@@ -13,26 +13,30 @@ | @@ -13,26 +13,30 @@ | |||
13 | * When distributing Covered Code, include this CDDL HEADER in each | 13 | * When distributing Covered Code, include this CDDL HEADER in each | |
14 | * file and include the License file at usr/src/OPENSOLARIS.LICENSE. | 14 | * file and include the License file at usr/src/OPENSOLARIS.LICENSE. | |
15 | * If applicable, add the following below this CDDL HEADER, with the | 15 | * If applicable, add the following below this CDDL HEADER, with the | |
16 | * fields enclosed by brackets "[]" replaced with your own identifying | 16 | * fields enclosed by brackets "[]" replaced with your own identifying | |
17 | * information: Portions Copyright [yyyy] [name of copyright owner] | 17 | * information: Portions Copyright [yyyy] [name of copyright owner] | |
18 | * | 18 | * | |
19 | * CDDL HEADER END | 19 | * CDDL HEADER END | |
20 | */ | 20 | */ | |
21 | /* | 21 | /* | |
22 | * Copyright 2009 Sun Microsystems, Inc. All rights reserved. | 22 | * Copyright 2009 Sun Microsystems, Inc. All rights reserved. | |
23 | * Use is subject to license terms. | 23 | * Use is subject to license terms. | |
24 | */ | 24 | */ | |
25 | 25 | |||
26 | #ifndef ELFSIZE | |||
27 | #define ELFSIZE ARCH_ELFSIZE | |||
28 | #endif | |||
29 | ||||
26 | #include <sys/types.h> | 30 | #include <sys/types.h> | |
27 | #if defined(sun) | 31 | #if defined(sun) | |
28 | #include <sys/modctl.h> | 32 | #include <sys/modctl.h> | |
29 | #include <sys/kobj.h> | 33 | #include <sys/kobj.h> | |
30 | #include <sys/kobj_impl.h> | 34 | #include <sys/kobj_impl.h> | |
31 | #include <sys/sysmacros.h> | 35 | #include <sys/sysmacros.h> | |
32 | #include <sys/elf.h> | 36 | #include <sys/elf.h> | |
33 | #include <sys/task.h> | 37 | #include <sys/task.h> | |
34 | #else | 38 | #else | |
35 | #include <sys/param.h> | 39 | #include <sys/param.h> | |
36 | #include <sys/linker.h> | 40 | #include <sys/linker.h> | |
37 | #include <sys/stat.h> | 41 | #include <sys/stat.h> | |
38 | #include <sys/sysctl.h> | 42 | #include <sys/sysctl.h> | |
@@ -69,27 +73,27 @@ dt_module_symhash_insert(dt_module_t *dm | @@ -69,27 +73,27 @@ dt_module_symhash_insert(dt_module_t *dm | |||
69 | 73 | |||
70 | dsp->ds_symid = id; | 74 | dsp->ds_symid = id; | |
71 | h = dt_strtab_hash(name, NULL) % dmp->dm_nsymbuckets; | 75 | h = dt_strtab_hash(name, NULL) % dmp->dm_nsymbuckets; | |
72 | dsp->ds_next = dmp->dm_symbuckets[h]; | 76 | dsp->ds_next = dmp->dm_symbuckets[h]; | |
73 | dmp->dm_symbuckets[h] = dmp->dm_symfree++; | 77 | dmp->dm_symbuckets[h] = dmp->dm_symfree++; | |
74 | } | 78 | } | |
75 | 79 | |||
76 | static uint_t | 80 | static uint_t | |
77 | dt_module_syminit32(dt_module_t *dmp) | 81 | dt_module_syminit32(dt_module_t *dmp) | |
78 | { | 82 | { | |
79 | #if STT_NUM != (STT_TLS + 1) | 83 | #if STT_NUM != (STT_TLS + 1) | |
80 | #error "STT_NUM has grown. update dt_module_syminit32()" | 84 | #error "STT_NUM has grown. update dt_module_syminit32()" | |
81 | #endif | 85 | #endif | |
82 | const Elf32_Sym *sym = dmp->dm_symtab.cts_data; | 86 | Elf32_Sym *sym = dmp->dm_symtab.cts_data; | |
83 | const char *base = dmp->dm_strtab.cts_data; | 87 | const char *base = dmp->dm_strtab.cts_data; | |
84 | size_t ss_size = dmp->dm_strtab.cts_size; | 88 | size_t ss_size = dmp->dm_strtab.cts_size; | |
85 | uint_t i, n = dmp->dm_nsymelems; | 89 | uint_t i, n = dmp->dm_nsymelems; | |
86 | uint_t asrsv = 0; | 90 | uint_t asrsv = 0; | |
87 | 91 | |||
88 | for (i = 0; i < n; i++, sym++) { | 92 | for (i = 0; i < n; i++, sym++) { | |
89 | const char *name = base + sym->st_name; | 93 | const char *name = base + sym->st_name; | |
90 | uchar_t type = ELF32_ST_TYPE(sym->st_info); | 94 | uchar_t type = ELF32_ST_TYPE(sym->st_info); | |
91 | 95 | |||
92 | if (type >= STT_NUM || type == STT_SECTION) | 96 | if (type >= STT_NUM || type == STT_SECTION) | |
93 | continue; /* skip sections and unknown types */ | 97 | continue; /* skip sections and unknown types */ | |
94 | 98 | |||
95 | if (sym->st_name == 0 || sym->st_name >= ss_size) | 99 | if (sym->st_name == 0 || sym->st_name >= ss_size) | |
@@ -106,27 +110,27 @@ dt_module_syminit32(dt_module_t *dmp) | @@ -106,27 +110,27 @@ dt_module_syminit32(dt_module_t *dmp) | |||
106 | 110 | |||
107 | dt_module_symhash_insert(dmp, name, i); | 111 | dt_module_symhash_insert(dmp, name, i); | |
108 | } | 112 | } | |
109 | 113 | |||
110 | return (asrsv); | 114 | return (asrsv); | |
111 | } | 115 | } | |
112 | 116 | |||
113 | static uint_t | 117 | static uint_t | |
114 | dt_module_syminit64(dt_module_t *dmp) | 118 | dt_module_syminit64(dt_module_t *dmp) | |
115 | { | 119 | { | |
116 | #if STT_NUM != (STT_TLS + 1) | 120 | #if STT_NUM != (STT_TLS + 1) | |
117 | #error "STT_NUM has grown. update dt_module_syminit64()" | 121 | #error "STT_NUM has grown. update dt_module_syminit64()" | |
118 | #endif | 122 | #endif | |
119 | const Elf64_Sym *sym = dmp->dm_symtab.cts_data; | 123 | Elf64_Sym *sym = dmp->dm_symtab.cts_data; | |
120 | const char *base = dmp->dm_strtab.cts_data; | 124 | const char *base = dmp->dm_strtab.cts_data; | |
121 | size_t ss_size = dmp->dm_strtab.cts_size; | 125 | size_t ss_size = dmp->dm_strtab.cts_size; | |
122 | uint_t i, n = dmp->dm_nsymelems; | 126 | uint_t i, n = dmp->dm_nsymelems; | |
123 | uint_t asrsv = 0; | 127 | uint_t asrsv = 0; | |
124 | 128 | |||
125 | for (i = 0; i < n; i++, sym++) { | 129 | for (i = 0; i < n; i++, sym++) { | |
126 | const char *name = base + sym->st_name; | 130 | const char *name = base + sym->st_name; | |
127 | uchar_t type = ELF64_ST_TYPE(sym->st_info); | 131 | uchar_t type = ELF64_ST_TYPE(sym->st_info); | |
128 | 132 | |||
129 | if (type >= STT_NUM || type == STT_SECTION) | 133 | if (type >= STT_NUM || type == STT_SECTION) | |
130 | continue; /* skip sections and unknown types */ | 134 | continue; /* skip sections and unknown types */ | |
131 | 135 | |||
132 | if (sym->st_name == 0 || sym->st_name >= ss_size) | 136 | if (sym->st_name == 0 || sym->st_name >= ss_size) | |
@@ -484,27 +488,27 @@ dt_module_lookup_by_ctf(dtrace_hdl_t *dt | @@ -484,27 +488,27 @@ dt_module_lookup_by_ctf(dtrace_hdl_t *dt | |||
484 | { | 488 | { | |
485 | return (ctfp ? ctf_getspecific(ctfp) : NULL); | 489 | return (ctfp ? ctf_getspecific(ctfp) : NULL); | |
486 | } | 490 | } | |
487 | 491 | |||
488 | static int | 492 | static int | |
489 | dt_module_load_sect(dtrace_hdl_t *dtp, dt_module_t *dmp, ctf_sect_t *ctsp) | 493 | dt_module_load_sect(dtrace_hdl_t *dtp, dt_module_t *dmp, ctf_sect_t *ctsp) | |
490 | { | 494 | { | |
491 | const char *s; | 495 | const char *s; | |
492 | size_t shstrs; | 496 | size_t shstrs; | |
493 | GElf_Shdr sh; | 497 | GElf_Shdr sh; | |
494 | Elf_Data *dp; | 498 | Elf_Data *dp; | |
495 | Elf_Scn *sp; | 499 | Elf_Scn *sp; | |
496 | 500 | |||
497 | if (elf_getshdrstrndx(dmp->dm_elf, &shstrs) == -1) | 501 | if (elf_getshstrndx(dmp->dm_elf, &shstrs) == 0) | |
498 | return (dt_set_errno(dtp, EDT_NOTLOADED)); | 502 | return (dt_set_errno(dtp, EDT_NOTLOADED)); | |
499 | 503 | |||
500 | for (sp = NULL; (sp = elf_nextscn(dmp->dm_elf, sp)) != NULL; ) { | 504 | for (sp = NULL; (sp = elf_nextscn(dmp->dm_elf, sp)) != NULL; ) { | |
501 | if (gelf_getshdr(sp, &sh) == NULL || sh.sh_type == SHT_NULL || | 505 | if (gelf_getshdr(sp, &sh) == NULL || sh.sh_type == SHT_NULL || | |
502 | (s = elf_strptr(dmp->dm_elf, shstrs, sh.sh_name)) == NULL) | 506 | (s = elf_strptr(dmp->dm_elf, shstrs, sh.sh_name)) == NULL) | |
503 | continue; /* skip any malformed sections */ | 507 | continue; /* skip any malformed sections */ | |
504 | 508 | |||
505 | if (sh.sh_type == ctsp->cts_type && | 509 | if (sh.sh_type == ctsp->cts_type && | |
506 | sh.sh_entsize == ctsp->cts_entsize && | 510 | sh.sh_entsize == ctsp->cts_entsize && | |
507 | strcmp(s, ctsp->cts_name) == 0) | 511 | strcmp(s, ctsp->cts_name) == 0) | |
508 | break; /* section matches specification */ | 512 | break; /* section matches specification */ | |
509 | } | 513 | } | |
510 | 514 | |||
@@ -890,27 +894,27 @@ dt_module_update(dtrace_hdl_t *dtp, cons | @@ -890,27 +894,27 @@ dt_module_update(dtrace_hdl_t *dtp, cons | |||
890 | } | 894 | } | |
891 | 895 | |||
892 | /* | 896 | /* | |
893 | * Since the module can unload out from under us (and /system/object | 897 | * Since the module can unload out from under us (and /system/object | |
894 | * will return ENOENT), tell libelf to cook the entire file now and | 898 | * will return ENOENT), tell libelf to cook the entire file now and | |
895 | * then close the underlying file descriptor immediately. If this | 899 | * then close the underlying file descriptor immediately. If this | |
896 | * succeeds, we know that we can continue safely using dmp->dm_elf. | 900 | * succeeds, we know that we can continue safely using dmp->dm_elf. | |
897 | */ | 901 | */ | |
898 | dmp->dm_elf = elf_begin(fd, ELF_C_READ, NULL); | 902 | dmp->dm_elf = elf_begin(fd, ELF_C_READ, NULL); | |
899 | err = elf_cntl(dmp->dm_elf, ELF_C_FDREAD); | 903 | err = elf_cntl(dmp->dm_elf, ELF_C_FDREAD); | |
900 | (void) close(fd); | 904 | (void) close(fd); | |
901 | 905 | |||
902 | if (dmp->dm_elf == NULL || err == -1 || | 906 | if (dmp->dm_elf == NULL || err == -1 || | |
903 | elf_getshdrstrndx(dmp->dm_elf, &shstrs) == -1) { | 907 | elf_getshstrndx(dmp->dm_elf, &shstrs) == 0) { | |
904 | dt_dprintf("failed to load %s: %s\n", | 908 | dt_dprintf("failed to load %s: %s\n", | |
905 | fname, elf_errmsg(elf_errno())); | 909 | fname, elf_errmsg(elf_errno())); | |
906 | dt_module_destroy(dtp, dmp); | 910 | dt_module_destroy(dtp, dmp); | |
907 | return; | 911 | return; | |
908 | } | 912 | } | |
909 | 913 | |||
910 | switch (gelf_getclass(dmp->dm_elf)) { | 914 | switch (gelf_getclass(dmp->dm_elf)) { | |
911 | case ELFCLASS32: | 915 | case ELFCLASS32: | |
912 | dmp->dm_ops = &dt_modops_32; | 916 | dmp->dm_ops = &dt_modops_32; | |
913 | bits = 32; | 917 | bits = 32; | |
914 | break; | 918 | break; | |
915 | case ELFCLASS64: | 919 | case ELFCLASS64: | |
916 | dmp->dm_ops = &dt_modops_64; | 920 | dmp->dm_ops = &dt_modops_64; |
--- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pid.c 2010/02/27 23:43:52 1.4
+++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pid.c 2010/03/01 11:19:41 1.5
@@ -684,27 +684,27 @@ dt_pid_usdt_mapping(void *data, const pr | @@ -684,27 +684,27 @@ dt_pid_usdt_mapping(void *data, const pr | |||
684 | printf("XXX %s not implemented\n", __func__); | 684 | printf("XXX %s not implemented\n", __func__); | |
685 | return ENODEV; | 685 | return ENODEV; | |
686 | #endif | 686 | #endif | |
687 | } | 687 | } | |
688 | 688 | |||
689 | static int | 689 | static int | |
690 | dt_pid_create_usdt_probes(dtrace_probedesc_t *pdp, dtrace_hdl_t *dtp, | 690 | dt_pid_create_usdt_probes(dtrace_probedesc_t *pdp, dtrace_hdl_t *dtp, | |
691 | dt_pcb_t *pcb, dt_proc_t *dpr) | 691 | dt_pcb_t *pcb, dt_proc_t *dpr) | |
692 | { | 692 | { | |
693 | #if 0 /* XXX TBD needs libproc */ | 693 | #if 0 /* XXX TBD needs libproc */ | |
694 | struct ps_prochandle *P = dpr->dpr_proc; | 694 | struct ps_prochandle *P = dpr->dpr_proc; | |
695 | int ret = 0; | 695 | int ret = 0; | |
696 | 696 | |||
697 | assert(MUTEX_HELD(&dpr->dpr_lock)); | 697 | assert(DT_MUTEX_HELD(&dpr->dpr_lock)); | |
698 | 698 | |||
699 | #ifdef DOODAD | 699 | #ifdef DOODAD | |
700 | (void) Pupdate_maps(P); | 700 | (void) Pupdate_maps(P); | |
701 | if (Pobject_iter(P, dt_pid_usdt_mapping, P) != 0) { | 701 | if (Pobject_iter(P, dt_pid_usdt_mapping, P) != 0) { | |
702 | ret = -1; | 702 | ret = -1; | |
703 | (void) dt_pid_error(dtp, pcb, dpr, NULL, D_PROC_USDT, | 703 | (void) dt_pid_error(dtp, pcb, dpr, NULL, D_PROC_USDT, | |
704 | "failed to instantiate probes for pid %d: %s", | 704 | "failed to instantiate probes for pid %d: %s", | |
705 | #if defined(sun) | 705 | #if defined(sun) | |
706 | (int)Pstatus(P)->pr_pid, strerror(errno)); | 706 | (int)Pstatus(P)->pr_pid, strerror(errno)); | |
707 | #else | 707 | #else | |
708 | (int)proc_getpid(P), strerror(errno)); | 708 | (int)proc_getpid(P), strerror(errno)); | |
709 | #endif | 709 | #endif | |
710 | } | 710 | } |
--- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_proc.c 2010/02/27 23:43:52 1.4
+++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_proc.c 2010/03/01 11:19:41 1.5
@@ -173,125 +173,125 @@ proc_continue(struct proc_handle *phdl) | @@ -173,125 +173,125 @@ proc_continue(struct proc_handle *phdl) | |||
173 | } | 173 | } | |
174 | 174 | |||
175 | #define IS_SYS_EXEC(w) (w == SYS_exec || w == SYS_execve) | 175 | #define IS_SYS_EXEC(w) (w == SYS_exec || w == SYS_execve) | |
176 | #define IS_SYS_FORK(w) (w == SYS_vfork || w == SYS_fork1 || \ | 176 | #define IS_SYS_FORK(w) (w == SYS_vfork || w == SYS_fork1 || \ | |
177 | w == SYS_forkall || w == SYS_forksys) | 177 | w == SYS_forkall || w == SYS_forksys) | |
178 | 178 | |||
179 | #ifdef DOODAD | 179 | #ifdef DOODAD | |
180 | static dt_bkpt_t * | 180 | static dt_bkpt_t * | |
181 | dt_proc_bpcreate(dt_proc_t *dpr, uintptr_t addr, dt_bkpt_f *func, void *data) | 181 | dt_proc_bpcreate(dt_proc_t *dpr, uintptr_t addr, dt_bkpt_f *func, void *data) | |
182 | { | 182 | { | |
183 | struct ps_prochandle *P = dpr->dpr_proc; | 183 | struct ps_prochandle *P = dpr->dpr_proc; | |
184 | dt_bkpt_t *dbp; | 184 | dt_bkpt_t *dbp; | |
185 | 185 | |||
186 | assert(MUTEX_HELD(&dpr->dpr_lock)); | 186 | assert(DT_MUTEX_HELD(&dpr->dpr_lock)); | |
187 | 187 | |||
188 | if ((dbp = dt_zalloc(dpr->dpr_hdl, sizeof (dt_bkpt_t))) != NULL) { | 188 | if ((dbp = dt_zalloc(dpr->dpr_hdl, sizeof (dt_bkpt_t))) != NULL) { | |
189 | dbp->dbp_func = func; | 189 | dbp->dbp_func = func; | |
190 | dbp->dbp_data = data; | 190 | dbp->dbp_data = data; | |
191 | dbp->dbp_addr = addr; | 191 | dbp->dbp_addr = addr; | |
192 | 192 | |||
193 | if (Psetbkpt(P, dbp->dbp_addr, &dbp->dbp_instr) == 0) | 193 | if (Psetbkpt(P, dbp->dbp_addr, &dbp->dbp_instr) == 0) | |
194 | dbp->dbp_active = B_TRUE; | 194 | dbp->dbp_active = B_TRUE; | |
195 | 195 | |||
196 | dt_list_append(&dpr->dpr_bps, dbp); | 196 | dt_list_append(&dpr->dpr_bps, dbp); | |
197 | } | 197 | } | |
198 | 198 | |||
199 | return (dbp); | 199 | return (dbp); | |
200 | } | 200 | } | |
201 | #endif | 201 | #endif | |
202 | 202 | |||
203 | static void | 203 | static void | |
204 | dt_proc_bpdestroy(dt_proc_t *dpr, int delbkpts) | 204 | dt_proc_bpdestroy(dt_proc_t *dpr, int delbkpts) | |
205 | { | 205 | { | |
206 | #if defined(sun) | 206 | #if defined(sun) | |
207 | int state = Pstate(dpr->dpr_proc); | 207 | int state = Pstate(dpr->dpr_proc); | |
208 | #else | 208 | #else | |
209 | int state = proc_state(dpr->dpr_proc); | 209 | int state = proc_state(dpr->dpr_proc); | |
210 | #endif | 210 | #endif | |
211 | dt_bkpt_t *dbp, *nbp; | 211 | dt_bkpt_t *dbp, *nbp; | |
212 | 212 | |||
213 | assert(MUTEX_HELD(&dpr->dpr_lock)); | 213 | assert(DT_MUTEX_HELD(&dpr->dpr_lock)); | |
214 | 214 | |||
215 | for (dbp = dt_list_next(&dpr->dpr_bps); dbp != NULL; dbp = nbp) { | 215 | for (dbp = dt_list_next(&dpr->dpr_bps); dbp != NULL; dbp = nbp) { | |
216 | printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); | 216 | printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); | |
217 | #ifdef DOODAD | 217 | #ifdef DOODAD | |
218 | if (delbkpts && dbp->dbp_active && | 218 | if (delbkpts && dbp->dbp_active && | |
219 | state != PS_LOST && state != PS_UNDEAD) { | 219 | state != PS_LOST && state != PS_UNDEAD) { | |
220 | (void) Pdelbkpt(dpr->dpr_proc, | 220 | (void) Pdelbkpt(dpr->dpr_proc, | |
221 | dbp->dbp_addr, dbp->dbp_instr); | 221 | dbp->dbp_addr, dbp->dbp_instr); | |
222 | } | 222 | } | |
223 | #endif | 223 | #endif | |
224 | nbp = dt_list_next(dbp); | 224 | nbp = dt_list_next(dbp); | |
225 | dt_list_delete(&dpr->dpr_bps, dbp); | 225 | dt_list_delete(&dpr->dpr_bps, dbp); | |
226 | dt_free(dpr->dpr_hdl, dbp); | 226 | dt_free(dpr->dpr_hdl, dbp); | |
227 | } | 227 | } | |
228 | } | 228 | } | |
229 | 229 | |||
230 | #ifdef DOODAD | 230 | #ifdef DOODAD | |
231 | static void | 231 | static void | |
232 | dt_proc_bpmatch(dtrace_hdl_t *dtp, dt_proc_t *dpr) | 232 | dt_proc_bpmatch(dtrace_hdl_t *dtp, dt_proc_t *dpr) | |
233 | { | 233 | { | |
234 | const lwpstatus_t *psp = &Pstatus(dpr->dpr_proc)->pr_lwp; | 234 | const lwpstatus_t *psp = &Pstatus(dpr->dpr_proc)->pr_lwp; | |
235 | dt_bkpt_t *dbp; | 235 | dt_bkpt_t *dbp; | |
236 | 236 | |||
237 | assert(MUTEX_HELD(&dpr->dpr_lock)); | 237 | assert(DT_MUTEX_HELD(&dpr->dpr_lock)); | |
238 | 238 | |||
239 | for (dbp = dt_list_next(&dpr->dpr_bps); | 239 | for (dbp = dt_list_next(&dpr->dpr_bps); | |
240 | dbp != NULL; dbp = dt_list_next(dbp)) { | 240 | dbp != NULL; dbp = dt_list_next(dbp)) { | |
241 | if (psp->pr_reg[R_PC] == dbp->dbp_addr) | 241 | if (psp->pr_reg[R_PC] == dbp->dbp_addr) | |
242 | break; | 242 | break; | |
243 | } | 243 | } | |
244 | 244 | |||
245 | if (dbp == NULL) { | 245 | if (dbp == NULL) { | |
246 | dt_dprintf("pid %d: spurious breakpoint wakeup for %lx\n", | 246 | dt_dprintf("pid %d: spurious breakpoint wakeup for %lx\n", | |
247 | (int)dpr->dpr_pid, (ulong_t)psp->pr_reg[R_PC]); | 247 | (int)dpr->dpr_pid, (ulong_t)psp->pr_reg[R_PC]); | |
248 | return; | 248 | return; | |
249 | } | 249 | } | |
250 | 250 | |||
251 | dt_dprintf("pid %d: hit breakpoint at %lx (%lu)\n", | 251 | dt_dprintf("pid %d: hit breakpoint at %lx (%lu)\n", | |
252 | (int)dpr->dpr_pid, (ulong_t)dbp->dbp_addr, ++dbp->dbp_hits); | 252 | (int)dpr->dpr_pid, (ulong_t)dbp->dbp_addr, ++dbp->dbp_hits); | |
253 | 253 | |||
254 | dbp->dbp_func(dtp, dpr, dbp->dbp_data); | 254 | dbp->dbp_func(dtp, dpr, dbp->dbp_data); | |
255 | (void) Pxecbkpt(dpr->dpr_proc, dbp->dbp_instr); | 255 | (void) Pxecbkpt(dpr->dpr_proc, dbp->dbp_instr); | |
256 | } | 256 | } | |
257 | #endif | 257 | #endif | |
258 | 258 | |||
259 | static void | 259 | static void | |
260 | dt_proc_bpenable(dt_proc_t *dpr) | 260 | dt_proc_bpenable(dt_proc_t *dpr) | |
261 | { | 261 | { | |
262 | dt_bkpt_t *dbp; | 262 | dt_bkpt_t *dbp; | |
263 | 263 | |||
264 | assert(MUTEX_HELD(&dpr->dpr_lock)); | 264 | assert(DT_MUTEX_HELD(&dpr->dpr_lock)); | |
265 | 265 | |||
266 | for (dbp = dt_list_next(&dpr->dpr_bps); | 266 | for (dbp = dt_list_next(&dpr->dpr_bps); | |
267 | dbp != NULL; dbp = dt_list_next(dbp)) { | 267 | dbp != NULL; dbp = dt_list_next(dbp)) { | |
268 | printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); | 268 | printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); | |
269 | #ifdef DOODAD | 269 | #ifdef DOODAD | |
270 | if (!dbp->dbp_active && Psetbkpt(dpr->dpr_proc, | 270 | if (!dbp->dbp_active && Psetbkpt(dpr->dpr_proc, | |
271 | dbp->dbp_addr, &dbp->dbp_instr) == 0) | 271 | dbp->dbp_addr, &dbp->dbp_instr) == 0) | |
272 | dbp->dbp_active = B_TRUE; | 272 | dbp->dbp_active = B_TRUE; | |
273 | #endif | 273 | #endif | |
274 | } | 274 | } | |
275 | 275 | |||
276 | dt_dprintf("breakpoints enabled\n"); | 276 | dt_dprintf("breakpoints enabled\n"); | |
277 | } | 277 | } | |
278 | 278 | |||
279 | static void | 279 | static void | |
280 | dt_proc_bpdisable(dt_proc_t *dpr) | 280 | dt_proc_bpdisable(dt_proc_t *dpr) | |
281 | { | 281 | { | |
282 | dt_bkpt_t *dbp; | 282 | dt_bkpt_t *dbp; | |
283 | 283 | |||
284 | assert(MUTEX_HELD(&dpr->dpr_lock)); | 284 | assert(DT_MUTEX_HELD(&dpr->dpr_lock)); | |
285 | 285 | |||
286 | for (dbp = dt_list_next(&dpr->dpr_bps); | 286 | for (dbp = dt_list_next(&dpr->dpr_bps); | |
287 | dbp != NULL; dbp = dt_list_next(dbp)) { | 287 | dbp != NULL; dbp = dt_list_next(dbp)) { | |
288 | printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); | 288 | printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); | |
289 | #ifdef DOODAD | 289 | #ifdef DOODAD | |
290 | if (dbp->dbp_active && Pdelbkpt(dpr->dpr_proc, | 290 | if (dbp->dbp_active && Pdelbkpt(dpr->dpr_proc, | |
291 | dbp->dbp_addr, dbp->dbp_instr) == 0) | 291 | dbp->dbp_addr, dbp->dbp_instr) == 0) | |
292 | dbp->dbp_active = B_FALSE; | 292 | dbp->dbp_active = B_FALSE; | |
293 | #endif | 293 | #endif | |
294 | } | 294 | } | |
295 | 295 | |||
296 | dt_dprintf("breakpoints disabled\n"); | 296 | dt_dprintf("breakpoints disabled\n"); | |
297 | } | 297 | } | |
@@ -322,27 +322,27 @@ dt_proc_notify(dtrace_hdl_t *dtp, dt_pro | @@ -322,27 +322,27 @@ dt_proc_notify(dtrace_hdl_t *dtp, dt_pro | |||
322 | (void) pthread_mutex_unlock(&dph->dph_lock); | 322 | (void) pthread_mutex_unlock(&dph->dph_lock); | |
323 | } | 323 | } | |
324 | } | 324 | } | |
325 | 325 | |||
326 | /* | 326 | /* | |
327 | * Check to see if the control thread was requested to stop when the victim | 327 | * Check to see if the control thread was requested to stop when the victim | |
328 | * process reached a particular event (why) rather than continuing the victim. | 328 | * process reached a particular event (why) rather than continuing the victim. | |
329 | * If 'why' is set in the stop mask, we wait on dpr_cv for dt_proc_continue(). | 329 | * If 'why' is set in the stop mask, we wait on dpr_cv for dt_proc_continue(). | |
330 | * If 'why' is not set, this function returns immediately and does nothing. | 330 | * If 'why' is not set, this function returns immediately and does nothing. | |
331 | */ | 331 | */ | |
332 | static void | 332 | static void | |
333 | dt_proc_stop(dt_proc_t *dpr, uint8_t why) | 333 | dt_proc_stop(dt_proc_t *dpr, uint8_t why) | |
334 | { | 334 | { | |
335 | assert(MUTEX_HELD(&dpr->dpr_lock)); | 335 | assert(DT_MUTEX_HELD(&dpr->dpr_lock)); | |
336 | assert(why != DT_PROC_STOP_IDLE); | 336 | assert(why != DT_PROC_STOP_IDLE); | |
337 | 337 | |||
338 | if (dpr->dpr_stop & why) { | 338 | if (dpr->dpr_stop & why) { | |
339 | dpr->dpr_stop |= DT_PROC_STOP_IDLE; | 339 | dpr->dpr_stop |= DT_PROC_STOP_IDLE; | |
340 | dpr->dpr_stop &= ~why; | 340 | dpr->dpr_stop &= ~why; | |
341 | 341 | |||
342 | (void) pthread_cond_broadcast(&dpr->dpr_cv); | 342 | (void) pthread_cond_broadcast(&dpr->dpr_cv); | |
343 | 343 | |||
344 | /* | 344 | /* | |
345 | * We disable breakpoints while stopped to preserve the | 345 | * We disable breakpoints while stopped to preserve the | |
346 | * integrity of the program text for both our own disassembly | 346 | * integrity of the program text for both our own disassembly | |
347 | * and that of the kernel. | 347 | * and that of the kernel. | |
348 | */ | 348 | */ | |
@@ -424,27 +424,27 @@ dt_proc_rdwatch(dt_proc_t *dpr, rd_event | @@ -424,27 +424,27 @@ dt_proc_rdwatch(dt_proc_t *dpr, rd_event | |||
424 | } | 424 | } | |
425 | 425 | |||
426 | /* | 426 | /* | |
427 | * Common code for enabling events associated with the run-time linker after | 427 | * Common code for enabling events associated with the run-time linker after | |
428 | * attaching to a process or after a victim process completes an exec(2). | 428 | * attaching to a process or after a victim process completes an exec(2). | |
429 | */ | 429 | */ | |
430 | static void | 430 | static void | |
431 | dt_proc_attach(dt_proc_t *dpr, int exec) | 431 | dt_proc_attach(dt_proc_t *dpr, int exec) | |
432 | { | 432 | { | |
433 | const pstatus_t *psp = Pstatus(dpr->dpr_proc); | 433 | const pstatus_t *psp = Pstatus(dpr->dpr_proc); | |
434 | rd_err_e err; | 434 | rd_err_e err; | |
435 | GElf_Sym sym; | 435 | GElf_Sym sym; | |
436 | 436 | |||
437 | assert(MUTEX_HELD(&dpr->dpr_lock)); | 437 | assert(DT_MUTEX_HELD(&dpr->dpr_lock)); | |
438 | 438 | |||
439 | if (exec) { | 439 | if (exec) { | |
440 | if (psp->pr_lwp.pr_errno != 0) | 440 | if (psp->pr_lwp.pr_errno != 0) | |
441 | return; /* exec failed: nothing needs to be done */ | 441 | return; /* exec failed: nothing needs to be done */ | |
442 | 442 | |||
443 | dt_proc_bpdestroy(dpr, B_FALSE); | 443 | dt_proc_bpdestroy(dpr, B_FALSE); | |
444 | Preset_maps(dpr->dpr_proc); | 444 | Preset_maps(dpr->dpr_proc); | |
445 | } | 445 | } | |
446 | 446 | |||
447 | if ((dpr->dpr_rtld = Prd_agent(dpr->dpr_proc)) != NULL && | 447 | if ((dpr->dpr_rtld = Prd_agent(dpr->dpr_proc)) != NULL && | |
448 | (err = rd_event_enable(dpr->dpr_rtld, B_TRUE)) == RD_OK) { | 448 | (err = rd_event_enable(dpr->dpr_rtld, B_TRUE)) == RD_OK) { | |
449 | dt_proc_rdwatch(dpr, RD_PREINIT, "RD_PREINIT"); | 449 | dt_proc_rdwatch(dpr, RD_PREINIT, "RD_PREINIT"); | |
450 | dt_proc_rdwatch(dpr, RD_POSTINIT, "RD_POSTINIT"); | 450 | dt_proc_rdwatch(dpr, RD_POSTINIT, "RD_POSTINIT"); | |
@@ -490,27 +490,27 @@ dt_proc_attach(dt_proc_t *dpr, int exec) | @@ -490,27 +490,27 @@ dt_proc_attach(dt_proc_t *dpr, int exec) | |||
490 | static void | 490 | static void | |
491 | dt_proc_waitrun(dt_proc_t *dpr) | 491 | dt_proc_waitrun(dt_proc_t *dpr) | |
492 | { | 492 | { | |
493 | struct ps_prochandle *P = dpr->dpr_proc; | 493 | struct ps_prochandle *P = dpr->dpr_proc; | |
494 | const lwpstatus_t *psp = &Pstatus(P)->pr_lwp; | 494 | const lwpstatus_t *psp = &Pstatus(P)->pr_lwp; | |
495 | 495 | |||
496 | int krflag = psp->pr_flags & (PR_KLC | PR_RLC); | 496 | int krflag = psp->pr_flags & (PR_KLC | PR_RLC); | |
497 | timestruc_t tstamp = psp->pr_tstamp; | 497 | timestruc_t tstamp = psp->pr_tstamp; | |
498 | lwpid_t lwpid = psp->pr_lwpid; | 498 | lwpid_t lwpid = psp->pr_lwpid; | |
499 | 499 | |||
500 | const long wstop = PCWSTOP; | 500 | const long wstop = PCWSTOP; | |
501 | int pfd = Pctlfd(P); | 501 | int pfd = Pctlfd(P); | |
502 | 502 | |||
503 | assert(MUTEX_HELD(&dpr->dpr_lock)); | 503 | assert(DT_MUTEX_HELD(&dpr->dpr_lock)); | |
504 | assert(psp->pr_flags & PR_STOPPED); | 504 | assert(psp->pr_flags & PR_STOPPED); | |
505 | assert(Pstate(P) == PS_STOP); | 505 | assert(Pstate(P) == PS_STOP); | |
506 | 506 | |||
507 | /* | 507 | /* | |
508 | * While we are waiting for the victim to run, clear PR_KLC and PR_RLC | 508 | * While we are waiting for the victim to run, clear PR_KLC and PR_RLC | |
509 | * so that if the libdtrace client is killed, the victim stays stopped. | 509 | * so that if the libdtrace client is killed, the victim stays stopped. | |
510 | * dt_proc_destroy() will also observe this and perform PRELEASE_HANG. | 510 | * dt_proc_destroy() will also observe this and perform PRELEASE_HANG. | |
511 | */ | 511 | */ | |
512 | (void) Punsetflags(P, krflag); | 512 | (void) Punsetflags(P, krflag); | |
513 | Psync(P); | 513 | Psync(P); | |
514 | 514 | |||
515 | (void) pthread_mutex_unlock(&dpr->dpr_lock); | 515 | (void) pthread_mutex_unlock(&dpr->dpr_lock); | |
516 | 516 |
--- src/external/cddl/osnet/sys/sys/cpuvar.h 2010/02/28 14:45:47 1.4
+++ src/external/cddl/osnet/sys/sys/cpuvar.h 2010/03/01 11:19:39 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: cpuvar.h,v 1.4 2010/02/28 14:45:47 haad Exp $ */ | 1 | /* $NetBSD: cpuvar.h,v 1.5 2010/03/01 11:19:39 darran Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * CDDL HEADER START | 4 | * CDDL HEADER START | |
5 | * | 5 | * | |
6 | * The contents of this file are subject to the terms of the | 6 | * The contents of this file are subject to the terms of the | |
7 | * Common Development and Distribution License (the "License"). | 7 | * Common Development and Distribution License (the "License"). | |
8 | * You may not use this file except in compliance with the License. | 8 | * You may not use this file except in compliance with the License. | |
9 | * | 9 | * | |
10 | * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | 10 | * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | |
11 | * or http://www.opensolaris.org/os/licensing. | 11 | * or http://www.opensolaris.org/os/licensing. | |
12 | * See the License for the specific language governing permissions | 12 | * See the License for the specific language governing permissions | |
13 | * and limitations under the License. | 13 | * and limitations under the License. | |
14 | * | 14 | * | |
@@ -20,26 +20,27 @@ | @@ -20,26 +20,27 @@ | |||
20 | * | 20 | * | |
21 | * CDDL HEADER END | 21 | * CDDL HEADER END | |
22 | */ | 22 | */ | |
23 | 23 | |||
24 | /* | 24 | /* | |
25 | * Copyright 2007 Sun Microsystems, Inc. All rights reserved. | 25 | * Copyright 2007 Sun Microsystems, Inc. All rights reserved. | |
26 | * Use is subject to license terms. | 26 | * Use is subject to license terms. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #ifndef _COMPAT_OPENSOLARIS_SYS_CPUVAR_H | 29 | #ifndef _COMPAT_OPENSOLARIS_SYS_CPUVAR_H | |
30 | #define _COMPAT_OPENSOLARIS_SYS_CPUVAR_H | 30 | #define _COMPAT_OPENSOLARIS_SYS_CPUVAR_H | |
31 | 31 | |||
32 | #include <sys/mutex.h> | 32 | #include <sys/mutex.h> | |
33 | #include <sys/cpuvar_defs.h> | |||
33 | 34 | |||
34 | #ifdef _KERNEL | 35 | #ifdef _KERNEL | |
35 | #define CPU_CACHE_COHERENCE_SIZE 64 | 36 | #define CPU_CACHE_COHERENCE_SIZE 64 | |
36 | 37 | |||
37 | /* | 38 | /* | |
38 | * The cpu_core structure consists of per-CPU state available in any context. | 39 | * The cpu_core structure consists of per-CPU state available in any context. | |
39 | * On some architectures, this may mean that the page(s) containing the | 40 | * On some architectures, this may mean that the page(s) containing the | |
40 | * NCPU-sized array of cpu_core structures must be locked in the TLB -- it | 41 | * NCPU-sized array of cpu_core structures must be locked in the TLB -- it | |
41 | * is up to the platform to assure that this is performed properly. Note that | 42 | * is up to the platform to assure that this is performed properly. Note that | |
42 | * the structure is sized to avoid false sharing. | 43 | * the structure is sized to avoid false sharing. | |
43 | */ | 44 | */ | |
44 | #define CPUC_SIZE (sizeof (uint16_t) + sizeof (uintptr_t) + \ | 45 | #define CPUC_SIZE (sizeof (uint16_t) + sizeof (uintptr_t) + \ | |
45 | sizeof (kmutex_t)) | 46 | sizeof (kmutex_t)) |
--- src/external/cddl/osnet/sys/sys/elf.h 2010/02/28 14:45:47 1.4
+++ src/external/cddl/osnet/sys/sys/elf.h 2010/03/01 11:19:40 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: elf.h,v 1.4 2010/02/28 14:45:47 haad Exp $ */ | 1 | /* $NetBSD: elf.h,v 1.5 2010/03/01 11:19:40 darran Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * CDDL HEADER START | 4 | * CDDL HEADER START | |
5 | * | 5 | * | |
6 | * The contents of this file are subject to the terms of the | 6 | * The contents of this file are subject to the terms of the | |
7 | * Common Development and Distribution License (the "License"). | 7 | * Common Development and Distribution License (the "License"). | |
8 | * You may not use this file except in compliance with the License. | 8 | * You may not use this file except in compliance with the License. | |
9 | * | 9 | * | |
10 | * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | 10 | * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | |
11 | * or http://www.opensolaris.org/os/licensing. | 11 | * or http://www.opensolaris.org/os/licensing. | |
12 | * See the License for the specific language governing permissions | 12 | * See the License for the specific language governing permissions | |
13 | * and limitations under the License. | 13 | * and limitations under the License. | |
14 | * | 14 | * | |
@@ -19,100 +19,25 @@ | @@ -19,100 +19,25 @@ | |||
19 | * information: Portions Copyright [yyyy] [name of copyright owner] | 19 | * information: Portions Copyright [yyyy] [name of copyright owner] | |
20 | * | 20 | * | |
21 | * CDDL HEADER END | 21 | * CDDL HEADER END | |
22 | * | 22 | * | |
23 | * $FreeBSD: src/sys/compat/opensolaris/sys/elf.h,v 1.1 2007/11/28 21:50:40 jb Exp $ | 23 | * $FreeBSD: src/sys/compat/opensolaris/sys/elf.h,v 1.1 2007/11/28 21:50:40 jb Exp $ | |
24 | * | 24 | * | |
25 | * ELF compatibility definitions for OpenSolaris source. | 25 | * ELF compatibility definitions for OpenSolaris source. | |
26 | * | 26 | * | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #ifndef _SYS__ELF_SOLARIS_H_ | 29 | #ifndef _SYS__ELF_SOLARIS_H_ | |
30 | #define _SYS__ELF_SOLARIS_H_ | 30 | #define _SYS__ELF_SOLARIS_H_ | |
31 | 31 | |||
32 | #include_next <sys/elf.h> | 32 | #if HAVE_NBTOOL_CONFIG_H | |
33 | 33 | #include <nbinclude/sys/exec_elf.h> | ||
34 | #define __sElfN(x) typedef __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x) x | |||
35 | ||||
36 | __sElfN(Addr); | |||
37 | __sElfN(Cap); | |||
38 | __sElfN(Dyn); | |||
39 | __sElfN(Ehdr); | |||
40 | __sElfN(Move); | |||
41 | __sElfN(Off); | |||
42 | __sElfN(Phdr); | |||
43 | __sElfN(Rel); | |||
44 | __sElfN(Rela); | |||
45 | __sElfN(Shdr); | |||
46 | __sElfN(Sym); | |||
47 | __sElfN(Syminfo); | |||
48 | __sElfN(Verdaux); | |||
49 | __sElfN(Verdef); | |||
50 | __sElfN(Vernaux); | |||
51 | __sElfN(Verneed); | |||
52 | __sElfN(Versym); | |||
53 | ||||
54 | __sElfN(Half); | |||
55 | __sElfN(Sword); | |||
56 | __sElfN(Word); | |||
57 | ||||
58 | #if __ELF_WORD_SIZE == 32 | |||
59 | typedef Elf32_Word Xword; /* Xword/Sxword are 32-bits in Elf32 */ | |||
60 | typedef Elf32_Sword Sxword; | |||
61 | #else | 34 | #else | |
62 | typedef Elf64_Xword Xword; | 35 | #include <sys/exec_elf.h> | |
63 | typedef Elf64_Sxword Sxword; | |||
64 | #endif | 36 | #endif | |
65 | 37 | |||
66 | #define ELF_M_INFO __ELFN(M_INFO) | 38 | #define SHT_SUNW_dof 0x6ffffff4 | |
67 | #define ELF_M_SIZE __ELFN(M_SIZE) | 39 | #define EM_AMD64 EM_X86_64 | |
68 | #define ELF_M_SYM __ELFN(M_SYM) | |||
69 | 40 | |||
70 | /* | 41 | #define __ELF_WORD_SIZE ELFSIZE | |
71 | * Elf `printf' type-cast macros. These force arguments to be a fixed size | |||
72 | * so that Elf32 and Elf64 can share common format strings. | |||
73 | */ | |||
74 | #define EC_ADDR(a) ((Elf64_Addr)(a)) /* "ull" */ | |||
75 | #define EC_OFF(a) ((Elf64_Off)(a)) /* "ull" */ | |||
76 | #define EC_HALF(a) ((Elf64_Half)(a)) /* "d" */ | |||
77 | #define EC_WORD(a) ((Elf64_Word)(a)) /* "u" */ | |||
78 | #define EC_SWORD(a) ((Elf64_Sword)(a)) /* "d" */ | |||
79 | #define EC_XWORD(a) ((Elf64_Xword)(a)) /* "ull" */ | |||
80 | #define EC_SXWORD(a) ((Elf64_Sxword)(a)) /* "ll" */ | |||
81 | #define EC_LWORD(a) ((Elf64_Lword)(a)) /* "ull" */ | |||
82 | ||||
83 | #define elf_checksum __elfN(checksum) | |||
84 | #define elf_fsize __elfN(fsize) | |||
85 | #define elf_getehdr __elfN(getehdr) | |||
86 | #define elf_getphdr __elfN(getphdr) | |||
87 | #define elf_newehdr __elfN(newehdr) | |||
88 | #define elf_newphdr __elfN(newphdr) | |||
89 | #define elf_getshdr __elfN(getshdr) | |||
90 | #define elf_xlatetof __elfN(xlatetof) | |||
91 | #define elf_xlatetom __elfN(xlatetom) | |||
92 | ||||
93 | #define Elf_cap_entry __ElfN(cap_entry) | |||
94 | #define Elf_cap_title __ElfN(cap_title) | |||
95 | #define Elf_demangle_name __ElfN(demangle_name) | |||
96 | #define Elf_dyn_entry __ElfN(dyn_entry) | |||
97 | #define Elf_dyn_title __ElfN(dyn_title) | |||
98 | #define Elf_ehdr __ElfN(ehdr) | |||
99 | #define Elf_got_entry __ElfN(got_entry) | |||
100 | #define Elf_got_title __ElfN(got_title) | |||
101 | #define Elf_reloc_apply_reg __ElfN(reloc_apply_reg) | |||
102 | #define Elf_reloc_apply_val __ElfN(reloc_apply_val) | |||
103 | #define Elf_reloc_entry_1 __ElfN(reloc_entry_1) | |||
104 | #define Elf_reloc_entry_2 __ElfN(reloc_entry_2) | |||
105 | #define Elf_reloc_title __ElfN(reloc_title) | |||
106 | #define Elf_phdr __ElfN(phdr) | |||
107 | #define Elf_shdr __ElfN(shdr) | |||
108 | #define Elf_syms_table_entry __ElfN(syms_table_entry) | |||
109 | #define Elf_syms_table_title __ElfN(syms_table_title) | |||
110 | #define Elf_ver_def_title __ElfN(ver_def_title) | |||
111 | #define Elf_ver_line_1 __ElfN(ver_line_1) | |||
112 | #define Elf_ver_line_2 __ElfN(ver_line_2) | |||
113 | #define Elf_ver_line_3 __ElfN(ver_line_3) | |||
114 | #define Elf_ver_line_4 __ElfN(ver_line_4) | |||
115 | #define Elf_ver_line_5 __ElfN(ver_line_5) | |||
116 | #define Elf_ver_need_title __ElfN(ver_need_title) | |||
117 | 42 | |||
118 | #endif /* !_SYS__ELF_SOLARIS_H_ */ | 43 | #endif /* !_SYS__ELF_SOLARIS_H_ */ |
--- src/external/cddl/osnet/sys/sys/modctl.h 2010/02/28 14:45:47 1.4
+++ src/external/cddl/osnet/sys/sys/modctl.h 2010/03/01 11:19:40 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: modctl.h,v 1.4 2010/02/28 14:45:47 haad Exp $ */ | 1 | /* $NetBSD: modctl.h,v 1.5 2010/03/01 11:19:40 darran Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (C) 2007 John Birrell <jb@freebsd.org> | 4 | * Copyright (C) 2007 John Birrell <jb@freebsd.org> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -25,14 +25,16 @@ | @@ -25,14 +25,16 @@ | |||
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
26 | * SUCH DAMAGE. | 26 | * SUCH DAMAGE. | |
27 | * | 27 | * | |
28 | * $FreeBSD: src/sys/compat/opensolaris/sys/modctl.h,v 1.1 2007/11/28 21:50:40 jb Exp $ | 28 | * $FreeBSD: src/sys/compat/opensolaris/sys/modctl.h,v 1.1 2007/11/28 21:50:40 jb Exp $ | |
29 | * | 29 | * | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #ifndef _COMPAT_OPENSOLARIS_SYS_MODCTL_H | 32 | #ifndef _COMPAT_OPENSOLARIS_SYS_MODCTL_H | |
33 | #define _COMPAT_OPENSOLARIS_SYS_MODCTL_H | 33 | #define _COMPAT_OPENSOLARIS_SYS_MODCTL_H | |
34 | 34 | |||
35 | #include <sys/param.h> | 35 | #include <sys/param.h> | |
36 | #include <sys/linker.h> | 36 | #include <sys/linker.h> | |
37 | 37 | |||
38 | typedef struct module dtrace_modctl_t; | |||
39 | ||||
38 | #endif /* _COMPAT_OPENSOLARIS_SYS_MODCTL_H */ | 40 | #endif /* _COMPAT_OPENSOLARIS_SYS_MODCTL_H */ |
--- src/external/cddl/osnet/sys/sys/policy.h 2010/02/28 14:45:47 1.4
+++ src/external/cddl/osnet/sys/sys/policy.h 2010/03/01 11:19:40 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: policy.h,v 1.4 2010/02/28 14:45:47 haad Exp $ */ | 1 | /* $NetBSD: policy.h,v 1.5 2010/03/01 11:19:40 darran Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org> | 4 | * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -25,35 +25,37 @@ | @@ -25,35 +25,37 @@ | |||
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
26 | * SUCH DAMAGE. | 26 | * SUCH DAMAGE. | |
27 | * | 27 | * | |
28 | $ $FreeBSD: src/sys/compat/opensolaris/sys/policy.h,v 1.1 2007/04/06 01:09:06 pjd Exp $ | 28 | $ $FreeBSD: src/sys/compat/opensolaris/sys/policy.h,v 1.1 2007/04/06 01:09:06 pjd Exp $ | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #ifndef _OPENSOLARIS_SYS_POLICY_H_ | 31 | #ifndef _OPENSOLARIS_SYS_POLICY_H_ | |
32 | #define _OPENSOLARIS_SYS_POLICY_H_ | 32 | #define _OPENSOLARIS_SYS_POLICY_H_ | |
33 | 33 | |||
34 | #include <sys/param.h> | 34 | #include <sys/param.h> | |
35 | 35 | |||
36 | #ifdef _KERNEL | 36 | #ifdef _KERNEL | |
37 | 37 | |||
38 | #include <sys/vnode.h> | |||
39 | ||||
38 | struct mount; | 40 | struct mount; | |
39 | struct ucred; | 41 | struct ucred; | |
40 | struct vattr; | 42 | struct vattr; | |
41 | struct vnode; | 43 | struct vnode; | |
42 | 44 | |||
43 | int secpolicy_zfs(struct kauth_cred *cred); | 45 | int secpolicy_zfs(struct kauth_cred *cred); | |
44 | int secpolicy_sys_config(struct kauth_cred *cred, int checkonly); | 46 | int secpolicy_sys_config(struct kauth_cred *cred, int checkonly); | |
45 | int secpolicy_zinject(struct kauth_cred *cred); | 47 | int secpolicy_zinject(struct kauth_cred *cred); | |
46 | int secpolicy_fs_mount(struct kauth_cred *cred, vnode_t *mvp, struct mount *vfsp); | 48 | int secpolicy_fs_mount(struct kauth_cred *cred, struct vnode *mvp, struct mount *vfsp); | |
47 | int secpolicy_fs_unmount(struct kauth_cred *cred, struct mount *vfsp); | 49 | int secpolicy_fs_unmount(struct kauth_cred *cred, struct mount *vfsp); | |
48 | int secpolicy_basic_link(struct kauth_cred *cred); | 50 | int secpolicy_basic_link(struct kauth_cred *cred); | |
49 | int secpolicy_vnode_stky_modify(struct kauth_cred *cred); | 51 | int secpolicy_vnode_stky_modify(struct kauth_cred *cred); | |
50 | int secpolicy_vnode_owner(cred_t *cred, uid_t owner); | 52 | int secpolicy_vnode_owner(cred_t *cred, uid_t owner); | |
51 | int secpolicy_vnode_remove(struct kauth_cred *cred); | 53 | int secpolicy_vnode_remove(struct kauth_cred *cred); | |
52 | int secpolicy_vnode_access(struct kauth_cred *cred, struct vnode *vp, | 54 | int secpolicy_vnode_access(struct kauth_cred *cred, struct vnode *vp, | |
53 | uint64_t owner, int mode); | 55 | uint64_t owner, int mode); | |
54 | int secpolicy_vnode_chown(struct kauth_cred *cred, | 56 | int secpolicy_vnode_chown(struct kauth_cred *cred, | |
55 | boolean_t check_self); | 57 | boolean_t check_self); | |
56 | int secpolicy_vnode_setdac(struct kauth_cred *cred, uid_t owner); | 58 | int secpolicy_vnode_setdac(struct kauth_cred *cred, uid_t owner); | |
57 | int secpolicy_vnode_setattr(struct kauth_cred *cred, struct vnode *vp, | 59 | int secpolicy_vnode_setattr(struct kauth_cred *cred, struct vnode *vp, | |
58 | struct vattr *vap, const struct vattr *ovap, int flags, | 60 | struct vattr *vap, const struct vattr *ovap, int flags, | |
59 | int unlocked_access(void *, int, struct kauth_cred *), void *node); | 61 | int unlocked_access(void *, int, struct kauth_cred *), void *node); |
--- src/external/cddl/osnet/sys/sys/sdt.h 2010/02/21 01:46:36 1.3
+++ src/external/cddl/osnet/sys/sys/sdt.h 2010/03/01 11:19:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: sdt.h,v 1.3 2010/02/21 01:46:36 darran Exp $ */ | 1 | /* $NetBSD: sdt.h,v 1.4 2010/03/01 11:19:40 darran Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org> | 4 | * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -22,27 +22,47 @@ | @@ -22,27 +22,47 @@ | |||
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
26 | * SUCH DAMAGE. | 26 | * SUCH DAMAGE. | |
27 | * | 27 | * | |
28 | * $FreeBSD: src/sys/compat/opensolaris/sys/sdt.h,v 1.1 2007/04/06 01:09:06 pjd Exp $ | 28 | * $FreeBSD: src/sys/compat/opensolaris/sys/sdt.h,v 1.1 2007/04/06 01:09:06 pjd Exp $ | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #ifndef _OPENSOLARIS_SYS_SDT_H_ | 31 | #ifndef _OPENSOLARIS_SYS_SDT_H_ | |
32 | #define _OPENSOLARIS_SYS_SDT_H_ | 32 | #define _OPENSOLARIS_SYS_SDT_H_ | |
33 | 33 | |||
34 | #include_next <sys/sdt.h> | 34 | #include_next <sys/sdt.h> | |
35 | #include <sys/dtrace.h> | |||
36 | ||||
37 | typedef struct { | |||
38 | char name[SDT_MAX_NAME_SIZE]; | |||
39 | dtrace_provider_id_t id; | |||
40 | dtrace_pattr_t attr; | |||
41 | sdt_probe_t *probes[]; | |||
42 | } sdt_provider_t; | |||
43 | ||||
44 | int sdt_register(sdt_provider_t *); | |||
45 | int sdt_unregister(sdt_provider_t *); | |||
35 | 46 | |||
36 | #undef DTRACE_PROBE | 47 | #undef DTRACE_PROBE | |
37 | #undef DTRACE_PROBE1 | 48 | #undef DTRACE_PROBE1 | |
38 | #undef DTRACE_PROBE2 | 49 | #undef DTRACE_PROBE2 | |
39 | #undef DTRACE_PROBE3 | 50 | #undef DTRACE_PROBE3 | |
40 | #undef DTRACE_PROBE4 | 51 | #undef DTRACE_PROBE4 | |
52 | #undef DTRACE_PROBE5 | |||
53 | #undef DTRACE_PROBE6 | |||
54 | #undef DTRACE_PROBE7 | |||
41 | 55 | |||
42 | #define DTRACE_PROBE(name) | 56 | #define DTRACE_PROBE(name) | |
43 | #define DTRACE_PROBE1(name, type1, arg1) | 57 | #define DTRACE_PROBE1(name, type1, arg1) | |
44 | #define DTRACE_PROBE2(name, type1, arg1, type2, arg2) | 58 | #define DTRACE_PROBE2(name, type1, arg1, type2, arg2) | |
45 | #define DTRACE_PROBE3(name, type1, arg1, type2, arg2, type3, arg3) | 59 | #define DTRACE_PROBE3(name, type1, arg1, type2, arg2, type3, arg3) | |
46 | #define DTRACE_PROBE4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) | 60 | #define DTRACE_PROBE4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) | |
61 | #define DTRACE_PROBE5(name, type1, arg1, type2, arg2, type3, arg3, \ | |||
62 | type4, arg4, type5, arg5) | |||
63 | #define DTRACE_PROBE6(name, type1, arg1, type2, arg2, type3, arg3, \ | |||
64 | type4, arg4, type5, arg5, type6, arg6) | |||
65 | #define DTRACE_PROBE7(name, type1, arg1, type2, arg2, type3, arg3, \ | |||
66 | type4, arg4, type5, arg5, type6, arg6, type7, arg7) | |||
47 | 67 | |||
48 | #endif /* _OPENSOLARIS_SYS_SDT_H_ */ | 68 | #endif /* _OPENSOLARIS_SYS_SDT_H_ */ |
--- src/external/cddl/osnet/sys/sys/types.h 2010/02/28 14:45:47 1.6
+++ src/external/cddl/osnet/sys/sys/types.h 2010/03/01 11:19:40 1.7
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: types.h,v 1.6 2010/02/28 14:45:47 haad Exp $ */ | 1 | /* $NetBSD: types.h,v 1.7 2010/03/01 11:19:40 darran Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2009 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2009 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Andrew Doran. | 8 | * by Andrew Doran. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -115,26 +115,27 @@ typedef struct kauth_cred cred_t; | @@ -115,26 +115,27 @@ typedef struct kauth_cred cred_t; | |||
115 | typedef uintptr_t pc_t; | 115 | typedef uintptr_t pc_t; | |
116 | typedef struct vm_page page_t; | 116 | typedef struct vm_page page_t; | |
117 | typedef ushort_t o_mode_t; /* old file attribute type */ | 117 | typedef ushort_t o_mode_t; /* old file attribute type */ | |
118 | typedef u_longlong_t diskaddr_t; | 118 | typedef u_longlong_t diskaddr_t; | |
119 | typedef void *zone_t; | 119 | typedef void *zone_t; | |
120 | typedef struct vfsops vfsops_t; | 120 | typedef struct vfsops vfsops_t; | |
121 | 121 | |||
122 | #ifdef _KERNEL | 122 | #ifdef _KERNEL | |
123 | 123 | |||
124 | typedef short index_t; | 124 | typedef short index_t; | |
125 | typedef off_t offset_t; | 125 | typedef off_t offset_t; | |
126 | typedef long ptrdiff_t; /* pointer difference */ | 126 | typedef long ptrdiff_t; /* pointer difference */ | |
127 | typedef int64_t rlim64_t; | 127 | typedef int64_t rlim64_t; | |
128 | typedef __caddr_t caddr_t; /* core address */ | |||
128 | 129 | |||
129 | #else | 130 | #else | |
130 | 131 | |||
131 | typedef longlong_t offset_t; | 132 | typedef longlong_t offset_t; | |
132 | typedef u_longlong_t u_offset_t; | 133 | typedef u_longlong_t u_offset_t; | |
133 | typedef uint64_t upad64_t; | 134 | typedef uint64_t upad64_t; | |
134 | typedef struct timespec timespec_t; | 135 | typedef struct timespec timespec_t; | |
135 | typedef int32_t daddr32_t; | 136 | typedef int32_t daddr32_t; | |
136 | typedef int32_t time32_t; | 137 | typedef int32_t time32_t; | |
137 | 138 | |||
138 | #endif /* !_KERNEL */ | 139 | #endif /* !_KERNEL */ | |
139 | 140 | |||
140 | #define MAXOFFSET_T 0x7fffffffffffffffLL | 141 | #define MAXOFFSET_T 0x7fffffffffffffffLL |
--- src/sys/sys/Makefile 2009/09/16 16:34:56 1.123
+++ src/sys/sys/Makefile 2010/03/01 11:19:41 1.124
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: Makefile,v 1.123 2009/09/16 16:34:56 dyoung Exp $ | 1 | # $NetBSD: Makefile,v 1.124 2010/03/01 11:19:41 darran Exp $ | |
2 | 2 | |||
3 | .include <bsd.sys.mk> | 3 | .include <bsd.sys.mk> | |
4 | 4 | |||
5 | INCSDIR= /usr/include/sys | 5 | INCSDIR= /usr/include/sys | |
6 | 6 | |||
7 | INCS= acct.h agpio.h aio.h ansi.h aout_mids.h ataio.h atomic.h audioio.h \ | 7 | INCS= acct.h agpio.h aio.h ansi.h aout_mids.h ataio.h atomic.h audioio.h \ | |
8 | bitops.h bootblock.h bswap.h buf.h \ | 8 | bitops.h bootblock.h bswap.h buf.h \ | |
9 | callback.h callout.h cdefs.h cdefs_aout.h \ | 9 | callback.h callout.h cdefs.h cdefs_aout.h \ | |
10 | cdefs_elf.h cdio.h chio.h clockctl.h condvar.h conf.h core.h \ | 10 | cdefs_elf.h cdio.h chio.h clockctl.h condvar.h conf.h core.h \ | |
11 | cpuio.h \ | 11 | cpuio.h \ | |
12 | device.h device_if.h \ | 12 | device.h device_if.h \ | |
13 | dir.h dirent.h \ | 13 | dir.h dirent.h \ | |
14 | disk.h disklabel.h disklabel_acorn.h disklabel_gpt.h disklabel_rdb.h \ | 14 | disk.h disklabel.h disklabel_acorn.h disklabel_gpt.h disklabel_rdb.h \ | |
@@ -19,28 +19,28 @@ INCS= acct.h agpio.h aio.h ansi.h aout_m | @@ -19,28 +19,28 @@ INCS= acct.h agpio.h aio.h ansi.h aout_m | |||
19 | float_ieee754.h fstypes.h gcq.h gmon.h gpio.h hash.h \ | 19 | float_ieee754.h fstypes.h gcq.h gmon.h gpio.h hash.h \ | |
20 | ieee754.h inttypes.h ioccom.h ioctl.h ioctl_compat.h iostat.h ipc.h \ | 20 | ieee754.h inttypes.h ioccom.h ioctl.h ioctl_compat.h iostat.h ipc.h \ | |
21 | joystick.h \ | 21 | joystick.h \ | |
22 | kcore.h kgdb.h kmem.h ksem.h ksyms.h ktrace.h \ | 22 | kcore.h kgdb.h kmem.h ksem.h ksyms.h ktrace.h \ | |
23 | localedef.h lock.h lockf.h lwp.h lwpctl.h \ | 23 | localedef.h lock.h lockf.h lwp.h lwpctl.h \ | |
24 | malloc.h mallocvar.h mbuf.h md4.h md5.h midiio.h \ | 24 | malloc.h mallocvar.h mbuf.h md4.h md5.h midiio.h \ | |
25 | mman.h module.h mount.h mqueue.h msg.h msgbuf.h mtio.h mutex.h \ | 25 | mman.h module.h mount.h mqueue.h msg.h msgbuf.h mtio.h mutex.h \ | |
26 | namei.h null.h \ | 26 | namei.h null.h \ | |
27 | param.h pipe.h pmc.h poll.h pool.h power.h proc.h \ | 27 | param.h pipe.h pmc.h poll.h pool.h power.h proc.h \ | |
28 | protosw.h pset.h ptrace.h ptree.h \ | 28 | protosw.h pset.h ptrace.h ptree.h \ | |
29 | queue.h \ | 29 | queue.h \ | |
30 | ras.h rb.h reboot.h radioio.h resource.h resourcevar.h rmd160.h \ | 30 | ras.h rb.h reboot.h radioio.h resource.h resourcevar.h rmd160.h \ | |
31 | rnd.h rwlock.h sa.h satypes.h \ | 31 | rnd.h rwlock.h sa.h satypes.h \ | |
32 | scanio.h sched.h scsiio.h select.h selinfo.h sem.h sha1.h sha2.h \ | 32 | scanio.h sched.h scsiio.h sdt.h select.h selinfo.h sem.h sha1.h \ | |
33 | shm.h siginfo.h signal.h signalvar.h sigtypes.h simplelock.h \ | 33 | sha2.h shm.h siginfo.h signal.h signalvar.h sigtypes.h simplelock.h \ | |
34 | sleepq.h socket.h \ | 34 | sleepq.h socket.h \ | |
35 | socketvar.h sockio.h specificdata.h stat.h statvfs.h \ | 35 | socketvar.h sockio.h specificdata.h stat.h statvfs.h \ | |
36 | syscall.h syscallargs.h sysctl.h stdint.h swap.h \ | 36 | syscall.h syscallargs.h sysctl.h stdint.h swap.h \ | |
37 | syncobj.h syslimits.h syslog.h \ | 37 | syncobj.h syslimits.h syslog.h \ | |
38 | tape.h termios.h time.h timeb.h timepps.h times.h \ | 38 | tape.h termios.h time.h timeb.h timepps.h times.h \ | |
39 | timex.h trace.h tree.h tty.h ttychars.h ttycom.h \ | 39 | timex.h trace.h tree.h tty.h ttychars.h ttycom.h \ | |
40 | ttydefaults.h ttydev.h types.h \ | 40 | ttydefaults.h ttydev.h types.h \ | |
41 | ucontext.h ucred.h uio.h un.h unistd.h unpcb.h user.h utsname.h uuid.h \ | 41 | ucontext.h ucred.h uio.h un.h unistd.h unpcb.h user.h utsname.h uuid.h \ | |
42 | vadvise.h verified_exec.h videoio.h vmmeter.h vnode.h vnode_if.h \ | 42 | vadvise.h verified_exec.h videoio.h vmmeter.h vnode.h vnode_if.h \ | |
43 | wait.h wapbl.h wapbl_replay.h wdog.h | 43 | wait.h wapbl.h wapbl_replay.h wdog.h | |
44 | 44 | |||
45 | INCSYMLINKS=\ | 45 | INCSYMLINKS=\ | |
46 | sys/exec_elf.h /usr/include/elf.h \ | 46 | sys/exec_elf.h /usr/include/elf.h \ |
--- src/sys/sys/exec_elf.h 2009/12/20 05:50:20 1.100
+++ src/sys/sys/exec_elf.h 2010/03/01 11:19:41 1.101
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: exec_elf.h,v 1.100 2009/12/20 05:50:20 thorpej Exp $ */ | 1 | /* $NetBSD: exec_elf.h,v 1.101 2010/03/01 11:19:41 darran Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1994 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1994 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Christos Zoulas. | 8 | * by Christos Zoulas. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -480,27 +480,29 @@ typedef struct { | @@ -480,27 +480,29 @@ typedef struct { | |||
480 | #define STB_NUM 3 | 480 | #define STB_NUM 3 | |
481 | 481 | |||
482 | #define STB_LOOS 10 /* Operating system specific range */ | 482 | #define STB_LOOS 10 /* Operating system specific range */ | |
483 | #define STB_HIOS 12 | 483 | #define STB_HIOS 12 | |
484 | #define STB_LOPROC 13 /* Processor-specific range */ | 484 | #define STB_LOPROC 13 /* Processor-specific range */ | |
485 | #define STB_HIPROC 15 | 485 | #define STB_HIPROC 15 | |
486 | 486 | |||
487 | /* st_info: Symbol Types */ | 487 | /* st_info: Symbol Types */ | |
488 | #define STT_NOTYPE 0 /* Type not specified */ | 488 | #define STT_NOTYPE 0 /* Type not specified */ | |
489 | #define STT_OBJECT 1 /* Associated with a data object */ | 489 | #define STT_OBJECT 1 /* Associated with a data object */ | |
490 | #define STT_FUNC 2 /* Associated with a function */ | 490 | #define STT_FUNC 2 /* Associated with a function */ | |
491 | #define STT_SECTION 3 /* Associated with a section */ | 491 | #define STT_SECTION 3 /* Associated with a section */ | |
492 | #define STT_FILE 4 /* Associated with a file name */ | 492 | #define STT_FILE 4 /* Associated with a file name */ | |
493 | #define STT_NUM 5 | 493 | #define STT_COMMON 5 /* Uninitialised common block */ | |
494 | #define STT_TLS 6 /* Thread local data object */ | |||
495 | #define STT_NUM 7 | |||
494 | 496 | |||
495 | #define STT_LOOS 10 /* Operating system specific range */ | 497 | #define STT_LOOS 10 /* Operating system specific range */ | |
496 | #define STT_HIOS 12 | 498 | #define STT_HIOS 12 | |
497 | #define STT_LOPROC 13 /* Processor-specific range */ | 499 | #define STT_LOPROC 13 /* Processor-specific range */ | |
498 | #define STT_HIPROC 15 | 500 | #define STT_HIPROC 15 | |
499 | 501 | |||
500 | /* st_other: Visibility Types */ | 502 | /* st_other: Visibility Types */ | |
501 | #define STV_DEFAULT 0 /* use binding type */ | 503 | #define STV_DEFAULT 0 /* use binding type */ | |
502 | #define STV_INTERNAL 1 /* not referenced from outside */ | 504 | #define STV_INTERNAL 1 /* not referenced from outside */ | |
503 | #define STV_HIDDEN 2 /* not visible, may be used via ptr */ | 505 | #define STV_HIDDEN 2 /* not visible, may be used via ptr */ | |
504 | #define STV_PROTECTED 3 /* visible, not preemptible */ | 506 | #define STV_PROTECTED 3 /* visible, not preemptible */ | |
505 | #define STV_EXPORTED 4 | 507 | #define STV_EXPORTED 4 | |
506 | #define STV_SINGLETON 5 | 508 | #define STV_SINGLETON 5 |