To reorganize the adapters code, introduce an adapter_driver struct that contains all the adapter generic part, while keeping in two separate struct the specific API jtag_ops and swd_ops. Move the allocation of *adapter_driver from the JTAG-specific file core.c to the more adapter-specific file adapter.c While splitting the old jtag_interface for every driver, put the fields in the same order as in the struct declaration so we keep a consistent code across all the drivers. While other transport specific API could/would be added as separate ops, nothing is done here for HLA. Change-Id: I2d60f97ac514c0dd2d93a6ec9be66fd9d388dad5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4900 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
45 lines
2.5 KiB
C
45 lines
2.5 KiB
C
/***************************************************************************
|
|
* Copyright (C) 2005 by Dominic Rath *
|
|
* Dominic.Rath@gmx.de *
|
|
* *
|
|
* Copyright (C) 2007,2008 Øyvind Harboe *
|
|
* oyvind.harboe@zylin.com *
|
|
* *
|
|
* Copyright (C) 2009 SoftPLC Corporation *
|
|
* http://softplc.com *
|
|
* dick@softplc.com *
|
|
* *
|
|
* Copyright (C) 2009 Zachary T Welch *
|
|
* zw@superlucidity.net *
|
|
* *
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
* it under the terms of the GNU General Public License as published by *
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
* (at your option) any later version. *
|
|
* *
|
|
* This program is distributed in the hope that it will be useful, *
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
* GNU General Public License for more details. *
|
|
* *
|
|
* You should have received a copy of the GNU General Public License *
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
***************************************************************************/
|
|
|
|
#ifndef OPENOCD_JTAG_INTERFACES_H
|
|
#define OPENOCD_JTAG_INTERFACES_H
|
|
|
|
/** @file
|
|
* Exports the list of JTAG interface drivers, along with routines
|
|
* for loading and unloading them dynamically from shared libraries.
|
|
*/
|
|
|
|
#include <jtag/interface.h>
|
|
|
|
/** Dynamically load all adapter driver modules from specified directory. */
|
|
void adapter_driver_modules_load(const char *path);
|
|
|
|
extern struct adapter_driver *adapter_drivers[];
|
|
|
|
#endif /* OPENOCD_JTAG_INTERFACES_H */
|