Skip to content

Instantly share code, notes, and snippets.

11-14 11:01:56.568 9767 9767 D GmsMultiArchLoader: Loading mapbox-gl from /data/user/0/com.whatsapp/cache/.gmscore/lib/armeabi-v7a/libmapbox-gl.so
11-14 11:01:56.563 9767 9767 W com.whatsapp: type=1400 audit(0.0:244): avc: granted { execute } for path="/data/data/com.whatsapp/cache/.gmscore/lib/armeabi-v7a/libmapbox-gl.so" dev="mmcblk0p28" ino=26716 scontext=u:r:untrusted_app:s0:c91,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c91,c256,c512,c768 tclass=file app=com.whatsapp
11-14 11:01:56.571 9767 9767 E com.whatsapp: ----- class 'Lcom/mapbox/mapboxsdk/storage/FileSource;' cl=0x12fc7540 -----
11-14 11:01:56.571 9767 9767 E com.whatsapp: objectSize=228 (172 from super)
11-14 11:01:56.571 9767 9767 E com.whatsapp: access=0x8008.0001
11-14 11:01:56.571 9767 9767 E com.whatsapp: super='java.lang.Class<java.lang.Object>' (cl=0x0)
11-14 11:01:56.571 9767 9767 E com.whatsapp: vtable (8 entries, 11 in super):
11-14 11:01:56.571 9767 9767 E com.whatsapp: 0: void com.mapbox.mapboxsdk
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (C) 2024 Paul Cercueil <paul@crapouillou.net>
*/
#ifndef __LIBUDIV_H__
#define __LIBUDIV_H__
#ifdef _MSC_BUILD
# define clz32(x) _lzcnt_u32(x)
#include <math.h>
#include <kos.h>
#include <dc/vmu_fb.h>
KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS);
/* 4x6 font from the Linux kernel:
* https://github.com/torvalds/linux/blob/master/lib/fonts/font_mini_4x6.c
*
* Modified locally to pack the data better. */
@pcercuei
pcercuei / sh4_gcc_test_unroll.c
Last active September 29, 2023 23:00
Small code to test GCC's loop unrolling on SH4
#include <sys/time.h>
#include <stdio.h>
#include <stdint.h>
#include <kos.h>
static const unsigned int test = 8;
KOS_INIT_FLAGS(INIT_DEFAULT);
#include <kos.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "memfuncs.h"
#include "fastmem.h"
#define SIZE 1024 * 1 //16+1
/* Copyright (C) Paul Cercueil <paul@crapouillou.net> */
static void * memcpy_64bit_32Bytes_zcrc(void *dest, const void *src, size_t len) {
if(!len)
return dest;
void * ret_dest = dest;
_Complex float double_scratch;
_Complex float double_scratch2;
@pcercuei
pcercuei / embed.cmake
Last active March 28, 2023 19:14
Embed a binary blob into a C program with CMake
set(EMBEDDED_FILE "" CACHE PATH "Path to the file to embed (optional)")
if (EMBEDDED_FILE)
file(SIZE ${EMBEDDED_FILE} EMBEDDED_FILE_SIZE)
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/empty.c CONTENT "")
set_source_files_properties(${CMAKE_BINARY_DIR}/empty.c PROPERTIES GENERATED TRUE)
add_library(empty OBJECT ${CMAKE_BINARY_DIR}/empty.c)
add_custom_command(OUTPUT payload.o
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
#include <errno.h>
#include <stdlib.h>
#include <stdint.h>
#include <kos.h>
static volatile uint32_t * const pteh = (uint32 *)(0xff000000);
static volatile uint32_t * const ptel = (uint32 *)(0xff000004);
static volatile uint32_t * const mmucr = (uint32 *)(0xff000010);
#include <errno.h>
#include <stdlib.h>
#include <stdint.h>
#include <kos.h>
static volatile uint32_t * const pteh = (uint32 *)(0xff000000);
static volatile uint32_t * const ptel = (uint32 *)(0xff000004);
static volatile uint32_t * const mmucr = (uint32 *)(0xff000010);
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR sh4)
if (NOT DEFINED CMAKE_SYSROOT)
set(CMAKE_SYSROOT $ENV{KOS_PORTS})
endif()
if (NOT DEFINED CMAKE_FIND_ROOT_PATH)
#set(CMAKE_FIND_ROOT_PATH $ENV{KOS_BASE})