Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zipr-sdk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
zipr-sdk
Commits
3f99e854
Commit
3f99e854
authored
9 years ago
by
whh8b
Browse files
Options
Downloads
Patches
Plain Diff
Update ZiprSDK API so plugins can plop insns
parent
976e19c0
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitattributes
+1
-0
1 addition, 0 deletions
.gitattributes
include/zipr.h
+69
-0
69 additions, 0 deletions
include/zipr.h
include/zipr_plugin.h
+20
-2
20 additions, 2 deletions
include/zipr_plugin.h
include/zipr_sdk.h
+1
-0
1 addition, 0 deletions
include/zipr_sdk.h
with
91 additions
and
2 deletions
.gitattributes
+
1
−
0
View file @
3f99e854
...
...
@@ -3,6 +3,7 @@
/SDK_VERSION -text
include/memory_space.h -text
include/range.h -text
include/zipr.h -text
include/zipr_options.h -text
include/zipr_plugin.h -text
include/zipr_sdk.h -text
This diff is collapsed.
Click to expand it.
include/zipr.h
0 → 100644
+
69
−
0
View file @
3f99e854
/***************************************************************************
* Copyright (c) 2014 Zephyr Software LLC. All rights reserved.
*
* This software is furnished under a license and/or other restrictive
* terms and may be used and copied only in accordance with such terms
* and the inclusion of the above copyright notice. This software or
* any other copies thereof may not be provided or otherwise made
* available to any other person without the express written consent
* of an authorized representative of Zephyr Software LCC. Title to,
* ownership of, and all rights in the software is retained by
* Zephyr Software LCC.
*
* Zephyr Software LLC. Proprietary Information
*
* Unless otherwise specified, the information contained in this
* directory, following this legend, and/or referenced herein is
* Zephyr Software LLC. (Zephyr) Proprietary Information.
*
* CONTACT
*
* For technical assistance, contact Zephyr Software LCC. at:
*
*
* Zephyr Software, LLC
* 2040 Tremont Rd
* Charlottesville, VA 22911
*
* E-mail: jwd@zephyr-software.com
**************************************************************************/
#ifndef zipr_h
#define zipr_h
class
Zipr_t
{
public:
Zipr_t
()
{};
protected
:
/*
* Private, but listing them here so that SDK users
* can get a sense of the overall flow of the rewriter.
*/
virtual
void
FindFreeRanges
(
const
std
::
string
&
name
)
=
0
;
virtual
void
AddPinnedInstructions
()
=
0
;
virtual
void
ReservePinnedInstructions
()
=
0
;
virtual
void
PreReserve2ByteJumpTargets
()
=
0
;
virtual
void
ExpandPinnedInstructions
()
=
0
;
virtual
void
Fix2BytePinnedInstructions
()
=
0
;
virtual
void
OptimizePinnedInstructions
()
=
0
;
virtual
void
OptimizePinnedFallthroughs
()
=
0
;
virtual
void
AskPluginsAboutPlopping
()
=
0
;
virtual
void
PlopTheUnpinnedInstructions
()
=
0
;
virtual
void
UpdateCallbacks
()
=
0
;
virtual
void
PrintStats
()
=
0
;
virtual
void
RecordPinnedInsnAddrs
()
=
0
;
public
:
/*
* These are public functions that the SDK user
* way want to use.
*/
virtual
int
DetermineWorstCaseInsnSize
(
libIRDB
::
Instruction_t
*
)
=
0
;
virtual
Zipr_SDK
::
RangeAddress_t
PlopInstruction
(
libIRDB
::
Instruction_t
*
insn
,
Zipr_SDK
::
RangeAddress_t
addr
)
=
0
;
virtual
Zipr_SDK
::
RangeAddress_t
PlopWithTarget
(
libIRDB
::
Instruction_t
*
insn
,
Zipr_SDK
::
RangeAddress_t
at
)
=
0
;
virtual
Zipr_SDK
::
RangeAddress_t
PlopWithCallback
(
libIRDB
::
Instruction_t
*
insn
,
Zipr_SDK
::
RangeAddress_t
at
)
=
0
;
};
#endif
This diff is collapsed.
Click to expand it.
include/zipr_plugin.h
+
20
−
2
View file @
3f99e854
namespace
Zipr_SDK
{
typedef
std
::
map
<
libIRDB
::
Instruction_t
*
,
Zipr_SDK
::
RangeAddress_t
>
InstructionLocationMap_t
;
class
ZiprPluginInterface_t
...
...
@@ -15,6 +13,26 @@ class ZiprPluginInterface_t
virtual
void
CallbackLinkingBegin
()
=
0
;
virtual
void
CallbackLinkingEnd
()
=
0
;
virtual
bool
WillPluginPlop
(
libIRDB
::
Instruction_t
*
)
{
return
false
;
}
virtual
int
WorstCaseInsnSize
(
libIRDB
::
Instruction_t
*
,
Zipr_t
*
)
{
return
0
;
}
virtual
RangeAddress_t
PlopInstruction
(
libIRDB
::
Instruction_t
*
,
RangeAddress_t
,
RangeAddress_t
&
,
Zipr_t
*
)
{
return
0
;
}
virtual
std
::
string
ToString
()
{
return
"NamelessPlugin"
;
}
};
}
This diff is collapsed.
Click to expand it.
include/zipr_sdk.h
+
1
−
0
View file @
3f99e854
...
...
@@ -48,6 +48,7 @@
// SDK internals
#include
<range.h>
#include
<zipr.h>
#include
<memory_space.h>
#include
<zipr_options.h>
#include
<zipr_plugin.h>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment