linux/drivers/hwtracing/coresight/coresight-syscfg-configfs.h
Mike Leach 02bd588e12 coresight: configuration: Update API to permit dynamic load/unload
Expand the configuration API to allow dynamic runtime load and unload of
configurations and features.

On load, configurations and features are tagged with a "load owner" that
is used to determine sets that were loaded together in a given API call.

To unload the API uses the load owner to unload all elements previously
loaded by that owner.

The API also records the order in which different owners loaded
their elements into the system. Later loading configurations can use
previously loaded features, creating load dependencies. Therefore unload
is enforced strictly in the reverse order to load.

A load owner will be an additional loadable module, or a configuration
loaded via configfs.

Signed-off-by: Mike Leach <mike.leach@linaro.org>
Link: https://lore.kernel.org/r/20211124200038.28662-3-mike.leach@linaro.org
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2021-11-26 11:27:35 -07:00

48 lines
1.3 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Coresight system configuration driver - support for configfs.
*/
#ifndef CORESIGHT_SYSCFG_CONFIGFS_H
#define CORESIGHT_SYSCFG_CONFIGFS_H
#include <linux/configfs.h>
#include "coresight-syscfg.h"
#define CSCFG_FS_SUBSYS_NAME "cs-syscfg"
/* container for configuration view */
struct cscfg_fs_config {
struct cscfg_config_desc *config_desc;
struct config_group group;
};
/* container for feature view */
struct cscfg_fs_feature {
struct cscfg_feature_desc *feat_desc;
struct config_group group;
};
/* container for parameter view */
struct cscfg_fs_param {
int param_idx;
struct cscfg_feature_desc *feat_desc;
struct config_group group;
};
/* container for preset view */
struct cscfg_fs_preset {
int preset_num;
struct cscfg_config_desc *config_desc;
struct config_group group;
};
int cscfg_configfs_init(struct cscfg_manager *cscfg_mgr);
void cscfg_configfs_release(struct cscfg_manager *cscfg_mgr);
int cscfg_configfs_add_config(struct cscfg_config_desc *config_desc);
int cscfg_configfs_add_feature(struct cscfg_feature_desc *feat_desc);
void cscfg_configfs_del_config(struct cscfg_config_desc *config_desc);
void cscfg_configfs_del_feature(struct cscfg_feature_desc *feat_desc);
#endif /* CORESIGHT_SYSCFG_CONFIGFS_H */