Compare commits

..

No commits in common. "aba6c280b6602d616960a9fadbd32c63c288ce0e" and "b0c4e6fd2fe46211002bfd0efa26612f79285f39" have entirely different histories.

9 changed files with 7 additions and 85 deletions

View file

@ -23,8 +23,6 @@ endif()
configure_file(include/gint/config.h.in include/gint/config.h)
set(SOURCES
# Hardware Abstraction Layer for the standard library
src/fxlibc_hal.c
# Clock Pulse Generator driver
src/cpg/cpg.c
src/cpg/overclock.c
@ -263,7 +261,7 @@ fxconv_declare_assets(${ASSETS_FX} ${ASSETS_CG})
include_directories(
"${PROJECT_SOURCE_DIR}/include"
"${PROJECT_BINARY_DIR}/include")
add_compile_options(-Wall -Wextra -std=c11 -Os -g -fstrict-volatile-bitfields -mtas -flto)
add_compile_options(-Wall -Wextra -std=c11 -Os -g -fstrict-volatile-bitfields -mtas -ffreestanding -flto)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
add_compile_definitions(FX9860G)

View file

@ -43,10 +43,7 @@ SECTIONS
- All text from .text and .text.* (including user code) */
.hh2 : {
KEEP(*(.hh2.header))
KEEP(*(.hh2.info.name))
KEEP(*(.hh2.info.description))
KEEP(*(.hh2.info.author))
KEEP(*(.hh2.info.version))
KEEP(*(.hh2.info))
KEEP(*(.hh2.stage2))
. = ALIGN(16);
} > eram AT> bin

View file

@ -80,26 +80,4 @@
#define GINT_RENDER_MONO (GINT_HW_FX || GINT_FX9860G_G3A)
#define GINT_RENDER_RGB ((GINT_HW_CG || GINT_HW_CP) && !GINT_FX9860G_G3A)
/* Macros for specifying HH2 binary metadata fields. Here because this header
is guaranteed to be included with every gint header. */
#if GINT_HW_CP
#define HH2_NAME(STR) \
GSECTION(".hh2.info.name") GVISIBLE \
char _hh2info_name[] = (STR);
#define HH2_DESCRIPTION(STR) \
GSECTION(".hh2.info.description") GVISIBLE \
char _hh2info_description[] = (STR);
#define HH2_AUTHOR(STR) \
GSECTION(".hh2.info.author") GVISIBLE \
char _hh2info_author[] = (STR);
#define HH2_VERSION(STR) \
GSECTION(".hh2.info.version") GVISIBLE \
char _hh2info_version[] = (STR);
#else
#define HH2_NAME(STR)
#define HH2_DESCRIPTION(STR)
#define HH2_AUTHOR(STR)
#define HH2_VERSION(STR)
#endif
#endif /* GINT_CONFIG */

View file

@ -11,8 +11,6 @@
#ifndef GINT_DEFS_CALL
#define GINT_DEFS_CALL
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
@ -40,7 +38,6 @@ typedef union {
type volatile const *name ## _cv;
POINTER(void, pv)
POINTER(bool, pb)
POINTER(char, pc)
POINTER(unsigned char, puc)
POINTER(short, ps)

View file

@ -1,40 +0,0 @@
/* Hardware Abstraction Layer (HAL) implementation for fxlibc. We can group
this in a single file because LTO will prune away unused functions. */
#include <fxlibc/hal.h>
#include <gint/rtc.h>
#include <gint/kmalloc.h>
#include <errno.h>
void *fxlibc_hal_malloc(size_t size)
{
return kmalloc(size, NULL);
}
void fxlibc_hal_free(void *ptr)
{
return kfree(ptr);
}
void *fxlibc_hal_realloc(void *ptr, size_t size)
{
return krealloc(ptr, size);
}
void fxlibc_hal_rawtime(struct tm *tm)
{
rtc_time_t rtc;
rtc_get_time(&rtc);
tm->tm_sec = rtc.seconds;
tm->tm_min = rtc.minutes;
tm->tm_hour = rtc.hours;
tm->tm_mday = rtc.month_day;
tm->tm_mon = rtc.month;
tm->tm_year = rtc.year - 1900;
tm->tm_isdst = 0;
}
clock_t fxlibc_hal_clock(void)
{
return (CLOCKS_PER_SEC * (uint64_t)rtc_ticks()) / 128;
}

View file

@ -629,7 +629,7 @@ static bool gdb_handle_stubcall(gdb_cpu_state_t* cpu_state)
int sc_num = cpu_state->reg.r3;
if(sc_num == 64) { /* write */
int len = snprintf(str, sizeof str, "Fwrite,%lx,%08lx,%lx",
int len = snprintf(str, sizeof str, "Fwrite,%x,%08x,%x",
cpu_state->reg.r4,
cpu_state->reg.r5,
cpu_state->reg.r6);

View file

@ -122,12 +122,4 @@ _stage2:
it's overriding the correct location. */
.long 1, 2, 3, 4, 5, 6, 7, 8
/* Also provide default values for metadata fields. */
.section .hh2.info.name
.global __hh2info_name
.weak __hh2info_name
/* Zero byte will skip specifiying any of the data */
__hh2info_name: .byte 0x00
#endif /* GINT_OS_CP */

View file

@ -247,7 +247,7 @@ static void prepend_link(block_t *b, index_t *index)
//---
/* Round a size to the closest allocatable size */
static size_t round_size(size_t size)
static size_t round(size_t size)
{
return (size < 8) ? 8 : ((size + 3) & ~3);
}
@ -256,7 +256,7 @@ static void *gint_malloc(size_t size, void *data)
{
index_t *index = data;
stats_t *s = index->stats;
size = round_size(size);
size = round(size);
int c = size_class(size);
/* Try to find a class that has a free block available */
@ -330,7 +330,7 @@ static void *gint_realloc(void *ptr, size_t size, void *data)
index_t *index = data;
stats_t *s = index->stats;
block_t *b = ptr - sizeof(block_t);
size = round_size(size);
size = round(size);
int size_before = b->size;
/* When requesting a smaller size, split the original block */

View file

@ -539,7 +539,7 @@ static void USB_LOG_TR(char const *p, asyncio_op_t *t, char const *fmt, ...)
if(t->shbuf_size >= 4)
sprintf(shbuf, "!!%d", t->shbuf_size);
else
snprintf(shbuf, t->shbuf_size * 2 + 1, "%08lx", t->shbuf);
snprintf(shbuf, t->shbuf_size * 2 + 1, "%08x", t->shbuf);
char str[128];
snprintf(str, sizeof str - 1, "%s: %s buf=%d%s%s req=%d/%d%s |%s| ",