mirror of
git://git.code.sf.net/p/openocd/code
synced 2025-08-05 22:39:22 +10:00
With the old checkpatch we cannot use the correct format for the SPDX tags in the file .c, in fact the C99 comments are not allowed and we had to use the block comment. With the new checkpatch, let's switch to the correct SPDX format. Change created automatically through the command: sed -i \ 's,^/\* *\(SPDX-License-Identifier: .*[^ ]\) *\*/$,// \1,' \ $(find src/ contrib/ -name \*.c) Change-Id: I6da16506baa7af718947562505dd49606d124171 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7153 Tested-by: jenkins
42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
/***************************************************************************
|
|
* Copyright (C) 2005 by Dominic Rath *
|
|
* Dominic.Rath@gmx.de *
|
|
***************************************************************************/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
|
|
#include "algorithm.h"
|
|
#include <helper/binarybuffer.h>
|
|
|
|
void init_mem_param(struct mem_param *param, uint32_t address, uint32_t size, enum param_direction direction)
|
|
{
|
|
param->address = address;
|
|
param->size = size;
|
|
param->value = malloc(size);
|
|
param->direction = direction;
|
|
}
|
|
|
|
void destroy_mem_param(struct mem_param *param)
|
|
{
|
|
free(param->value);
|
|
param->value = NULL;
|
|
}
|
|
|
|
void init_reg_param(struct reg_param *param, char *reg_name, uint32_t size, enum param_direction direction)
|
|
{
|
|
param->reg_name = reg_name;
|
|
param->size = size;
|
|
param->value = malloc(DIV_ROUND_UP(size, 8));
|
|
param->direction = direction;
|
|
}
|
|
|
|
void destroy_reg_param(struct reg_param *param)
|
|
{
|
|
free(param->value);
|
|
param->value = NULL;
|
|
}
|