X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Falgorithm.c;h=aa8262a6e0de4407950c81765b4ef26cda1b0eaf;hb=c560d9d31b3f46677509246efb2d01a8834944f8;hp=c5ee470857f1274195ddb8b31bc86047814eb8fb;hpb=82d2633b5f550115e9e7c7d0520babb6680aa38f;p=openocd.git diff --git a/src/target/algorithm.c b/src/target/algorithm.c index c5ee470857..aa8262a6e0 100644 --- a/src/target/algorithm.c +++ b/src/target/algorithm.c @@ -15,22 +15,17 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * ***************************************************************************/ + #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "algorithm.h" +#include -#include "log.h" -#include "configuration.h" -#include "binarybuffer.h" - -#include - - -void init_mem_param(mem_param_t *param, u32 address, u32 size, enum param_direction direction) +void init_mem_param(struct mem_param *param, uint32_t address, uint32_t size, enum param_direction direction) { param->address = address; param->size = size; @@ -38,20 +33,22 @@ void init_mem_param(mem_param_t *param, u32 address, u32 size, enum param_direct param->direction = direction; } -void destroy_mem_param(mem_param_t *param) +void destroy_mem_param(struct mem_param *param) { free(param->value); + param->value = NULL; } -void init_reg_param(reg_param_t *param, char *reg_name, u32 size, enum param_direction direction) +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(CEIL(size, 8)); + param->value = malloc(DIV_ROUND_UP(size, 8)); param->direction = direction; } -void destroy_reg_param(reg_param_t *param) +void destroy_reg_param(struct reg_param *param) { free(param->value); + param->value = NULL; }