1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef __KERNEL_PRINTK__ 3 #define __KERNEL_PRINTK__ 4 5 #include <stdarg.h> 6 #include <linux/init.h> 7 #include <linux/kern_levels.h> 8 #include <linux/linkage.h> 9 #include <linux/cache.h> 10 #include <linux/ratelimit_types.h> 11 12 extern const char linux_banner[]; 13 extern const char linux_proc_banner[]; 14 15 extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ 16 17 #define PRINTK_MAX_SINGLE_HEADER_LEN 2 18 19 static inline int printk_get_level(const char *buffer) 20 { 21 if (buffer[0] == KERN_SOH_ASCII && buffer[1]) { 22 switch (buffer[1]) { 23 case '0' ... '7': 24 case 'c': /* KERN_CONT */ 25 return buffer[1]; 26 } 27 } 28 return 0; 29 } 30 31 static inline const char *printk_skip_level(const char *buffer) 32 { 33 if (printk_get_level(buffer)) 34 return buffer + 2; 35 36 return buffer; 37 } 38 39 static inline const char *printk_skip_headers(const char *buffer) 40 { 41 while (printk_get_level(buffer)) 42 buffer = printk_skip_level(buffer); 43 44 return buffer; 45 } 46 47 #define CONSOLE_EXT_LOG_MAX 8192 48 49 /* printk's without a loglevel use this.. */ 50 #define MESSAGE_LOGLEVEL_DEFAULT CONFIG_MESSAGE_LOGLEVEL_DEFAULT 51 52 /* We show everything that is MORE important than this.. */ 53 #define CONSOLE_LOGLEVEL_SILENT 0 /* Mum's the word */ 54 #define CONSOLE_LOGLEVEL_MIN 1 /* Minimum loglevel we let people use */ 55 #define CONSOLE_LOGLEVEL_DEBUG 10 /* issue debug messages */ 56 #define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */ 57 58 /* 59 * Default used to be hard-coded at 7, quiet used to be hardcoded at 4, 60 * we're now allowing both to be set from kernel config. 61 */ 62 #define CONSOLE_LOGLEVEL_DEFAULT CONFIG_CONSOLE_LOGLEVEL_DEFAULT 63 #define CONSOLE_LOGLEVEL_QUIET CONFIG_CONSOLE_LOGLEVEL_QUIET 64 65 extern int console_printk[]; 66 67 #define console_loglevel (console_printk[0]) 68 #define default_message_loglevel (console_printk[1]) 69 #define minimum_console_loglevel (console_printk[2]) 70 #define default_console_loglevel (console_printk[3]) 71 72 static inline void console_silent(void) 73 { 74 console_loglevel = CONSOLE_LOGLEVEL_SILENT; 75 } 76 77 static inline void console_verbose(void) 78 { 79 if (console_loglevel) 80 console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH; 81 } 82 83 /* strlen("ratelimit") + 1 */ 84 #define DEVKMSG_STR_MAX_SIZE 10 85 extern char devkmsg_log_str[]; 86 struct ctl_table; 87 88 extern int suppress_printk; 89 90 struct va_format { 91 const char *fmt; 92 va_list *va; 93 }; 94 95 /* 96 * FW_BUG 97 * Add this to a message where you are sure the firmware is buggy or behaves 98 * really stupid or out of spec. Be aware that the responsible BIOS developer 99 * should be able to fix this issue or at least get a concrete idea of the 100 * problem by reading your message without the need of looking at the kernel 101 * code. 102 * 103 * Use it for definite and high priority BIOS bugs. 104 * 105 * FW_WARN 106 * Use it for not that clear (e.g. could the kernel messed up things already?) 107 * and medium priority BIOS bugs. 108 * 109 * FW_INFO 110 * Use this one if you want to tell the user or vendor about something 111 * suspicious, but generally harmless related to the firmware. 112 * 113 * Use it for information or very low priority BIOS bugs. 114 */ 115 #define FW_BUG "[Firmware Bug]: " 116 #define FW_WARN "[Firmware Warn]: " 117 #define FW_INFO "[Firmware Info]: " 118 119 /* 120 * HW_ERR 121 * Add this to a message for hardware errors, so that user can report 122 * it to hardware vendor instead of LKML or software vendor. 123 */ 124 #define HW_ERR "[Hardware Error]: " 125 126 /* 127 * DEPRECATED 128 * Add this to a message whenever you want to warn user space about the use 129 * of a deprecated aspect of an API so they can stop using it 130 */ 131 #define DEPRECATED "[Deprecated]: " 132 133 /* 134 * Dummy printk for disabled debugging statements to use whilst maintaining 135 * gcc's format checking. 136 */ 137 #define no_printk(fmt, ...) \ 138 ({ \ 139 if (0) \ 140 printk(fmt, ##__VA_ARGS__); \ 141 0; \ 142 }) 143 144 #ifdef CONFIG_EARLY_PRINTK 145 extern asmlinkage __printf(1, 2) 146 void early_printk(const char *fmt, ...); 147 #else 148 static inline __printf(1, 2) __cold 149 void early_printk(const char *s, ...) { } 150 #endif 151 152 #ifdef CONFIG_PRINTK_NMI 153 extern void printk_nmi_enter(void); 154 extern void printk_nmi_exit(void); 155 extern void printk_nmi_direct_enter(void); 156 extern void printk_nmi_direct_exit(void); 157 #else 158 static inline void printk_nmi_enter(void) { } 159 static inline void printk_nmi_exit(void) { } 160 static inline void printk_nmi_direct_enter(void) { } 161 static inline void printk_nmi_direct_exit(void) { } 162 #endif /* PRINTK_NMI */ 163 164 struct dev_printk_info; 165 166 #ifdef CONFIG_PRINTK 167 asmlinkage __printf(4, 0) 168 int vprintk_emit(int facility, int level, 169 const struct dev_printk_info *dev_info, 170 const char *fmt, va_list args); 171 172 asmlinkage __printf(1, 0) 173 int vprintk(const char *fmt, va_list args); 174 175 asmlinkage __printf(1, 2) __cold 176 int printk(const char *fmt, ...); 177 178 /* 179 * Special printk facility for scheduler/timekeeping use only, _DO_NOT_USE_ ! 180 */ 181 __printf(1, 2) __cold int printk_deferred(const char *fmt, ...); 182 183 /* 184 * Please don't use printk_ratelimit(), because it shares ratelimiting state 185 * with all other unrelated printk_ratelimit() callsites. Instead use 186 * printk_ratelimited() or plain old __ratelimit(). 187 */ 188 extern int __printk_ratelimit(const char *func); 189 #define printk_ratelimit() __printk_ratelimit(__func__) 190 extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, 191 unsigned int interval_msec); 192 193 extern int printk_delay_msec; 194 extern int dmesg_restrict; 195 196 extern int 197 devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, void *buf, 198 size_t *lenp, loff_t *ppos); 199 200 extern void wake_up_klogd(void); 201 202 char *log_buf_addr_get(void); 203 u32 log_buf_len_get(void); 204 void log_buf_vmcoreinfo_setup(void); 205 void __init setup_log_buf(int early); 206 __printf(1, 2) void dump_stack_set_arch_desc(const char *fmt, ...); 207 void dump_stack_print_info(const char *log_lvl); 208 void show_regs_print_info(const char *log_lvl); 209 extern asmlinkage void dump_stack_lvl(const char *log_lvl) __cold; 210 extern asmlinkage void dump_stack(void) __cold; 211 extern void printk_safe_flush(void); 212 extern void printk_safe_flush_on_panic(void); 213 #else 214 static inline __printf(1, 0) 215 int vprintk(const char *s, va_list args) 216 { 217 return 0; 218 } 219 static inline __printf(1, 2) __cold 220 int printk(const char *s, ...) 221 { 222 return 0; 223 } 224 static inline __printf(1, 2) __cold 225 int printk_deferred(const char *s, ...) 226 { 227 return 0; 228 } 229 static inline int printk_ratelimit(void) 230 { 231 return 0; 232 } 233 static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, 234 unsigned int interval_msec) 235 { 236 return false; 237 } 238 239 static inline void wake_up_klogd(void) 240 { 241 } 242 243 static inline char *log_buf_addr_get(void) 244 { 245 return NULL; 246 } 247 248 static inline u32 log_buf_len_get(void) 249 { 250 return 0; 251 } 252 253 static inline void log_buf_vmcoreinfo_setup(void) 254 { 255 } 256 257 static inline void setup_log_buf(int early) 258 { 259 } 260 261 static inline __printf(1, 2) void dump_stack_set_arch_desc(const char *fmt, ...) 262 { 263 } 264 265 static inline void dump_stack_print_info(const char *log_lvl) 266 { 267 } 268 269 static inline void show_regs_print_info(const char *log_lvl) 270 { 271 } 272 273 static inline void dump_stack_lvl(const char *log_lvl) 274 { 275 } 276 277 static inline void dump_stack(void) 278 { 279 } 280 281 static inline void printk_safe_flush(void) 282 { 283 } 284 285 static inline void printk_safe_flush_on_panic(void) 286 { 287 } 288 #endif 289 290 extern int kptr_restrict; 291 292 /** 293 * pr_fmt - used by the pr_*() macros to generate the printk format string 294 * @fmt: format string passed from a pr_*() macro 295 * 296 * This macro can be used to generate a unified format string for pr_*() 297 * macros. A common use is to prefix all pr_*() messages in a file with a common 298 * string. For example, defining this at the top of a source file: 299 * 300 * #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 301 * 302 * would prefix all pr_info, pr_emerg... messages in the file with the module 303 * name. 304 */ 305 #ifndef pr_fmt 306 #define pr_fmt(fmt) fmt 307 #endif 308 309 /** 310 * pr_emerg - Print an emergency-level message 311 * @fmt: format string 312 * @...: arguments for the format string 313 * 314 * This macro expands to a printk with KERN_EMERG loglevel. It uses pr_fmt() to 315 * generate the format string. 316 */ 317 #define pr_emerg(fmt, ...) \ 318 printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) 319 /** 320 * pr_alert - Print an alert-level message 321 * @fmt: format string 322 * @...: arguments for the format string 323 * 324 * This macro expands to a printk with KERN_ALERT loglevel. It uses pr_fmt() to 325 * generate the format string. 326 */ 327 #define pr_alert(fmt, ...) \ 328 printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) 329 /** 330 * pr_crit - Print a critical-level message 331 * @fmt: format string 332 * @...: arguments for the format string 333 * 334 * This macro expands to a printk with KERN_CRIT loglevel. It uses pr_fmt() to 335 * generate the format string. 336 */ 337 #define pr_crit(fmt, ...) \ 338 printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) 339 /** 340 * pr_err - Print an error-level message 341 * @fmt: format string 342 * @...: arguments for the format string 343 * 344 * This macro expands to a printk with KERN_ERR loglevel. It uses pr_fmt() to 345 * generate the format string. 346 */ 347 #define pr_err(fmt, ...) \ 348 printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) 349 /** 350 * pr_warn - Print a warning-level message 351 * @fmt: format string 352 * @...: arguments for the format string 353 * 354 * This macro expands to a printk with KERN_WARNING loglevel. It uses pr_fmt() 355 * to generate the format string. 356 */ 357 #define pr_warn(fmt, ...) \ 358 printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) 359 /** 360 * pr_notice - Print a notice-level message 361 * @fmt: format string 362 * @...: arguments for the format string 363 * 364 * This macro expands to a printk with KERN_NOTICE loglevel. It uses pr_fmt() to 365 * generate the format string. 366 */ 367 #define pr_notice(fmt, ...) \ 368 printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) 369 /** 370 * pr_info - Print an info-level message 371 * @fmt: format string 372 * @...: arguments for the format string 373 * 374 * This macro expands to a printk with KERN_INFO loglevel. It uses pr_fmt() to 375 * generate the format string. 376 */ 377 #define pr_info(fmt, ...) \ 378 printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) 379 380 /** 381 * pr_cont - Continues a previous log message in the same line. 382 * @fmt: format string 383 * @...: arguments for the format string 384 * 385 * This macro expands to a printk with KERN_CONT loglevel. It should only be 386 * used when continuing a log message with no newline ('\n') enclosed. Otherwise 387 * it defaults back to KERN_DEFAULT loglevel. 388 */ 389 #define pr_cont(fmt, ...) \ 390 printk(KERN_CONT fmt, ##__VA_ARGS__) 391 392 /** 393 * pr_devel - Print a debug-level message conditionally 394 * @fmt: format string 395 * @...: arguments for the format string 396 * 397 * This macro expands to a printk with KERN_DEBUG loglevel if DEBUG is 398 * defined. Otherwise it does nothing. 399 * 400 * It uses pr_fmt() to generate the format string. 401 */ 402 #ifdef DEBUG 403 #define pr_devel(fmt, ...) \ 404 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 405 #else 406 #define pr_devel(fmt, ...) \ 407 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 408 #endif 409 410 411 /* If you are writing a driver, please use dev_dbg instead */ 412 #if defined(CONFIG_DYNAMIC_DEBUG) || \ 413 (defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE)) 414 #include <linux/dynamic_debug.h> 415 416 /** 417 * pr_debug - Print a debug-level message conditionally 418 * @fmt: format string 419 * @...: arguments for the format string 420 * 421 * This macro expands to dynamic_pr_debug() if CONFIG_DYNAMIC_DEBUG is 422 * set. Otherwise, if DEBUG is defined, it's equivalent to a printk with 423 * KERN_DEBUG loglevel. If DEBUG is not defined it does nothing. 424 * 425 * It uses pr_fmt() to generate the format string (dynamic_pr_debug() uses 426 * pr_fmt() internally). 427 */ 428 #define pr_debug(fmt, ...) \ 429 dynamic_pr_debug(fmt, ##__VA_ARGS__) 430 #elif defined(DEBUG) 431 #define pr_debug(fmt, ...) \ 432 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 433 #else 434 #define pr_debug(fmt, ...) \ 435 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 436 #endif 437 438 /* 439 * Print a one-time message (analogous to WARN_ONCE() et al): 440 */ 441 442 #ifdef CONFIG_PRINTK 443 #define printk_once(fmt, ...) \ 444 ({ \ 445 static bool __section(".data.once") __print_once; \ 446 bool __ret_print_once = !__print_once; \ 447 \ 448 if (!__print_once) { \ 449 __print_once = true; \ 450 printk(fmt, ##__VA_ARGS__); \ 451 } \ 452 unlikely(__ret_print_once); \ 453 }) 454 #define printk_deferred_once(fmt, ...) \ 455 ({ \ 456 static bool __section(".data.once") __print_once; \ 457 bool __ret_print_once = !__print_once; \ 458 \ 459 if (!__print_once) { \ 460 __print_once = true; \ 461 printk_deferred(fmt, ##__VA_ARGS__); \ 462 } \ 463 unlikely(__ret_print_once); \ 464 }) 465 #else 466 #define printk_once(fmt, ...) \ 467 no_printk(fmt, ##__VA_ARGS__) 468 #define printk_deferred_once(fmt, ...) \ 469 no_printk(fmt, ##__VA_ARGS__) 470 #endif 471 472 #define pr_emerg_once(fmt, ...) \ 473 printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) 474 #define pr_alert_once(fmt, ...) \ 475 printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) 476 #define pr_crit_once(fmt, ...) \ 477 printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) 478 #define pr_err_once(fmt, ...) \ 479 printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) 480 #define pr_warn_once(fmt, ...) \ 481 printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) 482 #define pr_notice_once(fmt, ...) \ 483 printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) 484 #define pr_info_once(fmt, ...) \ 485 printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) 486 /* no pr_cont_once, don't do that... */ 487 488 #if defined(DEBUG) 489 #define pr_devel_once(fmt, ...) \ 490 printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 491 #else 492 #define pr_devel_once(fmt, ...) \ 493 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 494 #endif 495 496 /* If you are writing a driver, please use dev_dbg instead */ 497 #if defined(DEBUG) 498 #define pr_debug_once(fmt, ...) \ 499 printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 500 #else 501 #define pr_debug_once(fmt, ...) \ 502 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 503 #endif 504 505 /* 506 * ratelimited messages with local ratelimit_state, 507 * no local ratelimit_state used in the !PRINTK case 508 */ 509 #ifdef CONFIG_PRINTK 510 #define printk_ratelimited(fmt, ...) \ 511 ({ \ 512 static DEFINE_RATELIMIT_STATE(_rs, \ 513 DEFAULT_RATELIMIT_INTERVAL, \ 514 DEFAULT_RATELIMIT_BURST); \ 515 \ 516 if (__ratelimit(&_rs)) \ 517 printk(fmt, ##__VA_ARGS__); \ 518 }) 519 #else 520 #define printk_ratelimited(fmt, ...) \ 521 no_printk(fmt, ##__VA_ARGS__) 522 #endif 523 524 #define pr_emerg_ratelimited(fmt, ...) \ 525 printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) 526 #define pr_alert_ratelimited(fmt, ...) \ 527 printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) 528 #define pr_crit_ratelimited(fmt, ...) \ 529 printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) 530 #define pr_err_ratelimited(fmt, ...) \ 531 printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) 532 #define pr_warn_ratelimited(fmt, ...) \ 533 printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) 534 #define pr_notice_ratelimited(fmt, ...) \ 535 printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) 536 #define pr_info_ratelimited(fmt, ...) \ 537 printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) 538 /* no pr_cont_ratelimited, don't do that... */ 539 540 #if defined(DEBUG) 541 #define pr_devel_ratelimited(fmt, ...) \ 542 printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 543 #else 544 #define pr_devel_ratelimited(fmt, ...) \ 545 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 546 #endif 547 548 /* If you are writing a driver, please use dev_dbg instead */ 549 #if defined(CONFIG_DYNAMIC_DEBUG) || \ 550 (defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE)) 551 /* descriptor check is first to prevent flooding with "callbacks suppressed" */ 552 #define pr_debug_ratelimited(fmt, ...) \ 553 do { \ 554 static DEFINE_RATELIMIT_STATE(_rs, \ 555 DEFAULT_RATELIMIT_INTERVAL, \ 556 DEFAULT_RATELIMIT_BURST); \ 557 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, pr_fmt(fmt)); \ 558 if (DYNAMIC_DEBUG_BRANCH(descriptor) && \ 559 __ratelimit(&_rs)) \ 560 __dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \ 561 } while (0) 562 #elif defined(DEBUG) 563 #define pr_debug_ratelimited(fmt, ...) \ 564 printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 565 #else 566 #define pr_debug_ratelimited(fmt, ...) \ 567 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 568 #endif 569 570 extern const struct file_operations kmsg_fops; 571 572 enum { 573 DUMP_PREFIX_NONE, 574 DUMP_PREFIX_ADDRESS, 575 DUMP_PREFIX_OFFSET 576 }; 577 extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, 578 int groupsize, char *linebuf, size_t linebuflen, 579 bool ascii); 580 #ifdef CONFIG_PRINTK 581 extern void print_hex_dump(const char *level, const char *prefix_str, 582 int prefix_type, int rowsize, int groupsize, 583 const void *buf, size_t len, bool ascii); 584 #else 585 static inline void print_hex_dump(const char *level, const char *prefix_str, 586 int prefix_type, int rowsize, int groupsize, 587 const void *buf, size_t len, bool ascii) 588 { 589 } 590 static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type, 591 const void *buf, size_t len) 592 { 593 } 594 595 #endif 596 597 #if defined(CONFIG_DYNAMIC_DEBUG) || \ 598 (defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE)) 599 #define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \ 600 groupsize, buf, len, ascii) \ 601 dynamic_hex_dump(prefix_str, prefix_type, rowsize, \ 602 groupsize, buf, len, ascii) 603 #elif defined(DEBUG) 604 #define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \ 605 groupsize, buf, len, ascii) \ 606 print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \ 607 groupsize, buf, len, ascii) 608 #else 609 static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type, 610 int rowsize, int groupsize, 611 const void *buf, size_t len, bool ascii) 612 { 613 } 614 #endif 615 616 /** 617 * print_hex_dump_bytes - shorthand form of print_hex_dump() with default params 618 * @prefix_str: string to prefix each line with; 619 * caller supplies trailing spaces for alignment if desired 620 * @prefix_type: controls whether prefix of an offset, address, or none 621 * is printed (%DUMP_PREFIX_OFFSET, %DUMP_PREFIX_ADDRESS, %DUMP_PREFIX_NONE) 622 * @buf: data blob to dump 623 * @len: number of bytes in the @buf 624 * 625 * Calls print_hex_dump(), with log level of KERN_DEBUG, 626 * rowsize of 16, groupsize of 1, and ASCII output included. 627 */ 628 #define print_hex_dump_bytes(prefix_str, prefix_type, buf, len) \ 629 print_hex_dump_debug(prefix_str, prefix_type, 16, 1, buf, len, true) 630 631 #endif 632