Skip to content

Commit 3a67572

Browse files
committed
Updated to the latest MBI interface. Bug fixes. Makefile updates.
1 parent 8101cb8 commit 3a67572

File tree

7 files changed

+35
-128
lines changed

7 files changed

+35
-128
lines changed

Products/ESIF_LF/Sources/esif_lf_ccb_mbi.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@
136136
#ifdef ESIF_ATTR_KERNEL
137137

138138
#ifdef ESIF_ATTR_IOSF
139-
extern u32 bt_mbi_read(u8, u8, u32, u32*);
140-
extern u32 bt_mbi_write(u8, u8, u32, u32);
139+
#include <asm/iosf_mbi.h>
141140
#endif
142141

143142
/* MBI Read 32 */
@@ -155,7 +154,7 @@ static ESIF_INLINE enum esif_rc esif_ccb_mbi_read(
155154

156155
#else
157156
#ifdef ESIF_ATTR_IOSF
158-
return bt_mbi_read(port, 0x10, punit, val_ptr);
157+
return iosf_mbi_read(port, 0x10, punit, val_ptr);
159158
#else
160159
*val_ptr = 0;
161160
return ESIF_E_NOT_IMPLEMENTED;
@@ -179,7 +178,7 @@ static ESIF_INLINE enum esif_rc esif_ccb_mbi_write(
179178
return esif_lf_win_mbi_write(MCR, val);
180179
#else
181180
#ifdef ESIF_ATTR_IOSF
182-
return bt_mbi_write(port, 0x11, punit, val);
181+
return iosf_mbi_write(port, 0x11, punit, val);
183182
#else
184183
return ESIF_E_NOT_IMPLEMENTED;
185184

Products/ESIF_UF/Androidx86/jni/Android.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
################################################################################
1818
include $(CLEAR_VARS)
1919

20-
LOCAL_PATH := ../../
21-
LOCAL_CFLAGS := -DESIF_ATTR_OS_ANDROID -DESIF_ATTR_USER -Wno-multichar
22-
LOCAL_MODULE := esif_uf
23-
LOCAL_C_INCLUDES := ../../ESIF_CM/Sources ../../ESIF_UF/Sources ../../ESIF_WS/Sources ../../ESIF_LIB/Sources
20+
LOCAL_PATH := ../../../
21+
LOCAL_CFLAGS := -DESIF_ATTR_OS_ANDROID -DESIF_ATTR_DAEMON -DESIF_ATTR_USER -Wno-multichar
22+
LOCAL_MODULE := esif_ufd
23+
LOCAL_C_INCLUDES := ../../../ESIF_CM/Sources ../../../ESIF_UF/Sources ../../../ESIF_WS/Sources ../../../ESIF_LIB/Sources
2424

2525
LOCAL_SRC_FILES := ESIF_UF/Sources/lin/main.c
2626
LOCAL_SRC_FILES += ESIF_LF/Sources/lin/esif_ipc_os_lin.c

Products/ESIF_UF/Chrome86/Makefile renamed to Products/ESIF_UF/Chrome/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ ESIF_LIB_SOURCES := $(ESIF_SOURCES)/ESIF_LIB/Sources
2929

3030
LDLIBS := -lpthread -ldl -lrt
3131

32-
CFLAGS ?= -m32
3332
CFLAGS += -Wno-multichar
3433
CPPFLAGS += -I$(ESIF_UF_SOURCES) -I$(ESIF_CM_SOURCES) -I$(ESIF_LF_SOURCES)
3534
CPPFLAGS += -I$(ESIF_WS_SOURCES) -I$(ESIF_LIB_SOURCES)

Products/ESIF_UF/Chrome64/Makefile

Lines changed: 0 additions & 106 deletions
This file was deleted.

Products/ESIF_UF/Sources/esif_uf.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,14 @@ extern int EsifConsole_WriteLogFile(const char *format, va_list args);
8484
//
8585
// Set Architecture
8686
//
87-
#ifdef ESIF_ATTR_64BIT
88-
#if defined(ESIF_ATTR_OS_LINUX) || defined(ESIF_ATTR_OS_ANDROID) || \
89-
defined(ESIF_ATTR_OS_CHROME)
90-
#define ESIF_DIR_PRG NULL
91-
#define ESIF_DIR_DPTF_POL "/usr/share/dptf"
92-
#else
93-
#define ESIF_DIR_PRG "ufx64"
94-
#define ESIF_DIR_DPTF_POL "ufx64"
95-
#endif
87+
#if defined(ESIF_ATTR_OS_LINUX) || defined(ESIF_ATTR_OS_ANDROID) || \
88+
defined(ESIF_ATTR_OS_CHROME)
89+
// No differentiation for 32-bit or 64-bit *nix build
90+
#define ESIF_DIR_PRG NULL
91+
#define ESIF_DIR_DPTF_POL "/usr/share/dptf"
92+
#elif defined(ESIF_ATTR_64BIT)
93+
#define ESIF_DIR_PRG "ufx64"
94+
#define ESIF_DIR_DPTF_POL "ufx64"
9695
#else
9796
#define ESIF_DIR_PRG "ufx86"
9897
#define ESIF_DIR_DPTF_POL "ufx86"

Products/ESIF_UF/Sources/esif_uf_shell.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ char g_esif_kernel_version[64] = "NA";
5959
#include "esif_uf_app.h"
6060
extern struct esif_uf_dm g_dm;
6161

62+
#if defined(ESIF_ATTR_OS_LINUX) || defined(ESIF_ATTR_OS_CHROME)
63+
#include <sys/utsname.h>
64+
#endif
65+
6266
#ifdef ESIF_ATTR_OS_WINDOWS
6367
//
6468
// The Windows banned-API check header must be included after all other headers, or issues can be identified
@@ -314,11 +318,23 @@ void esif_init()
314318
{
315319
char command[64];
316320

317-
EsifString os_arch = NULL;
321+
EsifString os_arch = (EsifString)"Unknown";
318322
EsifString build = NULL;
319323
static u8 first = ESIF_TRUE;
320324

321-
#ifdef ESIF_ATTR_64BIT
325+
#if defined(ESIF_ATTR_OS_LINUX) || defined(ESIF_ATTR_OS_CHROME)
326+
// For Linux/Chrome we use uname system call to obtain archtecture string
327+
// By doing so we can merge the two 32-bit and 64-bit makefiles into one
328+
struct utsname kernel_name;
329+
const EsifString x64_str="x86_64";
330+
const EsifString x86_str="i686";
331+
if (!uname(&kernel_name)) {
332+
if (!strncmp(kernel_name.machine, x64_str, strlen(x64_str)))
333+
os_arch = (EsifString)"x64";
334+
else if (!strncmp(kernel_name.machine, x86_str, strlen(x86_str)))
335+
os_arch = (EsifString)"x86";
336+
}
337+
#elif defined(ESIF_ATTR_64BIT)
322338
os_arch = (EsifString)"x64";
323339
#else
324340
os_arch = (EsifString)"x86";

Products/ESIF_WS/Sources/esif_ws_socket.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,11 @@ void esif_ws_socket_build_payload (
303303
} else if (dataLength <= 0xFFFF) {
304304
outgoingFrame[1] = 126;
305305
payLoadLength = htons((UInt16)dataLength);
306-
esif_ccb_memcpy(&outgoingFrame[2], &payLoadLength, 2);
306+
esif_ccb_memcpy(&outgoingFrame[2], &payLoadLength, sizeof(UInt16));
307307
*outgoingFrameLenght = 4;
308308
} else {
309309
outgoingFrame[1] = 127;
310-
esif_ccb_memcpy(&outgoingFrame[2], &dataLength, 8);
310+
esif_ccb_memcpy(&outgoingFrame[2], &dataLength, sizeof(size_t));
311311
*outgoingFrameLenght = 10;
312312
}
313313

0 commit comments

Comments
 (0)