* stack(9) helper for non-debugging environemnts. Unlike DDB helpers, we do * obey locking protocols, and offer a significantly less complex interface. */
| 1021 | * obey locking protocols, and offer a significantly less complex interface. |
| 1022 | */ |
| 1023 | int |
| 1024 | linker_search_symbol_name_flags(caddr_t value, char *buf, u_int buflen, |
| 1025 | long *offset, int flags) |
| 1026 | { |
| 1027 | int error; |
| 1028 | |
| 1029 | KASSERT((flags & (M_NOWAIT | M_WAITOK)) != 0 && |
| 1030 | (flags & (M_NOWAIT | M_WAITOK)) != (M_NOWAIT | M_WAITOK), |
| 1031 | ("%s: bad flags: 0x%x", __func__, flags)); |
| 1032 | |
| 1033 | if (flags & M_NOWAIT) { |
| 1034 | if (!sx_try_slock(&kld_sx)) |
| 1035 | return (EWOULDBLOCK); |
| 1036 | } else |
| 1037 | sx_slock(&kld_sx); |
| 1038 | |
| 1039 | error = linker_debug_search_symbol_name(value, buf, buflen, offset); |
| 1040 | sx_sunlock(&kld_sx); |
| 1041 | return (error); |
| 1042 | } |
| 1043 | |
| 1044 | int |
| 1045 | linker_search_symbol_name(caddr_t value, char *buf, u_int buflen, |
no test coverage detected