From 7353f589daccb7fb61880d6994f6471e103da902 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sat, 1 Feb 2014 02:09:02 +0100 Subject: include: add a fixed-size string type for debugging purposes * include/mach/debug.defs: New file. * include/mach/debug.h: Likewise. --- include/mach_debug/mach_debug_types.defs | 2 ++ include/mach_debug/mach_debug_types.h | 11 +++++++++++ 2 files changed, 13 insertions(+) (limited to 'include') diff --git a/include/mach_debug/mach_debug_types.defs b/include/mach_debug/mach_debug_types.defs index f60125a0..d24b6f93 100644 --- a/include/mach_debug/mach_debug_types.defs +++ b/include/mach_debug/mach_debug_types.defs @@ -57,6 +57,8 @@ type vm_page_info_array_t = array[] of vm_page_info_t; type symtab_name_t = (MACH_MSG_TYPE_STRING_C, 8*32); +type kernel_debug_name_t = c_string[*: 64]; + import ; #endif /* _MACH_DEBUG_MACH_DEBUG_TYPES_DEFS_ */ diff --git a/include/mach_debug/mach_debug_types.h b/include/mach_debug/mach_debug_types.h index 5d4efcde..9c7d1fde 100644 --- a/include/mach_debug/mach_debug_types.h +++ b/include/mach_debug/mach_debug_types.h @@ -37,4 +37,15 @@ typedef char symtab_name_t[32]; +/* + * A fixed-length string data type intended for names given to + * kernel objects. + * + * Note that it is not guaranteed that the in-kernel data + * structure will hold KERNEL_DEBUG_NAME_MAX bytes. The given + * name will be truncated to fit into the target data structure. + */ +#define KERNEL_DEBUG_NAME_MAX (64) +typedef char kernel_debug_name_t[KERNEL_DEBUG_NAME_MAX]; + #endif /* _MACH_DEBUG_MACH_DEBUG_TYPES_H_ */ -- cgit v1.2.3