Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/src/linux_compat.c
| Show First 20 Lines • Show All 1,993 Lines • ▼ Show 20 Lines | __lkpi_hexdump_sbuf_printf(void *arg1, const char *fmt, ...) | ||||
| va_end(ap); | va_end(ap); | ||||
| return (result); | return (result); | ||||
| } | } | ||||
| void | void | ||||
| lkpi_hex_dump(int(*_fpf)(void *, const char *, ...), void *arg1, | lkpi_hex_dump(int(*_fpf)(void *, const char *, ...), void *arg1, | ||||
| const char *level, const char *prefix_str, | const char *level, const char *prefix_str, | ||||
| const int prefix_type, const int rowsize, const int groupsize, | const int prefix_type, const int rowsize, const int groupsize, | ||||
| const void *buf, size_t len, const bool ascii) | const void *buf, size_t len, const bool ascii, const bool trailing_newline) | ||||
| { | { | ||||
| typedef const struct { long long value; } __packed *print_64p_t; | typedef const struct { long long value; } __packed *print_64p_t; | ||||
| typedef const struct { uint32_t value; } __packed *print_32p_t; | typedef const struct { uint32_t value; } __packed *print_32p_t; | ||||
| typedef const struct { uint16_t value; } __packed *print_16p_t; | typedef const struct { uint16_t value; } __packed *print_16p_t; | ||||
| const void *buf_old = buf; | const void *buf_old = buf; | ||||
| int row, linelen, ret; | int row, linelen, ret; | ||||
| while (len > 0) { | while (len > 0) { | ||||
| ▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | for (row = 0; row != rowsize; row++) { | ||||
| return; | return; | ||||
| linelen += ret; | linelen += ret; | ||||
| buf = (const uint8_t *)buf + 1; | buf = (const uint8_t *)buf + 1; | ||||
| len--; | len--; | ||||
| } else { | } else { | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| if (len > 0 && trailing_newline) { | |||||
| ret = _fpf(arg1, "\n"); | ret = _fpf(arg1, "\n"); | ||||
| if (ret < 0) | if (ret < 0) | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| static void | static void | ||||
| linux_timer_callback_wrapper(void *context) | linux_timer_callback_wrapper(void *context) | ||||
| { | { | ||||
| struct timer_list *timer; | struct timer_list *timer; | ||||
| timer = context; | timer = context; | ||||
| ▲ Show 20 Lines • Show All 962 Lines • Show Last 20 Lines | |||||