/*
* dbdcd.c
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* This file contains the implementation of the DSP/BIOS Bridge
* Configuration Database (DCD).
*
* Notes:
* The fxn dcd_get_objects can apply a callback fxn to each DCD object
* that is located in a specified COFF file. At the moment,
* dcd_auto_register, dcd_auto_unregister, and NLDR module all use
* dcd_get_objects.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <linux/types.h>
/* ----------------------------------- Host OS */
#include <dspbridge/host_os.h>
/* ----------------------------------- DSP/BIOS Bridge */
#include <dspbridge/dbdefs.h>
/* ----------------------------------- Platform Manager */
#include <dspbridge/cod.h>
/* ----------------------------------- Others */
#include <dspbridge/uuidutil.h>
/* ----------------------------------- This */
#include <dspbridge/dbdcd.h>
/* ----------------------------------- Global defines. */
#define MAX_INT2CHAR_LENGTH 16 /* Max int2char len of 32 bit int */
/* Name of section containing dependent libraries */
#define DEPLIBSECT ".dspbridge_deplibs"
/* DCD specific structures. */
struct dcd_manager {
struct cod_manager *cod_mgr; /* Handle to COD manager object. */
};
/* Pointer to the registry support key */
static struct list_head reg_key_list;
static DEFINE_SPINLOCK(dbdcd_lock);
/* Global reference variables. */
static u32 refs;
static u32 enum_refs;
/* Helper function prototypes. */
static s32 atoi(char *psz_buf);
static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size,
enum dsp_dcdobjtype obj_type,
struct dcd_genericobj *gen_obj);
static void compress_buf(char *psz_buf, u32 ul_buf_size, s32 char_size);
static char dsp_char2_gpp_char(char *word, s32 dsp_char_size);
static int get_dep_lib_info(struct dcd_manager *