Rizin
unix-like reverse engineering framework and cli tools
rz_platform.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2021-2022 RizinOrg <info@rizin.re>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #ifndef RZ_PLATFORM_H
5 #define RZ_PLATFORM_H
6 
7 #include <rz_config.h>
8 #include <rz_flag.h>
9 #include <rz_il.h>
10 #include <sdb.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 typedef struct rz_platform_profile_t {
27  HtUP /* <ut64 , char *> */ *registers_mmio;
28  HtUP /* <ut64 , char *> */ *registers_extended;
30 
31 typedef struct rz_platform_target_t {
32  char *cpu;
33  char *arch;
36 
37 typedef struct rz_platform_item_t {
38  char *name;
39  char *comment;
41 
43  HtUP /* <ut64 , RzPlatformItem> */ *platforms;
44  char *path;
46 
51 RZ_API bool rz_platform_profiles_init(RzPlatformTarget *c, const char *cpu, const char *arch, const char *cpus_dir);
56 
63  const char *platform, RZ_NONNULL const char *platforms_dir);
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif /* RZ_PLATFORM_H */
static ut32 cpu[32]
Definition: analysis_or1k.c:21
#define RZ_API
cs_arch arch
Definition: cstool.c:13
static static fork const void static count static fd const char const char static newpath const char static path const char path
Definition: sflib.h:35
RZ_API bool rz_platform_target_index_init(RzPlatformTargetIndex *t, RZ_NONNULL const char *arch, RZ_NONNULL const char *cpu, const char *platform, RZ_NONNULL const char *platforms_dir)
Initialize Platform Profiles by setting the path to the corresponding SDB file.
RZ_API void rz_platform_item_free(RzPlatformItem *item)
Frees an RzPlatformItem type.
struct rz_platform_target_t RzPlatformTarget
RZ_API bool rz_platform_target_index_load_sdb(RZ_NONNULL RzPlatformTargetIndex *t, RZ_NONNULL const char *path)
Loads the contents of the Platform Profile to the RzPlatformTargetIndex.
RZ_API RZ_OWN RzPlatformItem * rz_platform_item_new(RZ_NULLABLE const char *name)
Creates a new RzPlatformItem type.
RZ_API bool rz_platform_profiles_init(RzPlatformTarget *c, const char *cpu, const char *arch, const char *cpus_dir)
Initializes RzPlatformProfile by loading the path to the SDB file of the CPU profile.
struct rz_platform_item_t RzPlatformItem
RZ_API void rz_platform_target_index_free(RzPlatformTargetIndex *target)
Frees an RzPlatformTargetIndex type.
RZ_API void rz_platform_target_free(RzPlatformTarget *target)
Frees an RzPlatformTarget type.
struct rz_platform_target_index_t RzPlatformTargetIndex
struct rz_platform_profile_t RzPlatformProfile
RZ_API RZ_BORROW const char * rz_platform_profile_resolve_extended_register(RZ_NONNULL RzPlatformProfile *profile, ut64 address)
Resolves an address and returns the linked extended register.
RZ_API bool rz_platform_load_profile_sdb(RzPlatformTarget *t, const char *path)
Loads the contents of the CPU Profile to the RzPlatformProfile.
RZ_API void rz_platform_profile_free(RzPlatformProfile *profile)
Frees an RzPlatformProfile type.
RZ_API RZ_BORROW const char * rz_platform_profile_resolve_mmio(RZ_NONNULL RzPlatformProfile *profile, ut64 address)
Resolves an address and returns the linked mmio.
RZ_API void rz_platform_profile_add_flag_every_io(RzPlatformProfile *profile, RzFlag *flags)
Adds the IO and extended IO registers from the CPU profiles as flags.
Definition: canalysis.c:5236
RZ_API RZ_OWN RzPlatformTargetIndex * rz_platform_target_index_new()
Creates a new RzPlatformTargetIndex type.
RZ_API RZ_OWN RzPlatformTarget * rz_platform_target_new()
Creates a new RzPlatformTarget type.
RZ_API RZ_OWN RzPlatformProfile * rz_platform_profile_new()
Creates a new RzPlatformProfile type.
#define RZ_NULLABLE
Definition: rz_types.h:65
#define RZ_OWN
Definition: rz_types.h:62
#define RZ_NONNULL
Definition: rz_types.h:64
#define RZ_BORROW
Definition: rz_types.h:63
static struct sockaddr static addrlen static backlog const void static flags void flags
Definition: sfsocketcall.h:123
#define c(i)
Definition: sha256.c:43
Definition: z80asm.h:102
char * path
Path used to load the platforms, used to avoid reloading.
Definition: rz_platform.h:44
RzPlatformProfile * profile
Definition: rz_platform.h:34
ut64(WINAPI *w32_GetEnabledXStateFeatures)()