mirror of
https://github.com/RPCSX/xed.git
synced 2026-01-31 01:05:17 +01:00
* compiled kit users must refer to "#include "xed/xed-interface.h"
and xed/ on any other public headers that they reference as part
of the kit or new /usr/local installs. Or they can change their
-I flag to include the xed/ path component. All the examples
use xed/ in the #include statements now.
* new knob --prefix=/usr/local (for example) that puts the
compiled library in /usr/local/lib and the headers in
/usr/local/include/xed .
* To install in /usr/local, one typically must sudo. If you do
the whole build at sudo, then it'll create root-owned files in
your build directory whic you might not want. So I suggest
first building as the local user and then sudo only for the
final install.
> ./mfile.py
> sudo ./mfile.py --prefix=/usr/local
* There is also a --prefix-lib-dir knob to specify something other
than "lib" for /usr/local/lib. Some systems use lib, lib32 or
lib64 and I don't know how to tell which is which so I give
users a knob so they can decide for themselves.
> ./mfile.py --host-cpu=ia32
> sudo ./mfile.py --prefix=/usr/local --prefix-lib-dir=lib32
> ./mfile.py --host-cpu=intel64
> sudo ./mfile.py --prefix=/usr/local --prefix-lib-dir=lib64
* added xed-util.h to xed-interface.h
* moved headers from include/public to include/public/xed
* genutil minor cleanup
Change-Id: I3786d2280f24ff8d7e075fa7a75d90f3b28dd8c3
69 lines
1.9 KiB
C
69 lines
1.9 KiB
C
/*BEGIN_LEGAL
|
|
|
|
Copyright (c) 2016 Intel Corporation
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
|
|
END_LEGAL */
|
|
/// @file xed-tester.c
|
|
|
|
#include "xed/xed-interface.h"
|
|
#include <stdio.h>
|
|
|
|
int main(int argc, char** argv);
|
|
|
|
typedef struct
|
|
{
|
|
unsigned int len;
|
|
unsigned char itext[15];
|
|
} xed_test_t;
|
|
|
|
xed_test_t tests[] = {
|
|
{ 2, { 0, 0 } },
|
|
{ 2, { 2, 0 } },
|
|
{ 2, { 0xF3, 0x90 } },
|
|
{ 0 }
|
|
};
|
|
|
|
int main(int argc, char** argv) {
|
|
unsigned int i,j;
|
|
xed_state_t dstate;
|
|
xed_tables_init();
|
|
xed_state_zero(&dstate);
|
|
xed_state_init(&dstate,
|
|
XED_MACHINE_MODE_LEGACY_32,
|
|
XED_ADDRESS_WIDTH_32b,
|
|
XED_ADDRESS_WIDTH_32b);
|
|
for ( i=0; tests[i].len ; i++) {
|
|
xed_bool_t okay;
|
|
xed_error_enum_t xed_error;
|
|
xed_decoded_inst_t xedd;
|
|
xed_decoded_inst_zero_set_mode(&xedd, &dstate);
|
|
printf("Testing: ");
|
|
for( j=0; j< tests[i].len; j++)
|
|
printf("%02x ",XED_STATIC_CAST(unsigned int,tests[i].itext[j]));
|
|
printf("\n");
|
|
|
|
xed_error = xed_decode(&xedd,
|
|
XED_REINTERPRET_CAST(xed_uint8_t*,tests[i].itext),
|
|
tests[i].len);
|
|
|
|
okay = (xed_error == XED_ERROR_NONE);
|
|
if (okay) {
|
|
printf("OK\n");
|
|
}
|
|
}
|
|
(void) argc; (void) argv; //pacify compiler
|
|
return 0;
|
|
}
|