From 2c062acbdcb884fd1c93b9bca0fab3a3c18e105c Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 16 Jan 2010 07:34:43 +0800 Subject: [PATCH] Slight changes to UDI structures and logging --- Kernel/Makefile.BuildNum | 2 +- Kernel/include/acess.h | 3 ++- Modules/UDI/include/udi/init.h | 4 +-- Modules/UDI/main.c | 46 +++++++++++++++++++++++++--------- 4 files changed, 39 insertions(+), 16 deletions(-) diff --git a/Kernel/Makefile.BuildNum b/Kernel/Makefile.BuildNum index 87dafb4e..d026f564 100644 --- a/Kernel/Makefile.BuildNum +++ b/Kernel/Makefile.BuildNum @@ -1 +1 @@ -BUILD_NUM = 1342 +BUILD_NUM = 1353 diff --git a/Kernel/include/acess.h b/Kernel/include/acess.h index e1131ef4..efc925eb 100644 --- a/Kernel/include/acess.h +++ b/Kernel/include/acess.h @@ -6,6 +6,7 @@ #define _COMMON_H #define NULL ((void*)0) +#define PACKED __attribute__ ((packed)) #include #include @@ -73,7 +74,7 @@ typedef void (*tThreadFunction)(void*); */ typedef struct sKernelSymbol { char *Name; - unsigned int Value; + Uint Value; } tKernelSymbol; #define EXPORT(_name) tKernelSymbol _kexp_##_name __attribute__((section ("KEXPORT"),unused))={#_name, (Uint)_name} #define EXPORTV(_name) tKernelSymbol _kexp_##_name __attribute__((section ("KEXPORT"),unused))={#_name, (Uint)&_name} diff --git a/Modules/UDI/include/udi/init.h b/Modules/UDI/include/udi/init.h index fc69950f..f405d036 100644 --- a/Modules/UDI/include/udi/init.h +++ b/Modules/UDI/include/udi/init.h @@ -275,7 +275,7 @@ struct udi_limits_s * \see ::udi_timer_start_repeating, ::udi_timer_start */ udi_ubit32_t min_timer_res; -}; +} PACKED; /** * \brief Primary Region Context data @@ -295,7 +295,7 @@ struct udi_chan_context_s * \brief Pointer to the driver instance's initial region data */ void *rdata; -}; +} PACKED; /** * \brief Child Channel context diff --git a/Modules/UDI/main.c b/Modules/UDI/main.c index 0f5e45b1..75ff3431 100644 --- a/Modules/UDI/main.c +++ b/Modules/UDI/main.c @@ -32,7 +32,8 @@ int UDI_LoadDriver(void *Base) udi_init_t *info; char *udiprops = NULL; int udiprops_size; - int i, j; + int i; + // int j; Log("UDI_LoadDriver: (Base=%p)", Base); @@ -48,23 +49,44 @@ int UDI_LoadDriver(void *Base) Binary_FindSymbol(Base, "_udiprops_size", (Uint*)&udiprops_size); } - Log("primary_init_info = %p", info->primary_init_info); + Log("primary_init_info = %p = {", info->primary_init_info); + { + Log(" .mgmt_ops = %p = {", info->primary_init_info->mgmt_ops); + Log(" .usage_ind_op: %p() - 0x%02x", + info->primary_init_info->mgmt_ops->usage_ind_op, + info->primary_init_info->mgmt_op_flags[0] + ); + Log(" .enumerate_req_op: %p() - 0x%02x", + info->primary_init_info->mgmt_ops->enumerate_req_op, + info->primary_init_info->mgmt_op_flags[1] + ); + Log(" .devmgmt_req_op: %p() - 0x%02x", + info->primary_init_info->mgmt_ops->devmgmt_req_op, + info->primary_init_info->mgmt_op_flags[2] + ); + Log(" .final_cleanup_req_op: %p() - 0x%02x", + info->primary_init_info->mgmt_ops->final_cleanup_req_op, + info->primary_init_info->mgmt_op_flags[3] + ); + Log(" }"); + Log(" .mgmt_scratch_requirement = 0x%x", info->primary_init_info->mgmt_scratch_requirement); + Log(" .enumeration_attr_list_length = 0x%x", info->primary_init_info->enumeration_attr_list_length); + Log(" .rdata_size = 0x%x", info->primary_init_info->rdata_size); + Log(" .child_data_size = 0x%x", info->primary_init_info->child_data_size); + Log(" .per_parent_paths = 0x%x", info->primary_init_info->per_parent_paths); + } + Log("}"); Log("secondary_init_list = %p", info->secondary_init_list); Log("ops_init_list = %p", info->ops_init_list); for( i = 0; info->ops_init_list[i].ops_idx; i++ ) { Log("info->ops_init_list[%i] = {", i); - Log(" .ops_idx = %i", info->ops_init_list[i].ops_idx); - Log(" .meta_idx = %i", info->ops_init_list[i].meta_idx); - Log(" .meta_ops_num = %i", info->ops_init_list[i].meta_ops_num); - Log(" .chan_context_size = %i", info->ops_init_list[i].chan_context_size); - Log(" .ops_vector = {"); - for( j = 0; info->ops_init_list[i].ops_vector; j++ ) - { - Log("%i: %p()", j, info->ops_init_list[i].ops_vector); - } - Log(" }"); + Log(" .ops_idx = 0x%x", info->ops_init_list[i].ops_idx); + Log(" .meta_idx = 0x%x", info->ops_init_list[i].meta_idx); + Log(" .meta_ops_num = 0x%x", info->ops_init_list[i].meta_ops_num); + Log(" .chan_context_size = 0x%x", info->ops_init_list[i].chan_context_size); + Log(" .ops_vector = %p", info->ops_init_list[i].ops_vector); Log(" .op_flags = %p", info->ops_init_list[i].op_flags); Log("}"); } -- 2.20.1