You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(35) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(37) |
Feb
(10) |
Mar
|
Apr
(2) |
May
(17) |
Jun
(1) |
Jul
(14) |
Aug
(14) |
Sep
(4) |
Oct
|
Nov
(14) |
Dec
(4) |
2005 |
Jan
(6) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(92) |
Dec
(12) |
2006 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(5) |
May
(3) |
Jun
(15) |
Jul
(3) |
Aug
(1) |
Sep
(29) |
Oct
(1) |
Nov
(6) |
Dec
(5) |
2007 |
Jan
(2) |
Feb
(2) |
Mar
|
Apr
(3) |
May
(14) |
Jun
(2) |
Jul
(16) |
Aug
(73) |
Sep
(12) |
Oct
(9) |
Nov
(27) |
Dec
(3) |
2008 |
Jan
(4) |
Feb
(4) |
Mar
(3) |
Apr
(8) |
May
(23) |
Jun
(4) |
Jul
(1) |
Aug
(3) |
Sep
(7) |
Oct
(5) |
Nov
(1) |
Dec
(1) |
2009 |
Jan
|
Feb
(10) |
Mar
|
Apr
(4) |
May
(4) |
Jun
(10) |
Jul
|
Aug
(1) |
Sep
|
Oct
(7) |
Nov
|
Dec
(1) |
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
|
Jun
(3) |
Jul
(11) |
Aug
(1) |
Sep
|
Oct
(15) |
Nov
(1) |
Dec
(5) |
2011 |
Jan
(4) |
Feb
(1) |
Mar
(6) |
Apr
|
May
(22) |
Jun
|
Jul
(8) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2012 |
Jan
|
Feb
(10) |
Mar
(1) |
Apr
(6) |
May
(27) |
Jun
(48) |
Jul
(30) |
Aug
(4) |
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(11) |
2013 |
Jan
(4) |
Feb
(7) |
Mar
(6) |
Apr
(18) |
May
(28) |
Jun
(20) |
Jul
|
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(7) |
2014 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(9) |
May
(11) |
Jun
(10) |
Jul
|
Aug
(18) |
Sep
(12) |
Oct
(17) |
Nov
(10) |
Dec
(16) |
2015 |
Jan
(5) |
Feb
(1) |
Mar
(5) |
Apr
(4) |
May
(28) |
Jun
(2) |
Jul
|
Aug
|
Sep
(6) |
Oct
|
Nov
(2) |
Dec
(1) |
2016 |
Jan
(14) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(1) |
2017 |
Jan
(11) |
Feb
|
Mar
(21) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(4) |
Oct
(4) |
Nov
|
Dec
(1) |
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(13) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
(10) |
Feb
(9) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(18) |
Jul
(4) |
Aug
(2) |
Sep
(20) |
Oct
(2) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2022 |
Jan
(1) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2023 |
Jan
(10) |
Feb
(7) |
Mar
(29) |
Apr
(31) |
May
(29) |
Jun
(34) |
Jul
(3) |
Aug
(24) |
Sep
(22) |
Oct
(10) |
Nov
(38) |
Dec
(27) |
2024 |
Jan
(15) |
Feb
(8) |
Mar
(4) |
Apr
(20) |
May
(33) |
Jun
(18) |
Jul
(15) |
Aug
(23) |
Sep
(26) |
Oct
(32) |
Nov
(6) |
Dec
(4) |
2025 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
(4) |
May
(46) |
Jun
(19) |
Jul
(26) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Lawrence S. <ljs...@us...> - 2016-07-02 02:23:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 5b9c8118204ddda14526a9e70e7e7a1f35271bd8 (commit) from 112df1a4753657d90a908027bb36330c82bc4767 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5b9c8118204ddda14526a9e70e7e7a1f35271bd8 Author: Lawrence Sebald <ljs...@us...> Date: Fri Jul 1 22:22:28 2016 -0400 Update the GDB and Insight versions for dc-chain. Thanks to Corbin for pointing out there was an issue with the upstream source for these two programs (the version we were using has been removed entirely from both). Thanks to Nia for making sure that GDB built fine with the newer version. ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/Makefile | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/utils/dc-chain/Makefile b/utils/dc-chain/Makefile index 3e5a8a1..41bd1da 100644 --- a/utils/dc-chain/Makefile +++ b/utils/dc-chain/Makefile @@ -31,8 +31,8 @@ kos_base=$(CURDIR)/../.. binutils_ver=2.23.2 gcc_ver=4.7.3 newlib_ver=2.0.0 -gdb_ver=6.7.1 -insight_ver=6.7.1 +gdb_ver=7.11.1 +insight_ver=6.8-1 # With GCC 4.x versions, the patches provide a kos thread model, so you should # use it. With 3.4.6, you probably want posix here. If you really don't want @@ -95,7 +95,7 @@ patch_targets=patch-binutils patch-gcc patch-newlib patch-kos patch: $(patch_targets) patch-binutils: $(binutils_patches) patch-gcc: $(gcc_patches) -patch-newlib: $(newlib_patches) +patch-newlib: $(newlib_patches) patch-kos: $(kos_patches) $(newlib_patches): @@ -133,8 +133,8 @@ $(build_arm_targets): target = $(arm_target) $(build_arm_targets): extra_configure_args = --with-arch=armv4 # To avoid code repetition, we use the same commands for both -# architectures. But we can't create a single target called -# build-binutils for both sh4 and arm, because phony targets +# architectures. But we can't create a single target called +# build-binutils for both sh4 and arm, because phony targets # can't be run multiple times. So we create multiple targets. build_binutils = build-sh4-binutils build-arm-binutils build_gcc_pass1 = build-sh4-gcc-pass1 build-arm-gcc-pass1 @@ -212,17 +212,17 @@ $(build_gcc_pass2): logdir # GDB building -gdb-$(gdb_ver).tar.bz2: +gdb-$(gdb_ver).tar.gz: @echo "+++ Downloading GDB..." - wget -c ftp://ftp.gnu.org/gnu/gdb/gdb-$(gdb_ver).tar.bz2 + wget -c ftp://ftp.gnu.org/gnu/gdb/gdb-$(gdb_ver).tar.gz -unpack_gdb: gdb-$(gdb_ver).tar.bz2 unpack_gdb_stamp +unpack_gdb: gdb-$(gdb_ver).tar.gz unpack_gdb_stamp -unpack_gdb_stamp: +unpack_gdb_stamp: @echo "+++ Unpacking GDB..." rm -f $@ rm -rf gdb-$(gdb_ver) - tar jxf gdb-$(gdb_ver).tar.bz2 + tar xf gdb-$(gdb_ver).tar.gz touch $@ build_gdb: log = $(logdir)/gdb-$(gdb_ver).log @@ -255,19 +255,19 @@ install_gdb_stamp: gdb: install_gdb -# INSIGHT building +# Insight building -insight-$(insight_ver).tar.bz2: - @echo "+++ Downloading INSIGHT..." - wget -c ftp://sourceware.org/pub/insight/releases/insight-$(insight_ver).tar.bz2 +insight-$(insight_ver)a.tar.bz2: + @echo "+++ Downloading Insight..." + wget -c ftp://sourceware.org/pub/insight/releases/insight-$(insight_ver)a.tar.bz2 -unpack_insight: insight-$(insight_ver).tar.bz2 unpack_insight_stamp +unpack_insight: insight-$(insight_ver)a.tar.bz2 unpack_insight_stamp unpack_insight_stamp: - @echo "+++ Unpacking INSIGHT..." + @echo "+++ Unpacking Insight..." rm -f $@ rm -rf insight-$(insight_ver) - tar jxf insight-$(insight_ver).tar.bz2 + tar xf insight-$(insight_ver)a.tar.bz2 touch $@ build_insight: log = $(logdir)/insight-$(insight_ver).log @@ -275,7 +275,7 @@ build_insight: logdir build_insight: unpack_insight build_insight_stamp build_insight_stamp: - @echo "+++ Building INSIGHT..." + @echo "+++ Building Insight..." rm -f $@ > $(log) rm -rf build-insight-$(insight_ver) @@ -292,7 +292,7 @@ install_insight: logdir install_insight: build_insight install_insight_stamp install_insight_stamp: - @echo "+++ Installing INSIGHT..." + @echo "+++ Installing Insight..." rm -f $@ $(MAKE) -C build-insight-$(insight_ver) install DESTDIR=$(DESTDIR) $(to_log) touch $@ @@ -309,7 +309,7 @@ clean: -rm -rf build-gcc-$(arm_target)-$(gcc_ver) -rm -rf build-binutils-$(sh_target)-$(binutils_ver) -rm -rf build-binutils-$(arm_target)-$(binutils_ver) - -rm -rf build-gdb-$(gdb_ver) install_gdb_stamp build_gdb_stamp + -rm -rf build-gdb-$(gdb_ver) install_gdb_stamp build_gdb_stamp -rm -rf build-insight-$(gdb_ver) install_insight_stamp build_insight_stamp logdir: hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-06-21 02:26:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "An ethernet program loader for the Dreamcast.". The branch, master has been updated via 25114e63cf8529b6e00fc731aee0744844aae955 (commit) from b552f03f696c31c6f872c4da253da7d319cab7b7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 25114e63cf8529b6e00fc731aee0744844aae955 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jun 20 22:24:47 2016 -0400 Somehow missed this file, sorry about that. ----------------------------------------------------------------------- Summary of changes: target-src/dcload/syscalls.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/target-src/dcload/syscalls.h b/target-src/dcload/syscalls.h index 7ead079..d468116 100644 --- a/target-src/dcload/syscalls.h +++ b/target-src/dcload/syscalls.h @@ -43,6 +43,7 @@ #define CMD_READDIR "DC18" #define CMD_CDFSREAD "DC19" #define CMD_GDBPACKET "DC20" +#define CMD_REWINDDIR "DC21" extern unsigned int syscall_retval; extern unsigned char* syscall_data; hooks/post-receive -- An ethernet program loader for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-06-14 17:51:42
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "An ethernet program loader for the Dreamcast.". The branch, master has been updated via b552f03f696c31c6f872c4da253da7d319cab7b7 (commit) from c49476cae2a18c6f577f7135cc13836de04c8232 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b552f03f696c31c6f872c4da253da7d319cab7b7 Author: Lawrence Sebald <ljs...@us...> Date: Tue Jun 14 13:51:13 2016 -0400 Add rewinddir syscall and fix memory leak in cdfs sector reading. Thanks to Chilly Willy for pointing out the cdfs memory leak. ----------------------------------------------------------------------- Summary of changes: Makefile.cfg | 6 +++--- host-src/tool/dc-tool.c | 31 ++++++++++++++++--------------- host-src/tool/syscalls.c | 38 ++++++++++++++++++++++++++++++-------- host-src/tool/syscalls.h | 3 ++- target-src/dcload/dcload-crt0.s | 4 +++- target-src/dcload/syscalls.c | 13 +++++++++++++ 6 files changed, 67 insertions(+), 28 deletions(-) diff --git a/Makefile.cfg b/Makefile.cfg index 174ae52..0606705 100644 --- a/Makefile.cfg +++ b/Makefile.cfg @@ -24,8 +24,8 @@ BFDINCLUDE = -I/opt/dc/sh-elf/include # When using libelf instead of BFD, these must point to your # libelf installation (leave empty or undefined if libelf is part of the system) -#ELFLIB = -L/opt/misc.ppc/lib -#ELFINCLUDE = -I/opt/misc.ppc/include +ELFLIB = -L/usr/local/lib +ELFINCLUDE = -I/usr/local/include # sh-elf-stuff # if you have the SH compiler in your path you can leave SHTOOLS empty, @@ -51,7 +51,7 @@ HOSTCFLAGS += $(VERFLAGS) DREAMCAST_IP = 0.0.0.0 # dir to install dc-tool in -TOOLINSTALLDIR = /usr/local/dc/bin +TOOLINSTALLDIR = /usr/local/bin # uncomment this for cygwin #EXECUTABLEEXTENSION = .exe diff --git a/host-src/tool/dc-tool.c b/host-src/tool/dc-tool.c index 18d25ba..16d547e 100644 --- a/host-src/tool/dc-tool.c +++ b/host-src/tool/dc-tool.c @@ -249,9 +249,9 @@ int recv_data(void *data, unsigned int dcaddr, unsigned int total, unsigned int while (((time_in_usec() - start) < PACKET_TIMEOUT)&&(packets < ((total+1023)/1024 + 1))) { memset(buffer, 0, 2048); - + while(((retval = recv(dcsocket, (void *)buffer, 2048, 0)) == -1)&&((time_in_usec() - start) < PACKET_TIMEOUT)); - + if (retval > 0) { start = time_in_usec(); if (memcmp(((command_t *)buffer)->id, CMD_DONEBIN, 4)) { @@ -278,13 +278,13 @@ int recv_data(void *data, unsigned int dcaddr, unsigned int total, unsigned int else { send_cmd(CMD_SENDBINQ, dcaddr + c*1024, total - c*1024, NULL, 0); } - + start = time_in_usec(); while(((retval = recv(dcsocket, (void *)buffer, 2048, 0)) == -1)&&((time_in_usec() - start) < PACKET_TIMEOUT)); - + if (retval > 0) { start = time_in_usec(); - + if (memcmp(((command_t *)buffer)->id, CMD_DONEBIN, 4)) { map[ (ntohl(((command_t *)buffer)->address) - dcaddr)/1024 ] = 1; /* printf("recv_data: got chunk for %p, %d bytes\n", @@ -304,7 +304,7 @@ int recv_data(void *data, unsigned int dcaddr, unsigned int total, unsigned int } free(map); - + return 0; } @@ -379,13 +379,13 @@ int send_data(unsigned char * addr, unsigned int dcaddr, unsigned int size) while(memcmp(((command_t *)buffer)->id, CMD_DONEBIN, 4)) { printf("send_data: error in response to CMD_DONEBIN, retrying...\n"); - + do send_cmd(CMD_LOADBIN, dcaddr, size, NULL, 0); while (recv_response(buffer, PACKET_TIMEOUT) == -1); } } - + return 0; } @@ -420,7 +420,7 @@ int start_ws() perror("WSAStartup"); return 1; } - + return 0; } #endif @@ -500,7 +500,7 @@ int send_command(char *command, unsigned int addr, unsigned int size, unsigned c memcpy(c_buff + 12, data, dsize); error = send(dcsocket, (void *)c_buff, 12+dsize, 0); - + if(error == -1) { #ifndef __MINGW32__ if(errno == EAGAIN) @@ -516,7 +516,7 @@ int send_command(char *command, unsigned int addr, unsigned int size, unsigned c return -1; } - + return 0; } @@ -808,8 +808,10 @@ int do_console(char *path, char *isofile) CatchError(dc_gdbpacket(buffer)); // reset the timer - time.tv_nsec = 500000000; + time.tv_nsec = 500000000; } + if(!(memcmp(buffer, CMD_REWINDDIR, 4))) + CatchError(dc_rewinddir(buffer)); return 0; } @@ -817,7 +819,7 @@ int do_console(char *path, char *isofile) int open_gdb_socket(int port) { struct sockaddr_in server_addr; - + server_addr.sin_family = AF_INET; server_addr.sin_port = htons( port ); server_addr.sin_addr.s_addr = htonl( INADDR_LOOPBACK ); @@ -877,7 +879,7 @@ int main(int argc, char *argv[]) return 0; } - + #ifdef __MINGW32__ if(start_ws()) return -1; @@ -1046,4 +1048,3 @@ doclean: cleanup(cleanlist); return -1; } - diff --git a/host-src/tool/syscalls.c b/host-src/tool/syscalls.c index ab451fc..b57580a 100644 --- a/host-src/tool/syscalls.c +++ b/host-src/tool/syscalls.c @@ -100,7 +100,7 @@ int dc_fstat(unsigned char * buffer) send_data((unsigned char *)&dcstat, ntohl(command->value1), ntohl(command->value2)); send_cmd(CMD_RETVAL, retval, retval, NULL, 0); - + return 0; } @@ -184,7 +184,7 @@ int dc_close(unsigned char * buffer) retval = close(ntohl(command->value0)); send_cmd(CMD_RETVAL, retval, retval, NULL, 0); - + return 0; } @@ -196,7 +196,7 @@ int dc_creat(unsigned char * buffer) retval = creat(command->string, ntohl(command->value0)); send_cmd(CMD_RETVAL, retval, retval, NULL, 0); - + return 0; } @@ -217,7 +217,7 @@ int dc_link(unsigned char * buffer) #endif send_cmd(CMD_RETVAL, retval, retval, NULL, 0); - + return 0; } @@ -229,7 +229,7 @@ int dc_unlink(unsigned char * buffer) retval = unlink(command->string); send_cmd(CMD_RETVAL, retval, retval, NULL, 0); - + return 0; } @@ -384,7 +384,7 @@ int dc_readdir(unsigned char * buffer) dcload_dirent_t dcdirent; command_3int_t *command = (command_3int_t *)buffer; uint32_t i = ntohl(command->value0); - + if(i >= DIRENT_OFFSET && i < MAX_OPEN_DIRS + DIRENT_OFFSET) somedirent = readdir(opendirs[i - DIRENT_OFFSET]); else @@ -398,7 +398,7 @@ int dc_readdir(unsigned char * buffer) dcdirent.d_type = dc_order(somedirent->d_type); #else dcdirent.d_ino = dc_order(somedirent->d_ino); -# ifdef _WIN32 +# if defined(_WIN32) || defined(__CYGWIN__) dcdirent.d_off = dc_order(0); dcdirent.d_reclen = dc_order(0); dcdirent.d_type = dc_order(0); @@ -420,6 +420,27 @@ int dc_readdir(unsigned char * buffer) return 0; } +int dc_rewinddir(unsigned char * buffer) +{ + int retval; + command_int_t *command = (command_int_t *)buffer; + uint32_t i = ntohl(command->value0); + + + if(i >= DIRENT_OFFSET && i < MAX_OPEN_DIRS + DIRENT_OFFSET) { + rewinddir(opendirs[i - DIRENT_OFFSET]); + opendirs[i - DIRENT_OFFSET] = NULL; + retval = 0; + } + else { + retval = -1; + } + + send_cmd(CMD_RETVAL, retval, retval, NULL, 0); + + return 0; +} + int dc_cdfs_redir_read_sectors(int isofd, unsigned char * buffer) { int start; @@ -438,6 +459,7 @@ int dc_cdfs_redir_read_sectors(int isofd, unsigned char * buffer) send_cmd(CMD_RETVAL, 0, 0, NULL, 0); + free(buf); return 0; } @@ -500,6 +522,6 @@ int dc_gdbpacket(unsigned char * buffer) } #endif send_cmd(CMD_RETVAL, retval, retval, (unsigned char *)gdb_buf, retval); - + return 0; } diff --git a/host-src/tool/syscalls.h b/host-src/tool/syscalls.h index 2791a17..7be9bb9 100644 --- a/host-src/tool/syscalls.h +++ b/host-src/tool/syscalls.h @@ -40,6 +40,7 @@ int dc_utime(unsigned char * buffer); int dc_opendir(unsigned char * buffer); int dc_readdir(unsigned char * buffer); int dc_closedir(unsigned char * buffer); +int dc_rewinddir(unsigned char * buffer); int dc_cdfs_redir_read_sectors(int isofd, unsigned char * buffer); @@ -66,6 +67,7 @@ int dc_gdbpacket(unsigned char * buffer); #define CMD_READDIR "DC18" #define CMD_CDFSREAD "DC19" #define CMD_GDBPACKET "DC20" +#define CMD_REWINDDIR "DC21" struct _command_3int_t { unsigned char id[4]; @@ -134,4 +136,3 @@ typedef struct _command_3int_string_t command_3int_string_t; */ #endif - diff --git a/target-src/dcload/dcload-crt0.s b/target-src/dcload/dcload-crt0.s index ffff008..e576d10 100644 --- a/target-src/dcload/dcload-crt0.s +++ b/target-src/dcload/dcload-crt0.s @@ -125,7 +125,7 @@ _dcloadsyscall: mov r6,r5 mov r7,r6 - mov #20,r1 + mov #21,r1 cmp/hs r0,r1 bf badsyscall @@ -189,3 +189,5 @@ hostinfo_k: .long _gethostinfo gdbpacket_k: .long _gdbpacket +rewinddir_k: + .long _rewinddir diff --git a/target-src/dcload/syscalls.c b/target-src/dcload/syscalls.c index 41a7b4e..896aae5 100644 --- a/target-src/dcload/syscalls.c +++ b/target-src/dcload/syscalls.c @@ -356,6 +356,19 @@ struct dirent *readdir(DIR *dir) return 0; } +int rewinddir(DIR *dir) +{ + command_int_t * command = (command_int_t *)(pkt_buf + ETHER_H_LEN + IP_H_LEN + UDP_H_LEN); + + memcpy(command->id, CMD_REWINDDIR, 4); + command->value0 = htonl(dir); + + build_send_packet(sizeof(command_int_t)); + bb->loop(); + + return syscall_retval; +} + int gethostinfo(unsigned int *ip, unsigned int *port) { *ip = tool_ip; hooks/post-receive -- An ethernet program loader for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-06-14 17:49:52
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A serial program loader for the Dreamcast.". The branch, master has been updated via f2ce2421278b8dd74757b13fde6a290b216c0dd0 (commit) from 697d5d41eb701345f9d1f9f8c274f338a14c356d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f2ce2421278b8dd74757b13fde6a290b216c0dd0 Author: Lawrence Sebald <ljs...@us...> Date: Tue Jun 14 13:49:14 2016 -0400 Add rewinddir syscall and free memory in dc-tool after reading cdfs sectors. Thanks to Chilly Willy for pointing out the cdfs memory leak. ----------------------------------------------------------------------- Summary of changes: host-src/tool/dc-tool.c | 83 ++++++++++++++++++++------------------- host-src/tool/syscalls.c | 27 +++++++++--- host-src/tool/syscalls.h | 3 +- target-src/dcload/dcload-crt0.s | 48 ++++++++++++----------- target-src/dcload/syscalls.c | 19 ++++++--- 5 files changed, 103 insertions(+), 77 deletions(-) diff --git a/host-src/tool/dc-tool.c b/host-src/tool/dc-tool.c index c118abe..aff998a 100644 --- a/host-src/tool/dc-tool.c +++ b/host-src/tool/dc-tool.c @@ -1,4 +1,4 @@ -/* +/* * dc-tool, a tool for use with the dcload serial loader * * Copyright (C) 2001 Andrew Kieschnick <an...@na...> @@ -139,7 +139,7 @@ const char *ostr; static char *place = EMSG; /* option letter processing */ char *oli; /* option letter list index */ int ret; - + if (optreset || !*place) { /* update scanning pointer */ optreset = 0; if (optind >= nargc || *(place = nargv[optind]) != '-') { @@ -210,7 +210,7 @@ HANDLE hCommPort; int serial_read(void *buffer, int count) { BOOL fSuccess; - + fSuccess = ReadFile(hCommPort, buffer, count, (DWORD *)&count, NULL); if( !fSuccess ) return -1; @@ -220,7 +220,7 @@ int serial_read(void *buffer, int count) int serial_write(void *buffer, int count) { BOOL fSuccess; - + fSuccess = WriteFile(hCommPort, buffer, count, (DWORD *)&count, NULL); if( !fSuccess ) return -1; @@ -231,7 +231,7 @@ int serial_putc(char ch) { BOOL fSuccess; int count = 1; - + fSuccess = WriteFile(hCommPort, &ch, count, (DWORD *)&count, NULL); if( !fSuccess ) return -1; @@ -288,8 +288,8 @@ char serial_getc() int send_uint(unsigned int value) { unsigned int tmp = value; - - /* send little-endian */ + + /* send little-endian */ serial_putc((char)(tmp & 0xFF)); serial_putc((char)((tmp >> 0x08) & 0xFF)); serial_putc((char)((tmp >> 0x10) & 0xFF)); @@ -328,11 +328,11 @@ void recv_data(void *data, unsigned int total, unsigned int verbose) unsigned int size, newsize; unsigned char *tmp; - if (verbose) { + if (verbose) { printf("recv_data: "); fflush(stdout); } - + while (total) { blread(&type, 1); @@ -409,7 +409,7 @@ void send_data(unsigned char * addr, unsigned int size, unsigned int verbose) lzo1x_1_compress((unsigned char *)addr, sendsize, buffer, &csize, wrkmem); if (csize < sendsize) { // send compressed - if (verbose) { + if (verbose) { printf("C"); fflush(stdout); } @@ -428,7 +428,7 @@ void send_data(unsigned char * addr, unsigned int size, unsigned int verbose) serial_write(&sum, 1); blread(&data, 1); } - } else { + } else { // send uncompressed if (verbose) { printf("U"); @@ -458,7 +458,7 @@ void send_data(unsigned char * addr, unsigned int size, unsigned int verbose) void output_error(void) { char *lpMsgBuf; - + FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | @@ -568,17 +568,17 @@ int open_serial(char *devicename, unsigned int speed, unsigned int *speedtest) BOOL fSuccess; COMMTIMEOUTS ctmoCommPort; DCB dcbCommPort; - + /* Setup the com port */ hCommPort = CreateFile(devicename, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); - - if( hCommPort == INVALID_HANDLE_VALUE ) { + + if( hCommPort == INVALID_HANDLE_VALUE ) { printf( "*Error opening com port\n"); output_error(); return -1; } - + ctmoCommPort.ReadIntervalTimeout = MAXDWORD; ctmoCommPort.ReadTotalTimeoutMultiplier = MAXDWORD; ctmoCommPort.ReadTotalTimeoutConstant = MAXDWORD; @@ -586,19 +586,19 @@ int open_serial(char *devicename, unsigned int speed, unsigned int *speedtest) ctmoCommPort.WriteTotalTimeoutConstant = 0; SetCommTimeouts( hCommPort, &ctmoCommPort ); dcbCommPort.DCBlength = sizeof(DCB); - + fSuccess = GetCommState( hCommPort, &dcbCommPort ); if( !fSuccess ) { printf( "*Error getting com port state\n" ); output_error(); return -1; } - + dcbCommPort.BaudRate = speed; dcbCommPort.ByteSize = DATA_BITS; dcbCommPort.Parity = PARITY_SET; dcbCommPort.StopBits = STOP_BITS; - + fSuccess = SetCommState( hCommPort, &dcbCommPort ); if( !fSuccess ) { printf( "*Error setting com port state\n" ); @@ -741,7 +741,7 @@ unsigned int upload(unsigned char *filename, unsigned int address) if ((somebfd = bfd_openr(filename, 0))) { /* try bfd first */ if(bfd_check_format(somebfd, bfd_object)) { asection *section; - + printf("File format is %s, ", somebfd->xvec->name); address = somebfd->start_address; size = 0; @@ -762,12 +762,12 @@ unsigned int upload(unsigned char *filename, unsigned int address) c = 'B'; serial_write(&c, 1); blread(&c, 1); - + send_uint(section->lma); send_uint(bfd_section_size(somebfd, section)); - + send_data(inbuf, bfd_section_size(somebfd, section), 1); - + free(inbuf); } } @@ -921,32 +921,32 @@ void download(unsigned char *filename, unsigned int address, serial_write("F", 1); else serial_write("G", 1); - + serial_read(&c, 1); - + send_uint(address); - + send_uint(size); - + send_uint(wrkmem); - + gettimeofday(&starttime, 0); - + recv_data(data, size, 1); - + gettimeofday(&endtime, 0); - + printf("Received %d bytes\n", size); - + stime = starttime.tv_sec + starttime.tv_usec / 1000000.0; etime = endtime.tv_sec + endtime.tv_usec / 1000000.0; - + printf("effective: %.2f bytes / sec\n", (double) size / (etime - stime)); printf("%.2f seconds to transfer %d bytes\n", (etime - stime), size); fflush(stdout); - + write(outputfd, data, size); - + close(outputfd); } @@ -975,7 +975,7 @@ void do_console(unsigned char *path, unsigned char *isofile) if (isofd < 0) perror((char *)isofile); } - + #ifndef __MINGW32__ if (path) if (chroot((char *)path)) @@ -1051,6 +1051,9 @@ void do_console(unsigned char *path, unsigned char *isofile) case 20: dc_gdbpacket(); break; + case 21: + dc_rewinddir(); + break; default: printf("Unimplemented command (%d) \n", command); printf("Assuming program has exited, or something...\n"); @@ -1074,7 +1077,7 @@ void do_dumbterm(void) unsigned char c; printf("\nDumb terminal mode isn't implemented, so you get this half-assed one.\n\n"); - + fflush(stdout); while (1) { @@ -1200,7 +1203,7 @@ int main(int argc, char *argv[]) perror((char *)filename); exit(1); } - } + } if (console) printf("Console enabled\n"); @@ -1231,10 +1234,10 @@ int main(int argc, char *argv[]) if (open_serial(device_name, BAUD_RATE, &dummy)<0) return 1; - + if (speed != BAUD_RATE) change_speed(device_name, speed); - + switch (command) { case 'x': if (cdfs_redir) { diff --git a/host-src/tool/syscalls.c b/host-src/tool/syscalls.c index 0d5508a..aee18c3 100644 --- a/host-src/tool/syscalls.c +++ b/host-src/tool/syscalls.c @@ -1,4 +1,4 @@ -/* +/* * This file is part of the dcload Dreamcast serial loader * * Copyright (C) 2001 Andrew Kieschnick <an...@na...> @@ -398,7 +398,7 @@ void dc_closedir(void) somedir = (DIR *) recv_uint(); retval = closedir(somedir); - + send_uint(retval); } @@ -410,7 +410,7 @@ void dc_readdir(void) somedir = (DIR *) recv_uint(); somedirent = readdir(somedir); - + if (somedirent) { send_uint(1); send_uint(somedirent->d_ino); @@ -418,7 +418,7 @@ void dc_readdir(void) send_uint(0); send_uint(0); send_uint(0); -#else +#else #ifdef __APPLE_CC__ send_uint(0); #else @@ -426,13 +426,25 @@ void dc_readdir(void) #endif send_uint(somedirent->d_reclen); send_uint(somedirent->d_type); -#endif +#endif send_uint(strlen(somedirent->d_name)+1); send_data(somedirent->d_name, strlen(somedirent->d_name)+1, 0); - } else + } else send_uint(0); } +void dc_rewinddir(void) +{ + DIR *somedir; + int retval; + + somedir = (DIR *) recv_uint(); + + rewinddir(somedir); + + send_uint(0); +} + void dc_cdfs_redir_read_sectors(int isofd) { int start; @@ -442,7 +454,7 @@ void dc_cdfs_redir_read_sectors(int isofd) start = recv_uint(); num = recv_uint(); - start -= 150; + start -= 150; lseek(isofd, start * 2048, SEEK_SET); @@ -451,6 +463,7 @@ void dc_cdfs_redir_read_sectors(int isofd) read(isofd, buf, num * 2048); send_data(buf, num * 2048, 0); + free(buf); } #define GDBBUFSIZE 1024 diff --git a/host-src/tool/syscalls.h b/host-src/tool/syscalls.h index d954b94..82a7aba 100644 --- a/host-src/tool/syscalls.h +++ b/host-src/tool/syscalls.h @@ -1,4 +1,4 @@ -/* +/* * This file is part of the dcload Dreamcast serial loader * * Copyright (C) 2001 Andrew Kieschnick <an...@na...> @@ -40,6 +40,7 @@ void dc_utime(void); void dc_opendir(void); void dc_readdir(void); void dc_closedir(void); +void dc_rewinddir(void); void dc_cdfs_redir_read_sectors(int isofd); diff --git a/target-src/dcload/dcload-crt0.s b/target-src/dcload/dcload-crt0.s index 0fb9cd2..f3fdaf0 100644 --- a/target-src/dcload/dcload-crt0.s +++ b/target-src/dcload/dcload-crt0.s @@ -1,5 +1,5 @@ ! crt0.s for dcload - + .section .text .global start .global _atexit @@ -9,19 +9,19 @@ start: nop ! for checking if dcload is present - + dcloadmagic: .long 0xdeadbeef ! normal programs use this call - -dcloadsyscall_k: + +dcloadsyscall_k: .long _dcloadsyscall - + ! exception handler uses these calls -setup_video_k: - .long _setup_video +setup_video_k: + .long _setup_video clrscr_k: .long _clrscr draw_string_k: @@ -30,25 +30,25 @@ uint_to_string_k: .long _uint_to_string exc_to_string_k: .long _exception_code_to_string - + realstart: stc sr,r0 mov.l sr_mask,r1 - and r1,r0 - or #0xf0,r0 + and r1,r0 + or #0xf0,r0 ldc r0,sr mov.l setup_cache_k,r0 mov.l p2_mask,r1 or r1,r0 jmp @r0 nop - + setup_cache: mov.l ccr_addr,r0 mov.w ccr_data,r1 mov.l r1,@r0 mov.l start_2_k,r0 - mov #0,r1 + mov #0,r1 nop nop nop @@ -56,7 +56,7 @@ setup_cache: nop nop jmp @r0 - mov r1,r0 + mov r1,r0 start_2: mov.l stack_k,r15 @@ -76,7 +76,7 @@ start_l: mov #0,r4 lds r3,fpscr - ! call main + ! call main mov.l main_k,r0 jsr @r0 or r0,r0 @@ -95,7 +95,7 @@ sr_mask: set_fpscr_k: .long ___set_fpscr stack_k: - .long _stack + .long _stack edata_k: .long _edata end_k: @@ -104,8 +104,8 @@ main_k: .long _main setup_cache_k: .long setup_cache -start_2_k: - .long start_2 +start_2_k: + .long start_2 p2_mask: .long 0xa0000000 ccr_addr: @@ -119,13 +119,13 @@ _dcloadsyscall: mov.l correctmagic,r0 cmp/eq r0,r1 bf badsyscall - + mov r4,r0 mov r5,r4 mov r6,r5 mov r7,r6 - mov #20,r1 + mov #21,r1 cmp/hs r0,r1 bf badsyscall @@ -134,8 +134,8 @@ _dcloadsyscall: mov.l @(r0,r1),r0 jmp @r0 nop - -badsyscall: + +badsyscall: mov #-1,r0 rts nop @@ -144,7 +144,7 @@ badsyscall: dcloadmagic_k: .long dcloadmagic correctmagic: - .long 0xdeadbeef + .long 0xdeadbeef first_syscall: .long read_k read_k: ...<truncated>... hooks/post-receive -- A serial program loader for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-03-11 15:09:29
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 112df1a4753657d90a908027bb36330c82bc4767 (commit) from c8e7c2592e3b33f9da272a6f46b0d4c78b617806 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 112df1a4753657d90a908027bb36330c82bc4767 Author: Lawrence Sebald <ljs...@us...> Date: Fri Mar 11 10:09:06 2016 -0500 Remove +x permission bits on lots of GL example stuff... ----------------------------------------------------------------------- Summary of changes: .../kgl/basic/elements/romdisk/wp001vq.pvr | Bin 67616 -> 67616 bytes examples/dreamcast/kgl/basic/gl/romdisk/glass.pvr | Bin 32800 -> 32800 bytes .../dreamcast/kgl/basic/scissor/romdisk/glass.pvr | Bin 32800 -> 32800 bytes .../kgl/basic/txrenv/romdisk/FlareWS_256.pvr | Bin 131104 -> 131104 bytes .../dreamcast/kgl/basic/txrenv/romdisk/wp001vq.pvr | Bin 67616 -> 67616 bytes examples/dreamcast/kgl/basic/vq/fruit.jpg | Bin 19754 -> 19754 bytes .../kgl/basic/zclip_arrays/romdisk/wp001vq.pvr | Bin 67616 -> 67616 bytes .../dreamcast/kgl/demos/blur/romdisk/glass.pvr | Bin 32800 -> 32800 bytes .../dreamcast/kgl/demos/mipmap/romdisk/MP_512.pvr | Bin 524320 -> 524320 bytes .../multitexture-arrays/romdisk/FlareWS_256.pvr | Bin 131104 -> 131104 bytes .../demos/multitexture-arrays/romdisk/wp001vq.pvr | Bin 67616 -> 67616 bytes .../multitexture-elements/romdisk/FlareWS_256.pvr | Bin 131104 -> 131104 bytes .../multitexture-elements/romdisk/wp001vq.pvr | Bin 67616 -> 67616 bytes .../dreamcast/kgl/demos/specular/romdisk/FONT0.PVR | Bin 67616 -> 67616 bytes .../kgl/demos/specular/romdisk/brick_w1.pvr | Bin 524320 -> 524320 bytes .../dreamcast/kgl/nehe/nehe06/romdisk/glass.pvr | Bin 32800 -> 32800 bytes .../dreamcast/kgl/nehe/nehe08/romdisk/glass.pvr | Bin 32800 -> 32800 bytes .../dreamcast/kgl/nehe/nehe09/romdisk/star.pvr | Bin 6176 -> 6176 bytes .../dreamcast/kgl/nehe/nehe16/romdisk/glass.pvr | Bin 32800 -> 32800 bytes .../dreamcast/kgl/nehe/nehe26/romdisk/sphere.bin | Bin 5836 -> 5836 bytes .../dreamcast/kgl/nehe/nehe26/romdisk/torus.bin | Bin 5836 -> 5836 bytes .../dreamcast/kgl/nehe/nehe26/romdisk/tube.bin | Bin 5836 -> 5836 bytes 22 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 examples/dreamcast/kgl/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/basic/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/basic/elements/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/basic/elements/main.c mode change 100755 => 100644 examples/dreamcast/kgl/basic/elements/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/basic/elements/romdisk/wp001vq.pvr mode change 100755 => 100644 examples/dreamcast/kgl/basic/gl/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/basic/gl/gltest.c mode change 100755 => 100644 examples/dreamcast/kgl/basic/gl/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/basic/gl/romdisk/glass.pvr mode change 100755 => 100644 examples/dreamcast/kgl/basic/scissor/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/basic/scissor/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/basic/scissor/romdisk/glass.pvr mode change 100755 => 100644 examples/dreamcast/kgl/basic/scissor/scissor.c mode change 100755 => 100644 examples/dreamcast/kgl/basic/txrenv/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/basic/txrenv/main.c mode change 100755 => 100644 examples/dreamcast/kgl/basic/txrenv/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/basic/txrenv/romdisk/FlareWS_256.pvr mode change 100755 => 100644 examples/dreamcast/kgl/basic/txrenv/romdisk/wp001vq.pvr mode change 100755 => 100644 examples/dreamcast/kgl/basic/vq/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/basic/vq/fruit.jpg mode change 100755 => 100644 examples/dreamcast/kgl/basic/vq/vq-example.c mode change 100755 => 100644 examples/dreamcast/kgl/basic/zclip_arrays/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/basic/zclip_arrays/main.c mode change 100755 => 100644 examples/dreamcast/kgl/basic/zclip_arrays/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/basic/zclip_arrays/romdisk/wp001vq.pvr mode change 100755 => 100644 examples/dreamcast/kgl/benchmarks/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/benchmarks/quadmark/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c mode change 100755 => 100644 examples/dreamcast/kgl/benchmarks/trimark/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/benchmarks/trimark/trimark.c mode change 100755 => 100644 examples/dreamcast/kgl/benchmarks/tristripmark/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/demos/blur/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/demos/blur/main.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/blur/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/blur/romdisk/glass.pvr mode change 100755 => 100644 examples/dreamcast/kgl/demos/mipmap/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/demos/mipmap/main.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/mipmap/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/mipmap/romdisk/MP_512.pvr mode change 100755 => 100644 examples/dreamcast/kgl/demos/multitexture-arrays/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/demos/multitexture-arrays/main.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/multitexture-arrays/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/multitexture-arrays/romdisk/FlareWS_256.pvr mode change 100755 => 100644 examples/dreamcast/kgl/demos/multitexture-arrays/romdisk/wp001vq.pvr mode change 100755 => 100644 examples/dreamcast/kgl/demos/multitexture-elements/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/demos/multitexture-elements/main.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/multitexture-elements/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/multitexture-elements/romdisk/FlareWS_256.pvr mode change 100755 => 100644 examples/dreamcast/kgl/demos/multitexture-elements/romdisk/wp001vq.pvr mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/font.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/font.h mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/input.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/input.h mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/main.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/romdisk/FONT0.PVR mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/romdisk/brick_w1.pvr mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/texture.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/texture.h mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/timer.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/timer.h mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/vector.c mode change 100755 => 100644 examples/dreamcast/kgl/demos/specular/vector.h mode change 100755 => 100644 examples/dreamcast/kgl/nehe/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe02/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe02/main.c mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe05/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe05/main.c mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe06/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe06/main.c mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe06/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe06/romdisk/glass.pvr mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe08/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe08/main.c mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe08/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe08/romdisk/glass.pvr mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe09/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe09/main.c mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe09/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe09/romdisk/star.pvr mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe16/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe16/nehe16.c mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe16/pvr-texture.c mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe16/romdisk/glass.pvr mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe26/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe26/data/Makefile mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe26/data/sphere.txt mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe26/data/torus.txt mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe26/data/tube.txt mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe26/data/txt2bin.c mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe26/main.c mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe26/romdisk/sphere.bin mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe26/romdisk/torus.bin mode change 100755 => 100644 examples/dreamcast/kgl/nehe/nehe26/romdisk/tube.bin diff --git a/examples/dreamcast/kgl/Makefile b/examples/dreamcast/kgl/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/Makefile b/examples/dreamcast/kgl/basic/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/elements/Makefile b/examples/dreamcast/kgl/basic/elements/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/elements/main.c b/examples/dreamcast/kgl/basic/elements/main.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/elements/pvr-texture.c b/examples/dreamcast/kgl/basic/elements/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/gl/Makefile b/examples/dreamcast/kgl/basic/gl/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/gl/gltest.c b/examples/dreamcast/kgl/basic/gl/gltest.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/gl/pvr-texture.c b/examples/dreamcast/kgl/basic/gl/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/scissor/Makefile b/examples/dreamcast/kgl/basic/scissor/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/scissor/pvr-texture.c b/examples/dreamcast/kgl/basic/scissor/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/scissor/scissor.c b/examples/dreamcast/kgl/basic/scissor/scissor.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/txrenv/Makefile b/examples/dreamcast/kgl/basic/txrenv/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/txrenv/main.c b/examples/dreamcast/kgl/basic/txrenv/main.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/txrenv/pvr-texture.c b/examples/dreamcast/kgl/basic/txrenv/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/vq/Makefile b/examples/dreamcast/kgl/basic/vq/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/vq/vq-example.c b/examples/dreamcast/kgl/basic/vq/vq-example.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/zclip_arrays/Makefile b/examples/dreamcast/kgl/basic/zclip_arrays/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/zclip_arrays/main.c b/examples/dreamcast/kgl/basic/zclip_arrays/main.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/basic/zclip_arrays/pvr-texture.c b/examples/dreamcast/kgl/basic/zclip_arrays/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/benchmarks/Makefile b/examples/dreamcast/kgl/benchmarks/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/benchmarks/quadmark/Makefile b/examples/dreamcast/kgl/benchmarks/quadmark/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c b/examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/benchmarks/trimark/Makefile b/examples/dreamcast/kgl/benchmarks/trimark/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/benchmarks/trimark/trimark.c b/examples/dreamcast/kgl/benchmarks/trimark/trimark.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/benchmarks/tristripmark/Makefile b/examples/dreamcast/kgl/benchmarks/tristripmark/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c b/examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/Makefile b/examples/dreamcast/kgl/demos/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/blur/Makefile b/examples/dreamcast/kgl/demos/blur/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/blur/main.c b/examples/dreamcast/kgl/demos/blur/main.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/blur/pvr-texture.c b/examples/dreamcast/kgl/demos/blur/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/mipmap/Makefile b/examples/dreamcast/kgl/demos/mipmap/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/mipmap/main.c b/examples/dreamcast/kgl/demos/mipmap/main.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/mipmap/pvr-texture.c b/examples/dreamcast/kgl/demos/mipmap/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/multitexture-arrays/Makefile b/examples/dreamcast/kgl/demos/multitexture-arrays/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/multitexture-arrays/main.c b/examples/dreamcast/kgl/demos/multitexture-arrays/main.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/multitexture-arrays/pvr-texture.c b/examples/dreamcast/kgl/demos/multitexture-arrays/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/multitexture-elements/Makefile b/examples/dreamcast/kgl/demos/multitexture-elements/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/multitexture-elements/main.c b/examples/dreamcast/kgl/demos/multitexture-elements/main.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/multitexture-elements/pvr-texture.c b/examples/dreamcast/kgl/demos/multitexture-elements/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/specular/Makefile b/examples/dreamcast/kgl/demos/specular/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/specular/font.c b/examples/dreamcast/kgl/demos/specular/font.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/specular/font.h b/examples/dreamcast/kgl/demos/specular/font.h old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/specular/input.c b/examples/dreamcast/kgl/demos/specular/input.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/specular/input.h b/examples/dreamcast/kgl/demos/specular/input.h old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/specular/main.c b/examples/dreamcast/kgl/demos/specular/main.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/specular/pvr-texture.c b/examples/dreamcast/kgl/demos/specular/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/specular/texture.c b/examples/dreamcast/kgl/demos/specular/texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/specular/texture.h b/examples/dreamcast/kgl/demos/specular/texture.h old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/specular/timer.c b/examples/dreamcast/kgl/demos/specular/timer.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/specular/timer.h b/examples/dreamcast/kgl/demos/specular/timer.h old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/specular/vector.c b/examples/dreamcast/kgl/demos/specular/vector.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/demos/specular/vector.h b/examples/dreamcast/kgl/demos/specular/vector.h old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/Makefile b/examples/dreamcast/kgl/nehe/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe02/Makefile b/examples/dreamcast/kgl/nehe/nehe02/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe02/main.c b/examples/dreamcast/kgl/nehe/nehe02/main.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe05/Makefile b/examples/dreamcast/kgl/nehe/nehe05/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe05/main.c b/examples/dreamcast/kgl/nehe/nehe05/main.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe06/Makefile b/examples/dreamcast/kgl/nehe/nehe06/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe06/main.c b/examples/dreamcast/kgl/nehe/nehe06/main.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe06/pvr-texture.c b/examples/dreamcast/kgl/nehe/nehe06/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe08/Makefile b/examples/dreamcast/kgl/nehe/nehe08/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe08/main.c b/examples/dreamcast/kgl/nehe/nehe08/main.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe08/pvr-texture.c b/examples/dreamcast/kgl/nehe/nehe08/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe09/Makefile b/examples/dreamcast/kgl/nehe/nehe09/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe09/main.c b/examples/dreamcast/kgl/nehe/nehe09/main.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe09/pvr-texture.c b/examples/dreamcast/kgl/nehe/nehe09/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe16/Makefile b/examples/dreamcast/kgl/nehe/nehe16/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe16/nehe16.c b/examples/dreamcast/kgl/nehe/nehe16/nehe16.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe16/pvr-texture.c b/examples/dreamcast/kgl/nehe/nehe16/pvr-texture.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe26/Makefile b/examples/dreamcast/kgl/nehe/nehe26/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe26/data/Makefile b/examples/dreamcast/kgl/nehe/nehe26/data/Makefile old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe26/data/sphere.txt b/examples/dreamcast/kgl/nehe/nehe26/data/sphere.txt old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe26/data/torus.txt b/examples/dreamcast/kgl/nehe/nehe26/data/torus.txt old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe26/data/tube.txt b/examples/dreamcast/kgl/nehe/nehe26/data/tube.txt old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe26/data/txt2bin.c b/examples/dreamcast/kgl/nehe/nehe26/data/txt2bin.c old mode 100755 new mode 100644 diff --git a/examples/dreamcast/kgl/nehe/nehe26/main.c b/examples/dreamcast/kgl/nehe/nehe26/main.c old mode 100755 new mode 100644 hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-03-11 15:00:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via c8e7c2592e3b33f9da272a6f46b0d4c78b617806 (commit) from 456ca8c4005ec20ce266a795d56e00cdc67953ab (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c8e7c2592e3b33f9da272a6f46b0d4c78b617806 Author: Lawrence Sebald <ljs...@us...> Date: Fri Mar 11 10:00:25 2016 -0500 Fix GL library linking in all examples... ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/kgl/basic/elements/Makefile | 2 +- examples/dreamcast/kgl/basic/gl/Makefile | 2 +- examples/dreamcast/kgl/basic/scissor/Makefile | 2 +- examples/dreamcast/kgl/basic/txrenv/Makefile | 2 +- examples/dreamcast/kgl/basic/vq/Makefile | 2 +- examples/dreamcast/kgl/basic/zclip_arrays/Makefile | 2 +- .../dreamcast/kgl/benchmarks/quadmark/Makefile | 2 +- examples/dreamcast/kgl/benchmarks/trimark/Makefile | 2 +- .../dreamcast/kgl/benchmarks/tristripmark/Makefile | 2 +- examples/dreamcast/kgl/demos/blur/Makefile | 8 ++++---- examples/dreamcast/kgl/demos/mipmap/Makefile | 2 +- .../kgl/demos/multitexture-arrays/Makefile | 2 +- .../kgl/demos/multitexture-elements/Makefile | 2 +- examples/dreamcast/kgl/demos/specular/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe02/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe05/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe06/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe08/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe09/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe16/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe26/Makefile | 2 +- 21 files changed, 24 insertions(+), 24 deletions(-) diff --git a/examples/dreamcast/kgl/basic/elements/Makefile b/examples/dreamcast/kgl/basic/elements/Makefile index 4d25cb7..c162a08 100755 --- a/examples/dreamcast/kgl/basic/elements/Makefile +++ b/examples/dreamcast/kgl/basic/elements/Makefile @@ -21,7 +21,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/basic/gl/Makefile b/examples/dreamcast/kgl/basic/gl/Makefile index 28fea6a..75962c3 100755 --- a/examples/dreamcast/kgl/basic/gl/Makefile +++ b/examples/dreamcast/kgl/basic/gl/Makefile @@ -19,7 +19,7 @@ rm-elf: $(TARGET): $(OBJS) romdisk.o $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) romdisk.o $(OBJEXTRA) -lgl -lpcx -lkosutils $(KOS_LIBS) + $(OBJS) romdisk.o $(OBJEXTRA) -lGL -lpcx -lkosutils $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/basic/scissor/Makefile b/examples/dreamcast/kgl/basic/scissor/Makefile index d65aa5a..6dec619 100755 --- a/examples/dreamcast/kgl/basic/scissor/Makefile +++ b/examples/dreamcast/kgl/basic/scissor/Makefile @@ -20,7 +20,7 @@ rm-elf: $(TARGET): $(OBJS) romdisk.o $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) romdisk.o $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lpcx -lkosutils $(KOS_LIBS) + $(OBJS) romdisk.o $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lpcx -lkosutils $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/basic/txrenv/Makefile b/examples/dreamcast/kgl/basic/txrenv/Makefile index d52a0ab..73b8b01 100755 --- a/examples/dreamcast/kgl/basic/txrenv/Makefile +++ b/examples/dreamcast/kgl/basic/txrenv/Makefile @@ -21,7 +21,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/basic/vq/Makefile b/examples/dreamcast/kgl/basic/vq/Makefile index 348291b..18a2eb2 100755 --- a/examples/dreamcast/kgl/basic/vq/Makefile +++ b/examples/dreamcast/kgl/basic/vq/Makefile @@ -15,7 +15,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl $(KOS_LIBS) -lm + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL $(KOS_LIBS) -lm fruit.o: fruit.vq $(KOS_BASE)/utils/bin2o/bin2o fruit.vq fruit fruit.o diff --git a/examples/dreamcast/kgl/basic/zclip_arrays/Makefile b/examples/dreamcast/kgl/basic/zclip_arrays/Makefile index 975ecc5..b4a0845 100755 --- a/examples/dreamcast/kgl/basic/zclip_arrays/Makefile +++ b/examples/dreamcast/kgl/basic/zclip_arrays/Makefile @@ -21,7 +21,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/benchmarks/quadmark/Makefile b/examples/dreamcast/kgl/benchmarks/quadmark/Makefile index 7a7ba2e..4e67156 100755 --- a/examples/dreamcast/kgl/benchmarks/quadmark/Makefile +++ b/examples/dreamcast/kgl/benchmarks/quadmark/Makefile @@ -21,7 +21,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -lgl $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -lGL $(KOS_LIBS) run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/kgl/benchmarks/trimark/Makefile b/examples/dreamcast/kgl/benchmarks/trimark/Makefile index d77b86e..ea32b1c 100755 --- a/examples/dreamcast/kgl/benchmarks/trimark/Makefile +++ b/examples/dreamcast/kgl/benchmarks/trimark/Makefile @@ -20,7 +20,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -lgl $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -lGL $(KOS_LIBS) run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/kgl/benchmarks/tristripmark/Makefile b/examples/dreamcast/kgl/benchmarks/tristripmark/Makefile index b2593f5..8651a52 100755 --- a/examples/dreamcast/kgl/benchmarks/tristripmark/Makefile +++ b/examples/dreamcast/kgl/benchmarks/tristripmark/Makefile @@ -21,7 +21,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -lgl $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -lGL $(KOS_LIBS) run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/kgl/demos/blur/Makefile b/examples/dreamcast/kgl/demos/blur/Makefile index dbcdd4b..9a19c3e 100755 --- a/examples/dreamcast/kgl/demos/blur/Makefile +++ b/examples/dreamcast/kgl/demos/blur/Makefile @@ -1,6 +1,6 @@ -# -# KallistiGL Radial Blur test program -# (c)2014 Josh Pearson +# +# KallistiGL Radial Blur test program +# (c)2014 Josh Pearson # TARGET = radial_blur.elf @@ -21,7 +21,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/demos/mipmap/Makefile b/examples/dreamcast/kgl/demos/mipmap/Makefile index ce49acf..eef50a2 100755 --- a/examples/dreamcast/kgl/demos/mipmap/Makefile +++ b/examples/dreamcast/kgl/demos/mipmap/Makefile @@ -21,7 +21,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/demos/multitexture-arrays/Makefile b/examples/dreamcast/kgl/demos/multitexture-arrays/Makefile index 8d84f9e..77ddf2f 100755 --- a/examples/dreamcast/kgl/demos/multitexture-arrays/Makefile +++ b/examples/dreamcast/kgl/demos/multitexture-arrays/Makefile @@ -21,7 +21,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/demos/multitexture-elements/Makefile b/examples/dreamcast/kgl/demos/multitexture-elements/Makefile index 3a2837c..3fa7fca 100755 --- a/examples/dreamcast/kgl/demos/multitexture-elements/Makefile +++ b/examples/dreamcast/kgl/demos/multitexture-elements/Makefile @@ -21,7 +21,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/demos/specular/Makefile b/examples/dreamcast/kgl/demos/specular/Makefile index 79d5c0a..d73f3cb 100755 --- a/examples/dreamcast/kgl/demos/specular/Makefile +++ b/examples/dreamcast/kgl/demos/specular/Makefile @@ -20,7 +20,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/nehe/nehe02/Makefile b/examples/dreamcast/kgl/nehe/nehe02/Makefile index 3b2e196..b9f5c7e 100755 --- a/examples/dreamcast/kgl/nehe/nehe02/Makefile +++ b/examples/dreamcast/kgl/nehe/nehe02/Makefile @@ -20,7 +20,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/kgl/nehe/nehe05/Makefile b/examples/dreamcast/kgl/nehe/nehe05/Makefile index aec5a42..980db0b 100755 --- a/examples/dreamcast/kgl/nehe/nehe05/Makefile +++ b/examples/dreamcast/kgl/nehe/nehe05/Makefile @@ -20,7 +20,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/kgl/nehe/nehe06/Makefile b/examples/dreamcast/kgl/nehe/nehe06/Makefile index 6e80d8a..c199d00 100755 --- a/examples/dreamcast/kgl/nehe/nehe06/Makefile +++ b/examples/dreamcast/kgl/nehe/nehe06/Makefile @@ -22,7 +22,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/nehe/nehe08/Makefile b/examples/dreamcast/kgl/nehe/nehe08/Makefile index a5a6628..45f4f33 100755 --- a/examples/dreamcast/kgl/nehe/nehe08/Makefile +++ b/examples/dreamcast/kgl/nehe/nehe08/Makefile @@ -22,7 +22,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/nehe/nehe09/Makefile b/examples/dreamcast/kgl/nehe/nehe09/Makefile index b2774e0..07cb639 100755 --- a/examples/dreamcast/kgl/nehe/nehe09/Makefile +++ b/examples/dreamcast/kgl/nehe/nehe09/Makefile @@ -22,7 +22,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/nehe/nehe16/Makefile b/examples/dreamcast/kgl/nehe/nehe16/Makefile index 0d2ba8c..4b71f06 100755 --- a/examples/dreamcast/kgl/nehe/nehe16/Makefile +++ b/examples/dreamcast/kgl/nehe/nehe16/Makefile @@ -19,7 +19,7 @@ rm-elf: $(TARGET): $(OBJS) romdisk.o $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) romdisk.o $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl $(KOS_LIBS) + $(OBJS) romdisk.o $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/kgl/nehe/nehe26/Makefile b/examples/dreamcast/kgl/nehe/nehe26/Makefile index 0a092e6..47733e0 100755 --- a/examples/dreamcast/kgl/nehe/nehe26/Makefile +++ b/examples/dreamcast/kgl/nehe/nehe26/Makefile @@ -22,7 +22,7 @@ rm-elf: $(TARGET): $(OBJS) $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lGL -lm $(KOS_LIBS) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-03-04 23:05:34
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 456ca8c4005ec20ce266a795d56e00cdc67953ab (commit) from 54b738d4913023c12d2e266437fa59a0ba3f8780 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 456ca8c4005ec20ce266a795d56e00cdc67953ab Author: Lawrence Sebald <ljs...@us...> Date: Fri Mar 4 18:04:52 2016 -0500 Fix GCC version detection in the environ script for German locales (and any other locales that don't follow the same format for gcc --version. ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 3 +++ environ_base.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 17c7b5d..19440a7 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -86,6 +86,9 @@ KallistiOS version 2.1.0 ----------------------------------------------- attributes a bit more easily than what we would have to do otherwise) [LS] - *** Made thd_mode local to the threading code (if you need to get the mode at runtime, for some reason, use the new thd_get_mode() function) [LS] +- DC Patched the GCC patch so that GCC 4.7.x compiles cleanly with a newer host + GCC version [Luke Benstead == LB] +- *** Fixed GCC version detection in the environ script for some locales [LS] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Dan Potter == DP] diff --git a/environ_base.sh b/environ_base.sh index 29ce451..ff2bcfe 100644 --- a/environ_base.sh +++ b/environ_base.sh @@ -39,7 +39,7 @@ export KOS_CPPFLAGS="${KOS_CPPFLAGS} ${KOS_INC_PATHS_CPP} -fno-operator-names -f export KOS_CSTD="-std=c99" export KOS_CPPSTD="-std=gnu++98" -export KOS_GCCVER="`kos-cc -v 2>&1 | tail -1 | awk '{print $3}'`" +export KOS_GCCVER="`kos-cc -dumpversion`" case $KOS_GCCVER in 4*) hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-01-22 16:30:07
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "UNNAMED PROJECT". The branch, master has been updated via 2cd01d8781ef263a6c33b37ae27a5961352c5108 (commit) from bf8dc2e88785ca850d4331a29b0f8f39afa5b6c6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2cd01d8781ef263a6c33b37ae27a5961352c5108 Author: Lawrence Sebald <ljs...@us...> Date: Fri Jan 22 11:29:51 2016 -0500 Remove unneeded/useless reference to jiffies. ----------------------------------------------------------------------- Summary of changes: libmp3/sndmp3.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/libmp3/sndmp3.c b/libmp3/sndmp3.c index 1895db0..fc26310 100644 --- a/libmp3/sndmp3.c +++ b/libmp3/sndmp3.c @@ -301,7 +301,7 @@ void sndmp3_wait_start() { } /* Semaphore to halt sndmp3 until a command comes in */ -static semaphore_t *sndmp3_halt_sem; +static semaphore_t sndmp3_halt_sem = SEM_INITIALIZER(0); /* Loop flag */ static volatile int sndmp3_loop; @@ -309,8 +309,6 @@ static volatile int sndmp3_loop; /* Call this function as a thread to handle playback. Playback will stop and this thread will return when you call sndmp3_shutdown(). */ static void sndmp3_thread() { - int sj; - stream_hnd = snd_stream_alloc(NULL, SND_STREAM_BUFFER_MAX); assert( stream_hnd != -1 ); @@ -322,7 +320,7 @@ static void sndmp3_thread() { break; case STATUS_READY: printf("sndserver: waiting on semaphore\r\n"); - sem_wait(sndmp3_halt_sem); + sem_wait(&sndmp3_halt_sem); printf("sndserver: released from semaphore\r\n"); break; case STATUS_STARTING: @@ -340,7 +338,6 @@ static void sndmp3_thread() { sndmp3_status = STATUS_READY; break; case STATUS_PLAYING: { - sj = jiffies; if (snd_stream_poll(stream_hnd) < 0) { if (sndmp3_loop) { printf("sndserver: restarting '%s'\r\n", mp3_last_fn); @@ -398,7 +395,7 @@ int sndmp3_start(const char *fn, int loop) { sndmp3_status = STATUS_STARTING; else sndmp3_status = STATUS_REINIT; - sem_signal(sndmp3_halt_sem); + sem_signal(&sndmp3_halt_sem); return 0; } @@ -417,7 +414,7 @@ void sndmp3_stop() { /* Shutdown the player */ void sndmp3_shutdown() { sndmp3_status = STATUS_QUIT; - sem_signal(sndmp3_halt_sem); + sem_signal(&sndmp3_halt_sem); while (sndmp3_status != STATUS_ZOMBIE) thd_pass(); spu_disable(); @@ -452,8 +449,8 @@ static void sndmp3_svc_init() { /* The main loop for the sound server */ void sndmp3_mainloop() { - /* Allocate a semaphore for temporarily halting sndmp3 */ - sndmp3_halt_sem = sem_create(0); + /* Initialize the halt semaphore, in case it needs to be done... */ + sem_init(&sndmp3_halt_sem, 0); /* Setup an ABI for other programs */ /* sndmp3_svc_init(); */ @@ -466,7 +463,7 @@ void sndmp3_mainloop() { sndmp3_thread(); /* Free the semaphore */ - sem_destroy(sndmp3_halt_sem); + sem_destroy(&sndmp3_halt_sem); /* Thread exited, so we were requested to quit */ /* svcmpx->remove_handler("sndsrv"); */ hooks/post-receive -- UNNAMED PROJECT |
From: Lawrence S. <ljs...@us...> - 2016-01-14 22:01:22
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 54b738d4913023c12d2e266437fa59a0ba3f8780 (commit) from e13c6a9a643c52633085b74d6578e9866dc6ce8c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 54b738d4913023c12d2e266437fa59a0ba3f8780 Author: Luke Benstead <ka...@gm...> Date: Wed Jan 13 15:13:54 2016 +0000 Add a patch to allow compiling GCC 4.7.3 with GCC 5+ Signed-off-by: Lawrence Sebald <ljs...@us...> ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/patches/gcc-4.7.3-kos.diff | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/utils/dc-chain/patches/gcc-4.7.3-kos.diff b/utils/dc-chain/patches/gcc-4.7.3-kos.diff index cd3a5c4..5fc8151 100644 --- a/utils/dc-chain/patches/gcc-4.7.3-kos.diff +++ b/utils/dc-chain/patches/gcc-4.7.3-kos.diff @@ -2026,3 +2026,26 @@ diff -ruN gcc-4.7.3/libgcc/configure gcc-4.7.3-kos/libgcc/configure esac # Substitute configuration variables + +diff -ruN gcc-4.7.3/gcc/cp/cfns.h gcc-4.7.3-kos/gcc/cp/cfns.h +--- gcc-4.7.3/gcc/cp/cfns.h ++++ gcc-4.7.3-kos/gcc/cp/cfns.h +@@ -53,6 +53,9 @@ __inline + static unsigned int hash (const char *, unsigned int); + #ifdef __GNUC__ + __inline ++#ifdef __GNUC_STDC_INLINE__ ++__attribute__ ((__gnu_inline__)) ++#endif + #endif + const char * libc_name_p (const char *, unsigned int); + /* maximum key range = 391, duplicates = 0 */ +@@ -96,7 +99,7 @@ hash (register const char *str, register + 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, + 400, 400, 400, 400, 400, 400, 400 + }; +- register int hval = len; ++ register int hval = (int)len; + + switch (hval) + { hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-01-10 23:44:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via e13c6a9a643c52633085b74d6578e9866dc6ce8c (commit) from b9ec59a2680fc45822404437d29f128c2346f028 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e13c6a9a643c52633085b74d6578e9866dc6ce8c Author: Lawrence Sebald <ljs...@us...> Date: Sun Jan 10 18:43:06 2016 -0500 Define a __RESTRICT macro to deal with non C99/C11 compilation. Not that one should be using the C11 threading support if one isn't compiling in C11 mode, but if you did that, you'd get a compiler error about the restrict keyword. Now you won't. ;-) ----------------------------------------------------------------------- Summary of changes: include/sys/_types.h | 10 ++++++++++ include/threads.h | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/sys/_types.h b/include/sys/_types.h index 24bc22a..db252d9 100644 --- a/include/sys/_types.h +++ b/include/sys/_types.h @@ -128,4 +128,14 @@ typedef void *_iconv_t; // Include stuff to make pthreads work as well. #include <sys/_pthread.h> +#ifndef __RESTRICT +#if (__STDC_VERSION__ >= 199901L) +#define __RESTRICT restrict +#elif defined(__GNUC__) || defined(__GNUG__) +#define __RESTRICT __restrict +#else /* < C99 and not GCC */ +#define __RESTRICT +#endif +#endif /* !__RESTRICT */ + #endif /* _SYS__TYPES_H */ diff --git a/include/threads.h b/include/threads.h index 51105fd..199fa18 100644 --- a/include/threads.h +++ b/include/threads.h @@ -155,8 +155,8 @@ extern int mtx_lock(mtx_t *mtx); \note Although timeouts are specified in seconds and nanoseconds, the timeout will be rounded up to the nearest millisecond. */ -extern int mtx_timedlock(mtx_t *restrict mtx, - const struct timespec *restrict ts); +extern int mtx_timedlock(mtx_t *__RESTRICT mtx, + const struct timespec *__RESTRICT ts); /** \brief Attempt to acquire a mutex lock. @@ -268,8 +268,8 @@ extern int cnd_signal(cnd_t *cond); \note Although timeouts are specified in seconds and nanoseconds, the timeout will be rounded up to the nearest millisecond. */ -extern int cnd_timedwait(cnd_t *restrict cond, mtx_t *restrict mtx, - const struct timespec *restrict ts); +extern int cnd_timedwait(cnd_t *__RESTRICT cond, mtx_t *__RESTRICT mtx, + const struct timespec *__RESTRICT ts); /** \brief Wait on a condition variable. hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-01-10 01:42:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via b9ec59a2680fc45822404437d29f128c2346f028 (commit) from 576956b93dbb1711ab741098f4d17032e1f995f1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b9ec59a2680fc45822404437d29f128c2346f028 Author: Lawrence Sebald <ljs...@us...> Date: Sat Jan 9 20:42:04 2016 -0500 Make thd_mode a static variable and add a thd_get_mode() function. There's still plenty of other things that shouldn't be globals... ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 2 ++ include/kos/thread.h | 17 +++++++---------- kernel/thread/thread.c | 6 +++++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index f6e107a..17c7b5d 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -84,6 +84,8 @@ KallistiOS version 2.1.0 ----------------------------------------------- - *** Added the thd_create_ex() function to create a thread with a given set of attributes set at thread creation (allowing us to expand that list of attributes a bit more easily than what we would have to do otherwise) [LS] +- *** Made thd_mode local to the threading code (if you need to get the mode at + runtime, for some reason, use the new thd_get_mode() function) [LS] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Dan Potter == DP] diff --git a/include/kos/thread.h b/include/kos/thread.h index 9d97a8f..9f68190 100644 --- a/include/kos/thread.h +++ b/include/kos/thread.h @@ -222,18 +222,9 @@ typedef struct kthread_attr { const char *label; } kthread_attr_t; -/** \brief Are threads cooperative or preemptive? - - Do not modify this variable directly. Instead, use the thd_set_mode() - function to switch threading modes. - - \see thd_modes -*/ -extern int thd_mode; - /** \defgroup thd_modes Threading system modes - The thd_mode variable will always have one of this set of values. This + The threading system will always be in one of the following modes. This represents the type of scheduling done by the system (or the special case of threads not having been initialized yet). @@ -504,6 +495,12 @@ struct _reent * thd_get_reent(kthread_t *thd); */ int thd_set_mode(int mode); +/** \brief Fetch the current threading mode. + + \return The current mode of the threading system. +*/ +int thd_get_mode(void); + /** \brief Wait for a thread to exit. This function "joins" a joinable thread. This means effectively that the diff --git a/kernel/thread/thread.c b/kernel/thread/thread.c index f87dd96..f532345 100644 --- a/kernel/thread/thread.c +++ b/kernel/thread/thread.c @@ -54,7 +54,7 @@ static struct ktqueue run_queue; kthread_t *thd_current = NULL; /* Thread mode: cooperative or pre-emptive. */ -int thd_mode = THD_MODE_NONE; +static int thd_mode = THD_MODE_NONE; /* Reaper semaphore. Counts the number of threads waiting to be reaped. */ static semaphore_t thd_reap_sem; @@ -818,6 +818,10 @@ int thd_set_mode(int mode) { return old; } +int thd_get_mode(void) { + return thd_mode; +} + /* Delete a TLS key. Note that currently this doesn't prevent you from reusing the key after deletion. This seems ok, as the pthreads standard states that using the key after deletion results in "undefined behavior". hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-01-10 01:04:30
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 576956b93dbb1711ab741098f4d17032e1f995f1 (commit) from e2a563be65477c5016f88555f6de69aed9390e19 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 576956b93dbb1711ab741098f4d17032e1f995f1 Author: Lawrence Sebald <ljs...@us...> Date: Sat Jan 9 20:04:15 2016 -0500 Add new thd_create_ex() function. ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 4 +++ include/kos/thread.h | 48 +++++++++++++++++++++++++++++++++++++- kernel/thread/thread.c | 60 +++++++++++++++++++++++++++++++++++++---------- 3 files changed, 98 insertions(+), 14 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 24b1ec5..f6e107a 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -80,6 +80,10 @@ KallistiOS version 2.1.0 ----------------------------------------------- - *** Changed libc/koslib/byteorder.c functions to use the <arch/byteorder.h> macros, instead of being hard-coded as little-endian [LS] - DC Added Opus decoding example using libopusplay [LS] +- *** Removed jiffy "counter" that wasn't actually counting anything [LS] +- *** Added the thd_create_ex() function to create a thread with a given set of + attributes set at thread creation (allowing us to expand that list of + attributes a bit more easily than what we would have to do otherwise) [LS] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Dan Potter == DP] diff --git a/include/kos/thread.h b/include/kos/thread.h index b279423..9d97a8f 100644 --- a/include/kos/thread.h +++ b/include/kos/thread.h @@ -38,7 +38,7 @@ __BEGIN_DECLS The scheduler supports two distinct types of threads: joinable and detached threads. A joinable thread is one that can return a value to the creating thread (or for that matter, any other thread that wishes to join it). A - detached thread is one taht is completely detached from the rest of the + detached thread is one that is completely detached from the rest of the system and cannot return values by "normal" means. Detached threads automatically clean up all of the internal resources associated with the thread when it exits. Joinable threads, on the other hand, must keep some @@ -192,6 +192,36 @@ typedef struct kthread { #define STATE_FINISHED 0x0004 /**< \brief Finished execution */ /** @} */ +/** \brief Thread creation attributes. + + This structure allows you to specify the various attributes for a thread to + have when it is created. These can only be modified (in general) at thread + creation time (with the exception of detaching a thread, which can be done + later with thd_detach()). + + Leaving any of the attributes in this structure 0 will set them to their + default value. + + \headerfile kos/thread.h +*/ +typedef struct kthread_attr { + /** \brief 1 for a detached thread. */ + int create_detached; + + /** \brief Set the size of the stack to be created. */ + uint32 stack_size; + + /** \brief Pre-allocate a stack for the thread. + \note If you use this attribute, you must also set stack_size. */ + void *stack_ptr; + + /** \brief Set the thread's priority. */ + prio_t prio; + + /** \brief Thread label. */ + const char *label; +} kthread_attr_t; + /** \brief Are threads cooperative or preemptive? Do not modify this variable directly. Instead, use the thd_set_mode() @@ -298,6 +328,22 @@ int thd_remove_from_runnable(kthread_t *thd); */ kthread_t *thd_create(int detach, void * (*routine)(void *param), void *param); +/** \brief Create a new thread with the specified set of attributes. + + This function creates a new kernel thread with the specified set of + parameters to run the given routine. + + \param attr A set of thread attributes for the created thread. + Passing NULL will initialize all attributes to their + default values. + \param routine The function to call in the new thread. + \param param A parameter to pass to the function called. + + \return The new thread on success, NULL on failure. +*/ +kthread_t *thd_create_ex(kthread_attr_t *attr, void *(*routine)(void *), + void *param); + /** \brief Brutally kill the given thread. This function kills the given thread, removing it from the execution chain, diff --git a/kernel/thread/thread.c b/kernel/thread/thread.c index 836210f..f87dd96 100644 --- a/kernel/thread/thread.c +++ b/kernel/thread/thread.c @@ -316,13 +316,31 @@ int thd_remove_from_runnable(kthread_t *thd) { } /* New thread function; given a routine address, it will create a - new kernel thread with a default stack. When the routine + new kernel thread with the given attributes. When the routine returns, the thread will exit. Returns the new thread struct. */ -kthread_t *thd_create(int detach, void * (*routine)(void *param), void *param) { +kthread_t *thd_create_ex(kthread_attr_t *attr, void * (*routine)(void *param), + void *param) { kthread_t *nt = NULL; tid_t tid; uint32 params[4]; int oldirq = 0; + kthread_attr_t real_attr = { 0, THD_STACK_SIZE, NULL, PRIO_DEFAULT, NULL }; + + if(attr) + real_attr = *attr; + + /* Look through the attributes and see what we have. If any are set to 0, + then default them now to save ourselves trouble later. */ + if(real_attr.stack_ptr && !real_attr.stack_size) { + errno = EINVAL; + return NULL; + } + + if(!real_attr.stack_size) + real_attr.stack_size = THD_STACK_SIZE; + + if(!real_attr.prio) + real_attr.prio = PRIO_DEFAULT; oldirq = irq_disable(); @@ -338,15 +356,20 @@ kthread_t *thd_create(int detach, void * (*routine)(void *param), void *param) { memset(nt, 0, sizeof(kthread_t)); /* Create a new thread stack */ - nt->stack = (uint32*)malloc(THD_STACK_SIZE); - - if(!nt->stack) { - free(nt); - irq_restore(oldirq); - return NULL; + if(!real_attr.stack_ptr) { + nt->stack = (uint32*)malloc(real_attr.stack_size); + + if(!nt->stack) { + free(nt); + irq_restore(oldirq); + return NULL; + } + } + else { + nt->stack = (uint32*)real_attr.stack_ptr; } - nt->stack_size = THD_STACK_SIZE; + nt->stack_size = real_attr.stack_size; /* Populate the context */ params[0] = (uint32)routine; @@ -358,10 +381,17 @@ kthread_t *thd_create(int detach, void * (*routine)(void *param), void *param) { (uint32)thd_birth, params, 0); nt->tid = tid; - nt->prio = PRIO_DEFAULT; + nt->prio = real_attr.prio; nt->flags = THD_DEFAULTS; nt->state = STATE_READY; - strcpy(nt->label, "[un-named kernel thread]"); + + if(!real_attr.label) { + strcpy(nt->label, "[un-named kernel thread]"); + } + else { + strncpy(nt->label, real_attr.label, 255); + nt->label[255] = 0; + } if(thd_current) strcpy(nt->pwd, thd_current->pwd); @@ -371,9 +401,8 @@ kthread_t *thd_create(int detach, void * (*routine)(void *param), void *param) { _REENT_INIT_PTR((&(nt->thd_reent))); /* Should we detach the thread? */ - if(detach) { + if(real_attr.create_detached) nt->flags |= THD_DETACHED; - } /* Initialize thread-local storage. */ LIST_INIT(&nt->tls_list); @@ -393,6 +422,11 @@ kthread_t *thd_create(int detach, void * (*routine)(void *param), void *param) { return nt; } +kthread_t *thd_create(int detach, void *(*routine)(void *), void *param) { + kthread_attr_t attrs = { detach, 0, 0, 0, 0 }; + return thd_create_ex(&attrs, routine, param); +} + /* Given a thread id, this function removes the thread from the execution chain. */ int thd_destroy(kthread_t *thd) { hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-01-09 22:31:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via e2a563be65477c5016f88555f6de69aed9390e19 (commit) via b2851db06ec462c825c706a0a1d14eb93d6c15d6 (commit) from fa8b5050dc37552fd0b3772f1c53bd80300031c9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e2a563be65477c5016f88555f6de69aed9390e19 Author: Lawrence Sebald <ljs...@us...> Date: Sat Jan 9 17:30:58 2016 -0500 Remove jiffies from thread.c. Not that it was actually counting anything anyway... commit b2851db06ec462c825c706a0a1d14eb93d6c15d6 Author: Lawrence Sebald <ljs...@us...> Date: Sat Jan 9 17:29:19 2016 -0500 Remove jiffies from thread.h. ----------------------------------------------------------------------- Summary of changes: include/kos/thread.h | 11 +---------- kernel/thread/thread.c | 9 +-------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/include/kos/thread.h b/include/kos/thread.h index dcbcf4c..b279423 100644 --- a/include/kos/thread.h +++ b/include/kos/thread.h @@ -2,7 +2,7 @@ include/kos/thread.h Copyright (C) 2000, 2001, 2002, 2003 Dan Potter - Copyright (C) 2009, 2010 Lawrence Sebald + Copyright (C) 2009, 2010, 2016 Lawrence Sebald */ @@ -220,13 +220,6 @@ extern int thd_mode; */ extern kthread_t *thd_current; -/** \brief "Jiffy" count. - - This variable counts the number of context switches done by the threading - system. Do not manipulate this variable directly! -*/ -extern vuint32 jiffies; - /** \brief Block the current thread. Blocks the calling thread and performs a reschedule as if a context switch @@ -510,7 +503,6 @@ int thd_pslist(int (*pf)(const char *fmt, ...)); */ int thd_pslist_queue(int (*pf)(const char *fmt, ...)); - /** \brief Initialize the threading system. This is normally done for you by default when KOS starts. This will also @@ -533,4 +525,3 @@ void thd_shutdown(); __END_DECLS #endif /* __KOS_THREAD_H */ - diff --git a/kernel/thread/thread.c b/kernel/thread/thread.c index c8408a1..836210f 100644 --- a/kernel/thread/thread.c +++ b/kernel/thread/thread.c @@ -2,7 +2,7 @@ kernel/thread/thread.c Copyright (C) 2000, 2001, 2002, 2003 Dan Potter - Copyright (C) 2010 Lawrence Sebald + Copyright (C) 2010, 2016 Lawrence Sebald */ #include <stdlib.h> @@ -50,10 +50,6 @@ static struct ktlist thd_list; same queue. We deal with those in thd_switch below. */ static struct ktqueue run_queue; -/* "Jiffy" count: this is basically a counter that gets incremented each - time a timer interrupt happens. */ -vuint32 jiffies; - /* The currently executing thread. This thread should not be on any queues. */ kthread_t *thd_current = NULL; @@ -886,9 +882,6 @@ int thd_init(int mode) { thd_current = kern; irq_set_context(&kern->context); - /* Re-initialize jiffy counter */ - jiffies = 0; - /* Initialize thread sync primitives */ genwait_init(); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-01-09 22:21:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via fa8b5050dc37552fd0b3772f1c53bd80300031c9 (commit) via 7c2bb6d15d55ab39f2ae1e9f1242d9984a08c5b2 (commit) from 1fa6cd33e3f571665a699069824c9b974fa1a5a3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit fa8b5050dc37552fd0b3772f1c53bd80300031c9 Author: Lawrence Sebald <ljs...@us...> Date: Sat Jan 9 17:20:37 2016 -0500 Don't use jiffies in the ARP code. This removes the use of the jiffies variable in net_arp in favor of using the millisecond timer, like NDP does. This is the last use of jiffies anywhere in the kernel outside of the threading code. Be warned, jiffies is going away. commit 7c2bb6d15d55ab39f2ae1e9f1242d9984a08c5b2 Author: Lawrence Sebald <ljs...@us...> Date: Sat Jan 9 12:43:41 2016 -0500 Update a few pieces of documentation... ----------------------------------------------------------------------- Summary of changes: AUTHORS | 2 +- doc/FAQ | 3 +-- doc/README.KOS | 4 ++-- include/kos/net.h | 8 +++++--- kernel/net/net_arp.c | 24 ++++++++++++++---------- kernel/net/net_ipv4.c | 8 +++++--- 6 files changed, 28 insertions(+), 21 deletions(-) diff --git a/AUTHORS b/AUTHORS index 8f3b3a8..365dc94 100644 --- a/AUTHORS +++ b/AUTHORS @@ -22,7 +22,7 @@ please see the README.KOS file in the doc directory. Contributors list (under the normal KOS license): ------------------------------------------------- Dan Potter: 1997, 2000, 2001, 2002, 2003, 2004 -Lawrence Sebald: 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 +Lawrence Sebald: 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Sam Steele: 2004 Gil Megidish: 2002 Florian Schulze: 2002 diff --git a/doc/FAQ b/doc/FAQ index d296889..2381977 100644 --- a/doc/FAQ +++ b/doc/FAQ @@ -237,8 +237,7 @@ called 'dc-load'. DC-Load is Andrew Kieschnick's BBA/Serial port loader program. If you use the DC-Load console, then you can read files directly from your in the /pc directory. The other major advantage (if you are using a BBA) is that DC-Load will redirect console messages over -the ethernet for you. There is also the ps2-load-ip console for PS2 RTE -development which performs a similar function. +the ethernet for you. - VMU -- mounts on /vmu, what it sounds like. This dynamic file system shows all detected VMU or memory cards on the maple bus and lets you diff --git a/doc/README.KOS b/doc/README.KOS index 268e9f4..cd3bf69 100644 --- a/doc/README.KOS +++ b/doc/README.KOS @@ -40,10 +40,10 @@ The actual license terms begin below this line: -------------------------------------------------------------------------------- All of the documentation and software included in the KallistiOS Releases -is copyrighted (C) 1997-2015 by Dan Potter, Lawrence Sebald, and others (as +is copyrighted (C) 1997-2016 by Dan Potter, Lawrence Sebald, and others (as noted in each file). -Copyright (C) 1997-2015 KallistiOS Contributors. All rights reserved. +Copyright (C) 1997-2016 KallistiOS Contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/include/kos/net.h b/include/kos/net.h index bb42f1f..eff754b 100644 --- a/include/kos/net.h +++ b/include/kos/net.h @@ -2,7 +2,8 @@ include/kos/net.h Copyright (C) 2002 Dan Potter - Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Lawrence Sebald + Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013, + 2016 Lawrence Sebald */ @@ -256,11 +257,12 @@ void net_arp_shutdown(void); \param mac The MAC address of the entry. \param ip The IPv4 address of the entry. \param timestamp The entry's timestamp. Set to 0 for a permanent - entry, otherwise set to jiffies. + entry, otherwise set to the current number of + milliseconds since boot (i.e, timer_ms_gettime64()). \retval 0 On success (no error conditions defined). */ int net_arp_insert(netif_t *nif, const uint8 mac[6], const uint8 ip[4], - uint32 timestamp); + uint64 timestamp); /** \brief Look up an entry from the ARP cache. diff --git a/kernel/net/net_arp.c b/kernel/net/net_arp.c index c616d7e..360e742 100644 --- a/kernel/net/net_arp.c +++ b/kernel/net/net_arp.c @@ -3,7 +3,7 @@ kernel/net/net_arp.c Copyright (C) 2002 Dan Potter - Copyright (C) 2005, 2010, 2012, 2013 Lawrence Sebald + Copyright (C) 2005, 2010, 2012, 2013, 2016 Lawrence Sebald */ #include <string.h> @@ -11,6 +11,7 @@ #include <stdio.h> #include <kos/net.h> #include <kos/thread.h> +#include <arch/timer.h> #include "net_ipv4.h" @@ -49,7 +50,7 @@ typedef struct netarp { uint8 ip[4]; /* Cache entry time; if zero, this entry won't expire */ - uint32 timestamp; + uint64 timestamp; /* Optional packet to send when the entry is filled in */ ip_hdr_t *pkt; @@ -76,6 +77,7 @@ struct netarp_list net_arp_cache = LIST_HEAD_INITIALIZER(0); /* Garbage collect timed out entries */ static int net_arp_gc(netif_t *nif) { netarp_t *a1, *a2; + uint64 now = timer_ms_gettime64(); a1 = LIST_FIRST(&net_arp_cache); @@ -83,7 +85,7 @@ static int net_arp_gc(netif_t *nif) { a2 = LIST_NEXT(a1, ac_list); if(a1->timestamp) { - if(jiffies >= (a1->timestamp + 120 * HZ)) { + if(now >= (a1->timestamp + 120 * 1000)) { LIST_REMOVE(a1, ac_list); if(a1->pkt) { @@ -100,7 +102,7 @@ static int net_arp_gc(netif_t *nif) { since we queried it, try again. */ if(a1->mac[0] == 0 && a1->mac[1] == 0 && a1->mac[2] == 0 && a1->mac[3] == 0 && a1->mac[4] == 0 && a1->mac[5] == 0 && - jiffies > (a1->timestamp + 5 * HZ)) { + now > (a1->timestamp + 5 * 1000)) { net_arp_query(nif, a1->ip); } } @@ -113,7 +115,7 @@ static int net_arp_gc(netif_t *nif) { /* Add an entry to the ARP cache manually */ int net_arp_insert(netif_t *nif, const uint8 mac[6], const uint8 ip[4], - uint32 timestamp) { + uint64 timestamp) { netarp_t *cur; /* First make sure the entry isn't already there */ @@ -176,7 +178,7 @@ int net_arp_lookup(netif_t *nif, const uint8 ip_in[4], uint8 mac_out[6], memcpy(mac_out, cur->mac, 6); if(cur->timestamp != 0) - cur->timestamp = jiffies; + cur->timestamp = timer_ms_gettime64(); return 0; } @@ -186,7 +188,7 @@ int net_arp_lookup(netif_t *nif, const uint8 ip_in[4], uint8 mac_out[6], cur = (netarp_t *)malloc(sizeof(netarp_t)); memset(cur, 0, sizeof(netarp_t)); memcpy(cur->ip, ip_in, 4); - cur->timestamp = jiffies; + cur->timestamp = timer_ms_gettime64(); /* Copy our packet if we have one to copy. */ if(pkt && data && data_size) { @@ -230,7 +232,7 @@ int net_arp_revlookup(netif_t *nif, uint8 ip_out[4], const uint8 mac_in[6]) { memcpy(ip_out, cur->ip, 4); if(cur->timestamp != 0) - cur->timestamp = jiffies; + cur->timestamp = timer_ms_gettime64(); return 0; } @@ -288,10 +290,12 @@ int net_arp_input(netif_t *nif, const uint8 *pkt_in, int len) { net_arp_send(nif, pkt); case 2: /* ARP Reply */ /* Insert into ARP cache */ - net_arp_insert(nif, pkt->hw_send, pkt->pr_send, jiffies); + net_arp_insert(nif, pkt->hw_send, pkt->pr_send, + timer_ms_gettime64()); break; default: - dbglog(DBG_KDEBUG, "net_arp: Unknown ARP Opcode: %d\n", pkt->opcode[1]); + dbglog(DBG_KDEBUG, "net_arp: Unknown ARP Opcode: %d\n", + pkt->opcode[1]); } return 0; diff --git a/kernel/net/net_ipv4.c b/kernel/net/net_ipv4.c index 61f819f..69597ff 100644 --- a/kernel/net/net_ipv4.c +++ b/kernel/net/net_ipv4.c @@ -2,10 +2,11 @@ kernel/net/net_ipv4.c - Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Lawrence Sebald + Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013, + 2016 Lawrence Sebald Portions adapted from KOS' old net_icmp.c file: - Copyright (c) 2002 Dan Potter + Copyright (C) 2002 Dan Potter */ @@ -16,6 +17,7 @@ #include <arpa/inet.h> #include <kos/net.h> #include <kos/fs_socket.h> +#include <arch/timer.h> #include "net_ipv4.h" #include "net_icmp.h" @@ -243,7 +245,7 @@ int net_ipv4_input(netif_t *src, const uint8 *pkt, size_t pktsize, /* Add the sender to the ARP cache, if they're not already there. */ if(eth) { net_ipv4_parse_address(ntohl(ip->src), ipa); - net_arp_insert(src, eth->src, ipa, jiffies); + net_arp_insert(src, eth->src, ipa, timer_ms_gettime64()); } /* Submit the packet for possible reassembly. */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-01-09 05:04:35
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 1fa6cd33e3f571665a699069824c9b974fa1a5a3 (commit) from 603f700514cdc331f771845ffc063bbdb5ef9980 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1fa6cd33e3f571665a699069824c9b974fa1a5a3 Author: Lawrence Sebald <ljs...@us...> Date: Sat Jan 9 00:04:23 2016 -0500 Add Opus example. ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 1 + examples/dreamcast/sound/Makefile | 3 + .../sound/{hello-mp3 => hello-opus}/Makefile | 16 ++--- examples/dreamcast/sound/hello-opus/README | 3 + examples/dreamcast/sound/hello-opus/opustest.c | 68 ++++++++++++++++++++ .../dreamcast/sound/hello-opus/romdisk}/.keepme | 0 6 files changed, 82 insertions(+), 9 deletions(-) copy examples/dreamcast/sound/{hello-mp3 => hello-opus}/Makefile (66%) create mode 100644 examples/dreamcast/sound/hello-opus/README create mode 100644 examples/dreamcast/sound/hello-opus/opustest.c copy {addons/lib => examples/dreamcast/sound/hello-opus/romdisk}/.keepme (100%) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 96c9a05..24b1ec5 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -79,6 +79,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- - *** Added fstat support to fs_ext2, fs_ramdisk, fs_romdisk, and fs_pty [LS] - *** Changed libc/koslib/byteorder.c functions to use the <arch/byteorder.h> macros, instead of being hard-coded as little-endian [LS] +- DC Added Opus decoding example using libopusplay [LS] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Dan Potter == DP] diff --git a/examples/dreamcast/sound/Makefile b/examples/dreamcast/sound/Makefile index d42dd5d..a644511 100644 --- a/examples/dreamcast/sound/Makefile +++ b/examples/dreamcast/sound/Makefile @@ -9,17 +9,20 @@ all: $(KOS_MAKE) -C hello-ogg $(KOS_MAKE) -C hello-mp3 $(KOS_MAKE) -C cdda + $(KOS_MAKE) -C hello-opus clean: $(KOS_MAKE) -C ghettoplay-vorbis clean $(KOS_MAKE) -C hello-ogg clean $(KOS_MAKE) -C hello-mp3 clean $(KOS_MAKE) -C cdda clean + $(KOS_MAKE) -C hello-opus clean dist: $(KOS_MAKE) -C ghettoplay-vorbis dist $(KOS_MAKE) -C hello-ogg dist $(KOS_MAKE) -C hello-mp3 dist $(KOS_MAKE) -C cdda dist + $(KOS_MAKE) -C hello-opus dist diff --git a/examples/dreamcast/sound/hello-mp3/Makefile b/examples/dreamcast/sound/hello-opus/Makefile similarity index 66% copy from examples/dreamcast/sound/hello-mp3/Makefile copy to examples/dreamcast/sound/hello-opus/Makefile index dc2cb58..0b5264f 100644 --- a/examples/dreamcast/sound/hello-mp3/Makefile +++ b/examples/dreamcast/sound/hello-opus/Makefile @@ -1,6 +1,5 @@ - -TARGET = mp3test.elf -OBJS = romdisk.o mp3test.o +TARGET = opustest.elf +OBJS = romdisk.o opustest.o all: clean $(TARGET) @@ -10,8 +9,9 @@ clean: -rm -f $(TARGET) $(OBJS) -rm -f romdisk.o romdisk.img -$(TARGET): $(OBJS) - kos-cc -o $(TARGET) $(OBJS) $(DATAOBJS) $(OBJEXTRA) -lmp3 -lm +$(TARGET): $(OBJS) + kos-cc -o $(TARGET) $(OBJS) $(DATAOBJS) $(OBJEXTRA) \ + -lopusplay -lopusfile -lopus -logg romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v @@ -19,11 +19,9 @@ romdisk.img: romdisk.o: romdisk.img $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o -run: +run: $(KOS_LOADER) $(TARGET) -# dc-tool -p -b 115200 -x $(TARGET) -dist: +dist: $(TARGET) rm -f $(OBJS) romdisk.o romdisk.img $(KOS_STRIP) $(TARGET) - diff --git a/examples/dreamcast/sound/hello-opus/README b/examples/dreamcast/sound/hello-opus/README new file mode 100644 index 0000000..c811b0d --- /dev/null +++ b/examples/dreamcast/sound/hello-opus/README @@ -0,0 +1,3 @@ +This example expects a file called "test.opus" to exist in the root of the +romdisk. Put a relatively small Opus file with the correct filename in the +romdisk directory before compiling if you want the example to work. ;) diff --git a/examples/dreamcast/sound/hello-opus/opustest.c b/examples/dreamcast/sound/hello-opus/opustest.c new file mode 100644 index 0000000..0c743db --- /dev/null +++ b/examples/dreamcast/sound/hello-opus/opustest.c @@ -0,0 +1,68 @@ +/* Opusplay for KallistiOS ##version## + + opustest.c + Simple "Hello World" style example of Opus playback. + + Copyright (C) 2015 Lawrence Sebald +*/ + +#include <stdio.h> + +#include <kos/dbgio.h> + +#include <dc/maple.h> +#include <dc/maple/controller.h> +#include <dc/sound/stream.h> + +#include <opusplay/opusplay.h> + +extern uint8 romdisk[]; +KOS_INIT_ROMDISK(romdisk); + +int main(int argc, char **argv) { + maple_device_t *cont; + cont_state_t *state; + + dbgio_dev_select("fb"); + + printf("Opus Decoder Library Example Program\n\n"); + + opusplay_init(); + + if(opusplay_play_file("/rd/test.opus", 0)) { + printf("Cannot play /rd/test.opus!\n"); + printf("Did you remember to put an opus file in the\n" + "romdisk before compiling?\n"); + thd_sleep(10 * 1000); + + opusplay_shutdown(); + snd_stream_shutdown(); + return 0; + } + + printf("The Opus file should now be playing in a thread...\n\n"); + printf("Press START to exit and (Y) to restart playback.\n"); + + while(1) { + if((cont = maple_enum_type(0, MAPLE_FUNC_CONTROLLER))) { + if((state = (cont_state_t *)maple_dev_status(cont))) { + if(state->buttons & CONT_START) + break; + + if(state->buttons & CONT_Y) { + opusplay_stop(); + opusplay_play_file("/rd/test.opus", 0); + } + } + + thd_sleep(100); + } + + } + + printf("Cleaning up...\n"); + opusplay_stop(); + opusplay_shutdown(); + snd_stream_shutdown(); + return 0; +} diff --git a/addons/lib/.keepme b/examples/dreamcast/sound/hello-opus/romdisk/.keepme similarity index 100% copy from addons/lib/.keepme copy to examples/dreamcast/sound/hello-opus/romdisk/.keepme hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-01-09 03:09:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 603f700514cdc331f771845ffc063bbdb5ef9980 (commit) via 895654096c7acb6841b8e6af451196959d74b8d8 (commit) from a0b9d7798f1612c9c49f6bd46878bebcbbb09473 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 603f700514cdc331f771845ffc063bbdb5ef9980 Author: Lawrence Sebald <ljs...@us...> Date: Fri Jan 8 22:08:55 2016 -0500 Add a simple SDL-based audio example (more of a regression test than anything)... commit 895654096c7acb6841b8e6af451196959d74b8d8 Author: Lawrence Sebald <ljs...@us...> Date: Fri Jan 8 18:40:11 2016 -0500 Update RELNOTES. ----------------------------------------------------------------------- Summary of changes: doc/RELNOTES | 16 ++++++- examples/dreamcast/sdl/Makefile | 22 +++++++++ examples/dreamcast/sdl/sound/Makefile | 18 +++++++ examples/dreamcast/sdl/sound/example.c | 81 ++++++++++++++++++++++++++++++++ 4 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 examples/dreamcast/sdl/Makefile create mode 100644 examples/dreamcast/sdl/sound/Makefile create mode 100644 examples/dreamcast/sdl/sound/example.c diff --git a/doc/RELNOTES b/doc/RELNOTES index 52bb7a7..256de5a 100644 --- a/doc/RELNOTES +++ b/doc/RELNOTES @@ -1,6 +1,6 @@ KallistiOS ##version## Copyright (C) 2002, 2003 Dan Potter -Copyright (C) 2012-2015 Lawrence Sebald +Copyright (C) 2012-2016 Lawrence Sebald RELEASE NOTES for 2.1.0 ----------------------- @@ -31,7 +31,9 @@ something like fs_stat("/vmu/a1", &buf, 0), you will still get the number of free blocks in buf.st_size (the standard doesn't say what to do with the st_size value on a stat() call about a directory, so this is actually compliant with the standard, oddly enough). More filesystems support fs_stat() directly now, such -as fs_dcload/fs_dclsocket. +as fs_dcload/fs_dclsocket. Also added is an fs_fstat() call (which, of course, +maps onto the normal C fstat() function). If a filesystem doesn't support +fs_fstat(), it will get a simple mapped version of it, much like with fs_stat(). Hardware-wise, a new driver was added for accessing a hard drive that might be hooked directly up to the GD-ROM port. The GD-ROM itself is actually a bit of a @@ -71,6 +73,16 @@ updated to 5.3.0. liboggvorbisplay has been split into three libraries: libogg, libvorbis, and liboggvorbisplay (the first two are the official libraries from Xiph.org and liboggvorbisplay is the KOS wrapper for them). +Also, speaking of kos-ports, SDL has been updated a bit to version 1.2.15. If +anyone is interested in updating SDL further to the 2.x versions, feel free to +contact me. As of now, nobody's maintaining the KOS port of SDL, so it could use +a maintainer too. Continuing on with kos-ports news, a port of the Opus audio +codec (the successor to Vorbis and Speex) has been added. Like the Vorbis port, +this one is split into multiple libraries, mirroring how it is distributed. Opus +and Opusfile are direct from Xiph.org. The libopusplay library links against +those two libraries and adds in the KOS-specific interface, which should look +very familiar to anyone who's used liboggvorbisplay. + RELEASE NOTES for 2.0.0 ----------------------- This release has been a long time coming, to say the least. Pretty much every diff --git a/examples/dreamcast/sdl/Makefile b/examples/dreamcast/sdl/Makefile new file mode 100644 index 0000000..38a6336 --- /dev/null +++ b/examples/dreamcast/sdl/Makefile @@ -0,0 +1,22 @@ +DIRS = sound + +all: + @for i in $(DIRS); do \ + echo "Building example $$i..."; \ + $(KOS_MAKE) -C $$i || exit -1; \ + echo ""; \ + done + +clean: + @for i in $(DIRS); do \ + echo "Cleaning example $$i..."; \ + $(KOS_MAKE) -C $$i clean || exit -1; \ + echo ""; \ + done + +dist: + @for i in $(DIRS); do \ + echo "Building example $$i (dist mode)..."; \ + $(KOS_MAKE) -C $$i dist || exit -1; \ + echo ""; \ + done diff --git a/examples/dreamcast/sdl/sound/Makefile b/examples/dreamcast/sdl/sound/Makefile new file mode 100644 index 0000000..866faae --- /dev/null +++ b/examples/dreamcast/sdl/sound/Makefile @@ -0,0 +1,18 @@ +TARGET = sdl_sound.elf +OBJS = example.o + +all: clean $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) + +$(TARGET): $(OBJS) + kos-cc -o $(TARGET) $(OBJS) $(DATAOBJS) $(OBJEXTRA) -lSDL + +run: + $(KOS_LOADER) $(TARGET) + +dist: $(TARGET) + $(KOS_STRIP) $(TARGET) diff --git a/examples/dreamcast/sdl/sound/example.c b/examples/dreamcast/sdl/sound/example.c new file mode 100644 index 0000000..1390110 --- /dev/null +++ b/examples/dreamcast/sdl/sound/example.c @@ -0,0 +1,81 @@ +/* KallistiOS ##version## + + sdl/sound/example.c + Copyright (C) 2016 Lawrence Sebald +*/ + +/* This is a basic demonstration of how to set up and play audio with SDL on the + Dreamcast. It isn't actually meant as an example of how to do things the + right way, but rather as more of a regression test to make sure that SDL + still works... + + That all said, it does show how to set up a very simple audio callback to + generate sound. In the case of this example, a simple tone generated from a + sine wave is what is played. Of course, more complex things are possible, but + are left as an exercise for the reader. ;-) +*/ + +#include <SDL/SDL.h> +#include <dc/fmath.h> + +/* Amplitude controls the volume of the generated sound. Valid values are + anything from 0 to 32767. 16384 works nicely here. Don't change it. ;-) */ +#define AMPLITUDE 16384 + +/* 44100HZ audio frequency... Pretty standard. */ +#define FRQ_44KHZ 44100 + +/* This controls what tone is generated. Feel free to play with this if you want + to make different sounds. */ +#define INCREMENT 1.0f / 100.0f + +static float pos = 0.0f; + +/* Generate a nice pretty sine wave for some simple audio. */ +static void audio_callback(void *userdata, Uint8 *stream, int length) { + Sint16 *out = (Sint16 *)stream; + int i; + + /* Length is in bytes, we're generating 16 bit samples, so divide the length + by two to get the number of samples to generate. */ + length >>= 1; + + /* Generate samples on demand. */ + for(i = 0; i < length; ++i) { + out[i] = (Sint16)(fsin(pos * F_PI) * AMPLITUDE); + pos += INCREMENT; + + if(pos >= 2.0f) + pos -= 2.0f; + } +} + +int main(int argc, char *argv[]) { + SDL_AudioSpec spec, rspec; + + /* All we're doing is using audio, so only initialize audio... */ + SDL_Init(SDL_INIT_AUDIO); + + /* Set up our desired audio context. */ + spec.freq = FRQ_44KHZ; + spec.format = AUDIO_S16SYS; + spec.channels = 1; + spec.samples = 2048; + spec.callback = audio_callback; + spec.userdata = NULL; + + /* Open and unpause audio. It'd probably be a good idea to check for any + problems while opening the audio (or that the real spec is equal to the + desired one), but we're just doing the bare minimum here... */ + SDL_OpenAudio(&spec, &rspec); + SDL_PauseAudio(0); + + /* Let the sound run for a bit... */ + SDL_Delay(10 * 1000); + + /* We're done, so mute the audio and clean it up. */ + SDL_PauseAudio(1); + SDL_CloseAudio(); + + return 0; +} hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-01-08 23:30:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via a0b9d7798f1612c9c49f6bd46878bebcbbb09473 (commit) from 16795b44de169912d24496b4073cae5d62619899 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a0b9d7798f1612c9c49f6bd46878bebcbbb09473 Author: Lawrence Sebald <ljs...@us...> Date: Fri Jan 8 18:30:27 2016 -0500 Use <arch/byteorder.h> for ntohs/ntohl/htons/htonl. ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 2 ++ kernel/libc/koslib/byteorder.c | 20 ++++++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 1888465..96c9a05 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -77,6 +77,8 @@ KallistiOS version 2.1.0 ----------------------------------------------- use that or fake it for filesystems that don't support fstat [LS] - DC Added fstat support to fs_iso9660 and fs_vmu [LS] - *** Added fstat support to fs_ext2, fs_ramdisk, fs_romdisk, and fs_pty [LS] +- *** Changed libc/koslib/byteorder.c functions to use the <arch/byteorder.h> + macros, instead of being hard-coded as little-endian [LS] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Dan Potter == DP] diff --git a/kernel/libc/koslib/byteorder.c b/kernel/libc/koslib/byteorder.c index d74c786..8bfa550 100644 --- a/kernel/libc/koslib/byteorder.c +++ b/kernel/libc/koslib/byteorder.c @@ -1,35 +1,31 @@ /* KallistiOS ##version## byteorder.c - (c)2001 Dan Potter + Copyright (C) 2001 Dan Potter + Copyright (C) 2016 Lawrence Sebald */ /* Byte-order translation functions */ -#include <inttypes.h> - -/* XXX needs to be in arch */ +#include <stdint.h> +#include <arch/byteorder.h> /* Network to Host short */ uint16_t ntohs(uint16_t value) { - return ((value >> 8) & 0xff) - | ((value << 8) & 0xff00); + return arch_ntohs(value); } /* Network to Host long */ uint32_t ntohl(uint32_t value) { - return ((value >> 24) & 0xff) - | (((value >> 16) & 0xff) << 8) - | (((value >> 8) & 0xff) << 16) - | (((value >> 0) & 0xff) << 24); + return arch_ntohl(value); } /* Host to Network short */ uint32_t htons(uint32_t value) { - return ntohs(value); + return arch_htons(value); } /* Host to Network long */ uint32_t htonl(uint32_t value) { - return ntohl(value); + return arch_htonl(value); } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-01-08 21:19:38
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 16795b44de169912d24496b4073cae5d62619899 (commit) via 0323c5eb593a58faef76758ccb42e9d94ebb9149 (commit) from 52231737f1005f265b66995bd2a3b0295c709c99 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 16795b44de169912d24496b4073cae5d62619899 Author: Lawrence Sebald <ljs...@us...> Date: Fri Jan 8 16:19:01 2016 -0500 Add fstat support to fs_pty, fs_ramdisk, and fs_romdisk. Also, make sure the stat structure is not a NULL pointer in fs_fstat(). commit 0323c5eb593a58faef76758ccb42e9d94ebb9149 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 4 21:30:55 2016 -0500 Update CHANGELOG. ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 4 ++++ kernel/fs/fs.c | 7 ++++++- kernel/fs/fs_pty.c | 29 +++++++++++++++++++++++++++-- kernel/fs/fs_ramdisk.c | 47 +++++++++++++++++++++++++++++++++++++++++++---- kernel/fs/fs_romdisk.c | 33 +++++++++++++++++++++++++++++++-- 5 files changed, 111 insertions(+), 9 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 8aa4227..1888465 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -73,6 +73,10 @@ KallistiOS version 2.1.0 ----------------------------------------------- - DC Added support for Spanish keyboards [Xavier Vallejo == XV] - DC Added rudimentary support for OCRAM in linker script [CG] - *** Added the C11 aligned_alloc() function [LS] +- *** Added fs_fstat and modified the fstat function in the newlib handlers to + use that or fake it for filesystems that don't support fstat [LS] +- DC Added fstat support to fs_iso9660 and fs_vmu [LS] +- *** Added fstat support to fs_ext2, fs_ramdisk, fs_romdisk, and fs_pty [LS] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Dan Potter == DP] diff --git a/kernel/fs/fs.c b/kernel/fs/fs.c index 7175ce5..02683ea 100644 --- a/kernel/fs/fs.c +++ b/kernel/fs/fs.c @@ -2,7 +2,7 @@ fs.c Copyright (C) 2000, 2001, 2002, 2003 Dan Potter - Copyright (C) 2012, 2013, 2014 Lawrence Sebald + Copyright (C) 2012, 2013, 2014, 2015, 2016 Lawrence Sebald */ @@ -879,6 +879,11 @@ int fs_fstat(file_t fd, struct stat *st) { return -1; } + if(!st) { + errno = EFAULT; + return -1; + } + if(h->handler == NULL) { h->hnd = (void *)0; return 0; diff --git a/kernel/fs/fs_pty.c b/kernel/fs/fs_pty.c index 7a2450d..89eb459 100644 --- a/kernel/fs/fs_pty.c +++ b/kernel/fs/fs_pty.c @@ -2,7 +2,7 @@ fs_pty.c Copyright (C) 2003 Dan Potter - Copyright (C) 2012, 2014 Lawrence Sebald + Copyright (C) 2012, 2014, 2016 Lawrence Sebald */ @@ -693,6 +693,31 @@ static int pty_fcntl(void *h, int cmd, va_list ap) { return rv; } +static int pty_fstat(void *h, struct stat *st) { + pipefd_t *fd = (pipefd_t *)h; + + if(!fd) { + errno = EBADF; + return -1; + } + + memset(st, 0, sizeof(struct stat)); + + st->st_dev = (dev_t)('p' | ('t' << 8) | ('y' << 16)); + + if(fd->mode & O_DIR) { + st->st_mode = S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO; + } + else { + st->st_mode = S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | + S_IROTH | S_IWOTH; + st->st_size = (off_t)fd->d.p->cnt; + st->st_blksize = 1; + } + + return 0; +} + static vfs_handler_t vh = { /* Name Handler */ { @@ -731,7 +756,7 @@ static vfs_handler_t vh = { NULL, NULL, pty_rewinddir, - NULL + pty_fstat }; /* Are we initialized? */ diff --git a/kernel/fs/fs_ramdisk.c b/kernel/fs/fs_ramdisk.c index 54040b0..0d5d891 100644 --- a/kernel/fs/fs_ramdisk.c +++ b/kernel/fs/fs_ramdisk.c @@ -2,7 +2,7 @@ fs_ramdisk.c Copyright (C) 2002, 2003 Dan Potter - Copyright (C) 2012, 2013, 2014 Lawrence Sebald + Copyright (C) 2012, 2013, 2014, 2016 Lawrence Sebald */ @@ -609,6 +609,7 @@ static int ramdisk_stat(vfs_handler_t *vfs, const char *path, struct stat *buf, rd_file_t *f; int rv = -1; + (void)vfs; (void)flag; mutex_lock(&rd_mutex); @@ -618,8 +619,9 @@ static int ramdisk_stat(vfs_handler_t *vfs, const char *path, struct stat *buf, if(f) { memset(buf, 0, sizeof(struct stat)); - buf->st_dev = (dev_t)((ptr_t)vfs); - buf->st_mode = S_IRUSR | S_IWUSR; + buf->st_dev = (dev_t)('r' | ('a' << 8) | ('m' << 16)); + buf->st_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | + S_IWOTH; if(f->type == STAT_TYPE_DIR) buf->st_mode |= S_IFDIR; @@ -696,6 +698,43 @@ static int ramdisk_rewinddir(void * h) { return rv; } +static int ramdisk_fstat(void *h, struct stat *buf) { + file_t fd = (file_t)h; + rd_file_t *f; + + mutex_lock(&rd_mutex); + + if(fd >= MAX_RAM_FILES || !fh[fd].file) { + mutex_unlock(&rd_mutex); + errno = EBADF; + return -1; + } + + /* Grab the file itself... */ + f = fh[fd].file; + + /* Fill in the structure. */ + memset(buf, 0, sizeof(struct stat)); + buf->st_dev = (dev_t)('r' | ('a' << 8) | ('m' << 16)); + buf->st_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; + + if(f->type == STAT_TYPE_DIR) + buf->st_mode |= S_IFDIR; + else + buf->st_mode |= S_IFREG; + + buf->st_nlink = 1; + buf->st_size = f->datasize; + buf->st_blksize = 1024; + buf->st_blocks = f->datasize >> 10; + + if(f->datasize & 0x3ff) + ++buf->st_blocks; + + mutex_unlock(&rd_mutex); + return 0; +} + /* Put everything together */ static vfs_handler_t vh = { /* Name handler */ @@ -735,7 +774,7 @@ static vfs_handler_t vh = { NULL, /* total64 XXX */ NULL, /* readlink XXX */ ramdisk_rewinddir, - NULL /* fstat */ + ramdisk_fstat }; /* Attach a piece of memory to a file. This works somewhat like open for diff --git a/kernel/fs/fs_romdisk.c b/kernel/fs/fs_romdisk.c index 5e2af10..023f7f5 100644 --- a/kernel/fs/fs_romdisk.c +++ b/kernel/fs/fs_romdisk.c @@ -2,7 +2,7 @@ fs_romdisk.c Copyright (C) 2001, 2002, 2003 Dan Potter - Copyright (C) 2012, 2013, 2014 Lawrence Sebald + Copyright (C) 2012, 2013, 2014, 2016 Lawrence Sebald */ @@ -449,6 +449,35 @@ static int romdisk_rewinddir(void *h) { return 0; } +static int romdisk_fstat(void *h, struct stat *st) { + file_t fd = (file_t)h; + + if(fd >= MAX_RD_FILES || !fh[fd].index) { + errno = EBADF; + return -1; + } + + memset(st, 0, sizeof(struct stat)); + + if(fh[fd].dir) + st->st_mode = S_IFDIR | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | + S_IROTH | S_IXOTH; + else + st->st_mode = S_IFREG | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | + S_IROTH | S_IXOTH; + + st->st_dev = (dev_t)((ptr_t)fh[fd].mnt); + st->st_size = fh[fd].size; + st->st_nlink = 1; + st->st_blksize = 1024; + st->st_blocks = fh[fd].size >> 10; + + if(fh[fd].size & 0x3ff) + ++st->st_blocks; + + return 0; +} + /* This is a template that will be used for each mount */ static vfs_handler_t vh = { /* Name Handler */ @@ -488,7 +517,7 @@ static vfs_handler_t vh = { NULL, /* total64 */ NULL, /* readlink */ romdisk_rewinddir, - NULL /* fstat */ + romdisk_fstat }; /* Are we initialized? */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-01-05 02:24:26
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 52231737f1005f265b66995bd2a3b0295c709c99 (commit) via c221fe303a140cb0de2934a8e199477f7b23f532 (commit) via aa86519c66bacfc90add72c9fb7b780511b06bd4 (commit) via 5f67c7724e645d6a2f399acc739e710b32ef6ac5 (commit) from d5c4a2de57fbdb9707326822144debe4593d274a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 52231737f1005f265b66995bd2a3b0295c709c99 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 4 21:23:58 2016 -0500 A bit better of a fake fstat, for the filesystems that don't support it. Basically, we do the same thing we do for the fake stat here. commit c221fe303a140cb0de2934a8e199477f7b23f532 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 4 20:59:32 2016 -0500 Add fstat() support to fs_iso9660. commit aa86519c66bacfc90add72c9fb7b780511b06bd4 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 4 20:30:12 2016 -0500 Add fstat() support to fs_vmu. commit 5f67c7724e645d6a2f399acc739e710b32ef6ac5 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 4 20:16:50 2016 -0500 Add fstat() support to fs_ext2. ----------------------------------------------------------------------- Summary of changes: addons/libkosext2fs/fs_ext2.c | 84 ++++++++++++++++++++++++++++++++- kernel/arch/dreamcast/fs/fs_iso9660.c | 34 ++++++++++++- kernel/arch/dreamcast/fs/fs_vmu.c | 40 ++++++++++++++- kernel/libc/newlib/newlib_fstat.c | 30 +++++++++++- 4 files changed, 178 insertions(+), 10 deletions(-) diff --git a/addons/libkosext2fs/fs_ext2.c b/addons/libkosext2fs/fs_ext2.c index 23fb4c3..478ab00 100644 --- a/addons/libkosext2fs/fs_ext2.c +++ b/addons/libkosext2fs/fs_ext2.c @@ -1,7 +1,7 @@ /* KallistiOS ##version## fs_ext2.c - Copyright (C) 2012, 2013, 2014 Lawrence Sebald + Copyright (C) 2012, 2013, 2014, 2016 Lawrence Sebald */ #include <time.h> @@ -1783,6 +1783,86 @@ static int fs_ext2_rewinddir(void *h) { return 0; } +static int fs_ext2_fstat(void *h, struct stat *buf) { + fs_ext2_fs_t *fs; + ext2_inode_t *inode; + uint64_t sz; + file_t fd = ((file_t)h) - 1; + int irv = 0; + + mutex_lock(&ext2_mutex); + + if(fd >= MAX_EXT2_FILES || !fh[fd].inode_num) { + mutex_unlock(&ext2_mutex); + errno = EBADF; + return -1; + } + + /* Find the object in question */ + inode = fh[fd].inode; + fs = fh[fd].fs; + + /* Fill in the structure */ + memset(buf, 0, sizeof(struct stat)); + buf->st_dev = (dev_t)((ptr_t)fs->vfsh); + buf->st_ino = fh[fd].inode_num; + buf->st_mode = inode->i_mode & 0x0FFF; + buf->st_nlink = inode->i_links_count; + buf->st_uid = inode->i_uid; + buf->st_gid = inode->i_gid; + + buf->st_atime = inode->i_atime; + buf->st_mtime = inode->i_mtime; + buf->st_ctime = inode->i_ctime; + buf->st_blksize = 512; + buf->st_blocks = inode->i_blocks; + + /* The rest depends on what type of inode this is... */ + switch(inode->i_mode & 0xF000) { + case EXT2_S_IFLNK: + buf->st_mode |= S_IFLNK; + buf->st_size = inode->i_size; + break; + + case EXT2_S_IFREG: + buf->st_mode |= S_IFREG; + sz = ext2_inode_size(inode); + + if(sz > LONG_MAX) { + errno = EOVERFLOW; + irv = -1; + } + + buf->st_size = sz; + break; + + case EXT2_S_IFDIR: + buf->st_mode |= S_IFDIR; + buf->st_size = inode->i_size; + break; + + case EXT2_S_IFSOCK: + buf->st_mode |= S_IFSOCK; + break; + + case EXT2_S_IFIFO: + buf->st_mode |= S_IFIFO; + break; + + case EXT2_S_IFBLK: + buf->st_mode |= S_IFBLK; + break; + + case EXT2_S_IFCHR: + buf->st_mode |= S_IFCHR; + break; + } + + mutex_unlock(&ext2_mutex); + + return irv; +} + /* This is a template that will be used for each mount */ static vfs_handler_t vh = { /* Name Handler */ @@ -1822,7 +1902,7 @@ static vfs_handler_t vh = { fs_ext2_total64, /* total64 */ fs_ext2_readlink, /* readlink */ fs_ext2_rewinddir, /* rewinddir */ - NULL /* fstat */ + fs_ext2_fstat /* fstat */ }; static int initted = 0; diff --git a/kernel/arch/dreamcast/fs/fs_iso9660.c b/kernel/arch/dreamcast/fs/fs_iso9660.c index 2318867..9f2693b 100644 --- a/kernel/arch/dreamcast/fs/fs_iso9660.c +++ b/kernel/arch/dreamcast/fs/fs_iso9660.c @@ -4,7 +4,7 @@ Copyright (C) 2000, 2001, 2003 Dan Potter Copyright (C) 2001 Andrew Kieschnick Copyright (C) 2002 Bero - Copyright (C) 2012, 2013, 2014 Lawrence Sebald + Copyright (C) 2012, 2013, 2014, 2016 Lawrence Sebald */ @@ -990,6 +990,36 @@ static int iso_fcntl(void *h, int cmd, va_list ap) { return rv; } +static int iso_fstat(void *h, struct stat *st) { + file_t fd = (file_t)h; + + if(fd >= MAX_ISO_FILES || !fh[fd].first_extent || fh[fd].broken) { + errno = EBADF; + return -1; + } + + memset(st, 0, sizeof(struct stat)); + + if(fh[fd].dir) { + st->st_size = 0; + st->st_dev = 'c' | ('d' << 8); + st->st_mode = S_IFDIR | S_IRUSR | S_IRGRP | S_IROTH | S_IXUSR | + S_IXGRP | S_IXOTH; + st->st_nlink = 1; + st->st_blksize = 512; + } + else { + st->st_size = fh[fd].size; + st->st_dev = 'c' | ('d' << 8); + st->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH | S_IXUSR | + S_IXGRP | S_IXOTH; + st->st_nlink = 1; + st->st_blksize = 512; + } + + return 0; +} + /* Put everything together */ static vfs_handler_t vh = { /* Name handler */ @@ -1029,7 +1059,7 @@ static vfs_handler_t vh = { NULL, /* total64 */ NULL, /* readlink */ iso_rewinddir, - NULL /* fstat */ + iso_fstat }; /* Initialize the file system */ diff --git a/kernel/arch/dreamcast/fs/fs_vmu.c b/kernel/arch/dreamcast/fs/fs_vmu.c index c08350c..c962dc6 100644 --- a/kernel/arch/dreamcast/fs/fs_vmu.c +++ b/kernel/arch/dreamcast/fs/fs_vmu.c @@ -2,7 +2,7 @@ fs_vmu.c Copyright (C) 2003 Dan Potter - Copyright (C) 2012, 2013, 2014 Lawrence Sebald + Copyright (C) 2012, 2013, 2014, 2016 Lawrence Sebald */ @@ -567,6 +567,7 @@ static int vmu_stat(vfs_handler_t *vfs, const char *fn, struct stat *rv, maple_device_t * dev; size_t len = strlen(fn); + (void)vfs; (void)flag; /* The only thing we can stat right now is full VMUs, and what that @@ -588,7 +589,7 @@ static int vmu_stat(vfs_handler_t *vfs, const char *fn, struct stat *rv, /* Get the number of free blocks */ memset(rv, 0, sizeof(struct stat)); rv->st_size = vmufs_free_blocks(dev); - rv->st_dev = (dev_t)((ptr_t)vfs); + rv->st_dev = (dev_t)((ptr_t)dev); rv->st_mode = S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO; rv->st_nlink = 1; rv->st_blksize = 512; @@ -652,6 +653,39 @@ static int vmu_rewinddir(void * fd) { return 0; } +static int vmu_fstat(void *fd, struct stat *st) { + vmu_fh_t *fh; + vmu_dh_t *dh; + + /* Check the handle */ + if(!vmu_verify_hnd(fd, VMU_ANY)) { + errno = EBADF; + return -1; + } + + fh = (vmu_fh_t *)fd; + memset(st, 0, sizeof(struct stat)); + + if(fh->strtype == VMU_DIR) { + dh = (vmu_dh_t *)fh; + + st->st_size = vmufs_free_blocks(dh->dev); + st->st_dev = (dev_t)((ptr_t)dh->dev); + st->st_mode = S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO; + st->st_nlink = 1; + st->st_blksize = 512; + } + else { + st->st_dev = (dev_t)((ptr_t)fh->dev); + st->st_mode = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO; + st->st_nlink = 1; + st->st_blksize = 512; + st->st_size = fh->filesize * 512; + } + + return 0; +} + /* handler interface */ static vfs_handler_t vh = { /* Name handler */ @@ -690,7 +724,7 @@ static vfs_handler_t vh = { NULL, /* total64 */ NULL, /* readlink */ vmu_rewinddir, - NULL /* fstat */ + vmu_fstat }; int fs_vmu_init() { diff --git a/kernel/libc/newlib/newlib_fstat.c b/kernel/libc/newlib/newlib_fstat.c index 3017011..c58fd5b 100644 --- a/kernel/libc/newlib/newlib_fstat.c +++ b/kernel/libc/newlib/newlib_fstat.c @@ -15,6 +15,7 @@ int _fstat_r(struct _reent *reent, int fd, struct stat *pstat) { int err = errno, rv; + size_t sz; (void)reent; @@ -22,11 +23,34 @@ int _fstat_r(struct _reent *reent, int fd, struct stat *pstat) { if(!(rv = fs_fstat(fd, pstat)) || errno != ENOSYS) return rv; - /* If this filesystem doesn't implement fstat, do what we always used to do - in the past (which isn't very useful)... */ - errno = err; + /* Set up our fallback behavior, which is to do what we've always done. */ memset(pstat, 0, sizeof(struct stat)); pstat->st_mode = S_IFCHR; + /* Can we get some information out of total/fcntl? */ + if((sz = fs_total(fd)) == (size_t)-1) { + errno = err; + return 0; + } + + if((rv = fs_fcntl(fd, F_GETFL)) == -1) { + errno = err; + return 0; + } + + /* fs_fcntl and fs_total succeeded here, so let's look at what we have and + try to do something useful with it. */ + pstat->st_size = sz; + pstat->st_dev = (dev_t)0xBADC0DE; + + if(rv & O_DIR) + pstat->st_mode = S_IFDIR | S_IRUSR | S_IRGRP | S_IROTH | S_IXUSR | + S_IXGRP | S_IXOTH; + else + pstat->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH; + + if(rv & O_WRONLY) + pstat->st_mode |= S_IWUSR | S_IWGRP | S_IWOTH; + return 0; } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-01-05 01:04:03
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via d5c4a2de57fbdb9707326822144debe4593d274a (commit) from 4fafabbed82481771967c8439d2220c0a67793df (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d5c4a2de57fbdb9707326822144debe4593d274a Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 4 20:02:59 2016 -0500 Initial work on adding fs_fstat() and making fstat() do something useful. No filesystems that really do anything useful with fstat() currently work, but at least this is a start. ----------------------------------------------------------------------- Summary of changes: addons/libkosext2fs/fs_ext2.c | 3 ++- include/kos/fs.h | 20 +++++++++++++++++++- kernel/arch/dreamcast/fs/fs_dcload.c | 3 ++- kernel/arch/dreamcast/fs/fs_dclsocket.c | 3 ++- kernel/arch/dreamcast/fs/fs_iso9660.c | 3 ++- kernel/arch/dreamcast/fs/fs_vmu.c | 3 ++- kernel/fs/fs.c | 21 +++++++++++++++++++++ kernel/fs/fs_pty.c | 3 ++- kernel/fs/fs_ramdisk.c | 3 ++- kernel/fs/fs_romdisk.c | 3 ++- kernel/fs/fs_socket.c | 14 ++++++++++++-- kernel/libc/newlib/newlib_fstat.c | 22 +++++++++++++++++++--- 12 files changed, 87 insertions(+), 14 deletions(-) diff --git a/addons/libkosext2fs/fs_ext2.c b/addons/libkosext2fs/fs_ext2.c index 30733a5..23fb4c3 100644 --- a/addons/libkosext2fs/fs_ext2.c +++ b/addons/libkosext2fs/fs_ext2.c @@ -1821,7 +1821,8 @@ static vfs_handler_t vh = { fs_ext2_tell64, /* tell64 */ fs_ext2_total64, /* total64 */ fs_ext2_readlink, /* readlink */ - fs_ext2_rewinddir /* rewinddir */ + fs_ext2_rewinddir, /* rewinddir */ + NULL /* fstat */ }; static int initted = 0; diff --git a/include/kos/fs.h b/include/kos/fs.h index ea9dacf..e617472 100644 --- a/include/kos/fs.h +++ b/include/kos/fs.h @@ -2,7 +2,7 @@ kos/fs.h Copyright (C) 2000, 2001, 2002, 2003 Dan Potter - Copyright (C) 2012, 2013, 2014 Lawrence Sebald + Copyright (C) 2012, 2013, 2014, 2016 Lawrence Sebald */ @@ -193,6 +193,9 @@ typedef struct vfs_handler { /** \brief Rewind a directory stream to the start */ int (*rewinddir)(void *hnd); + + /** \brief Get status information on an already opened file. */ + int (*fstat)(void *hnd, struct stat *st); } vfs_handler_t; /** \brief The number of distinct file descriptors that can be in use at a @@ -560,6 +563,21 @@ int fs_stat(const char *path, struct stat *buf, int flag); */ int fs_rewinddir(file_t hnd); +/** \brief Retrieve information about an opened file. + + This function retrieves status information on the given file descriptor, + which must correspond to an already opened file. + + \param hnd The file descriptor to retrieve information about. + \param buf The buffer to store stat information in. + \return 0 on success, -1 on failure. + + \note Some filesystems may not support this function. If a + filesystem doesn't support it, errno will be set to + ENOSYS and -1 will be returned. +*/ +int fs_fstat(file_t hnd, struct stat *buf); + /** \brief Duplicate a file descriptor. This function duplicates the specified file descriptor, returning a new file diff --git a/kernel/arch/dreamcast/fs/fs_dcload.c b/kernel/arch/dreamcast/fs/fs_dcload.c index 48cc20a..d0f9dce 100644 --- a/kernel/arch/dreamcast/fs/fs_dcload.c +++ b/kernel/arch/dreamcast/fs/fs_dcload.c @@ -461,7 +461,8 @@ static vfs_handler_t vh = { NULL, /* tell64 */ NULL, /* total64 */ NULL, /* readlink */ - NULL /* rewinddir */ + NULL, /* rewinddir */ + NULL /* fstat */ }; // We have to provide a minimal interface in case dcload usage is diff --git a/kernel/arch/dreamcast/fs/fs_dclsocket.c b/kernel/arch/dreamcast/fs/fs_dclsocket.c index 5f428f8..64623ef 100644 --- a/kernel/arch/dreamcast/fs/fs_dclsocket.c +++ b/kernel/arch/dreamcast/fs/fs_dclsocket.c @@ -728,7 +728,8 @@ static vfs_handler_t vh = { NULL, /* tell64 */ NULL, /* total64 */ NULL, /* readlink */ - NULL /* rewinddir */ + NULL, /* rewinddir */ + NULL /* fstat */ }; /* dbgio handler */ diff --git a/kernel/arch/dreamcast/fs/fs_iso9660.c b/kernel/arch/dreamcast/fs/fs_iso9660.c index b8f1de6..2318867 100644 --- a/kernel/arch/dreamcast/fs/fs_iso9660.c +++ b/kernel/arch/dreamcast/fs/fs_iso9660.c @@ -1028,7 +1028,8 @@ static vfs_handler_t vh = { NULL, /* tell64 */ NULL, /* total64 */ NULL, /* readlink */ - iso_rewinddir + iso_rewinddir, + NULL /* fstat */ }; /* Initialize the file system */ diff --git a/kernel/arch/dreamcast/fs/fs_vmu.c b/kernel/arch/dreamcast/fs/fs_vmu.c index e49ca9d..c08350c 100644 --- a/kernel/arch/dreamcast/fs/fs_vmu.c +++ b/kernel/arch/dreamcast/fs/fs_vmu.c @@ -689,7 +689,8 @@ static vfs_handler_t vh = { NULL, /* tell64 */ NULL, /* total64 */ NULL, /* readlink */ - vmu_rewinddir + vmu_rewinddir, + NULL /* fstat */ }; int fs_vmu_init() { diff --git a/kernel/fs/fs.c b/kernel/fs/fs.c index caa3886..7175ce5 100644 --- a/kernel/fs/fs.c +++ b/kernel/fs/fs.c @@ -871,6 +871,27 @@ int fs_rewinddir(file_t fd) { return h->handler->rewinddir(h->hnd); } +int fs_fstat(file_t fd, struct stat *st) { + fs_hnd_t *h = fs_map_hnd(fd); + + if(!h) { + errno = EBADF; + return -1; + } + + if(h->handler == NULL) { + h->hnd = (void *)0; + return 0; + } + + if(h->handler->fstat == NULL) { + errno = ENOSYS; + return -1; + } + + return h->handler->fstat(h->hnd, st); +} + /* Initialize FS structures */ int fs_init() { return 0; diff --git a/kernel/fs/fs_pty.c b/kernel/fs/fs_pty.c index 8239d41..7a2450d 100644 --- a/kernel/fs/fs_pty.c +++ b/kernel/fs/fs_pty.c @@ -730,7 +730,8 @@ static vfs_handler_t vh = { NULL, NULL, NULL, - pty_rewinddir + pty_rewinddir, + NULL }; /* Are we initialized? */ diff --git a/kernel/fs/fs_ramdisk.c b/kernel/fs/fs_ramdisk.c index af67bfc..54040b0 100644 --- a/kernel/fs/fs_ramdisk.c +++ b/kernel/fs/fs_ramdisk.c @@ -734,7 +734,8 @@ static vfs_handler_t vh = { NULL, /* tell64 XXX */ NULL, /* total64 XXX */ NULL, /* readlink XXX */ - ramdisk_rewinddir + ramdisk_rewinddir, + NULL /* fstat */ }; /* Attach a piece of memory to a file. This works somewhat like open for diff --git a/kernel/fs/fs_romdisk.c b/kernel/fs/fs_romdisk.c index 5eeaed8..5e2af10 100644 --- a/kernel/fs/fs_romdisk.c +++ b/kernel/fs/fs_romdisk.c @@ -487,7 +487,8 @@ static vfs_handler_t vh = { NULL, /* tell64 */ NULL, /* total64 */ NULL, /* readlink */ - romdisk_rewinddir + romdisk_rewinddir, + NULL /* fstat */ }; /* Are we initialized? */ diff --git a/kernel/fs/fs_socket.c b/kernel/fs/fs_socket.c index 5cd254e..e35a8cc 100644 --- a/kernel/fs/fs_socket.c +++ b/kernel/fs/fs_socket.c @@ -1,7 +1,7 @@ /* KallistiOS ##version## fs_socket.c - Copyright (C) 2006, 2009, 2012, 2013 Lawrence Sebald + Copyright (C) 2006, 2009, 2012, 2013, 2016 Lawrence Sebald */ @@ -89,6 +89,15 @@ static short fs_socket_poll(void *hnd, short events) { return sock->protocol->poll(sock, events); } +static int fs_socket_fstat(void *hnd, struct stat *st) { + (void)hnd; + + /* Not very useful, but whatever... */ + memset(st, 0, sizeof(struct stat)); + st->st_mode = S_IFSOCK; + return 0; +} + /* VFS handler */ static vfs_handler_t vh = { /* Name handler */ @@ -127,7 +136,8 @@ static vfs_handler_t vh = { NULL, /* tell64 */ NULL, /* total64 */ NULL, /* readlink */ - NULL /* rewinddir */ + NULL, /* rewinddir */ + fs_socket_fstat /* fstat */ }; /* Have we been initialized? */ diff --git a/kernel/libc/newlib/newlib_fstat.c b/kernel/libc/newlib/newlib_fstat.c index 523216e..3017011 100644 --- a/kernel/libc/newlib/newlib_fstat.c +++ b/kernel/libc/newlib/newlib_fstat.c @@ -1,16 +1,32 @@ /* KallistiOS ##version## newlib_fstat.c - Copyright (C)2004 Dan Potter + Copyright (C) 2004 Dan Potter + Copyright (C) 2016 Lawrence Sebald */ +#include <errno.h> +#include <string.h> #include <unistd.h> #include <sys/stat.h> -int _fstat_r(struct _reent * reent, int fd, struct stat * pstat) { +#include <kos/fs.h> + +int _fstat_r(struct _reent *reent, int fd, struct stat *pstat) { + int err = errno, rv; + (void)reent; - (void)fd; + + /* Try to use the native stat function first... */ + if(!(rv = fs_fstat(fd, pstat)) || errno != ENOSYS) + return rv; + + /* If this filesystem doesn't implement fstat, do what we always used to do + in the past (which isn't very useful)... */ + errno = err; + memset(pstat, 0, sizeof(struct stat)); pstat->st_mode = S_IFCHR; + return 0; } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2016-01-04 03:25:15
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The KallistiOS port of OpenGL.". The branch, master has been updated via 0fa6e42b5575d3c10980bfebf8581d51523fef6e (commit) via 9fc75b677213215b47c112f415c4c7719097c5c4 (commit) from dd765f80d6657f9d42558019a9a721a98904dae0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0fa6e42b5575d3c10980bfebf8581d51523fef6e Author: Lawrence Sebald <ljs...@us...> Date: Sun Jan 3 22:24:52 2016 -0500 Remove +x permissions bits... commit 9fc75b677213215b47c112f415c4c7719097c5c4 Author: Lawrence Sebald <ljs...@us...> Date: Sun Jan 3 22:23:32 2016 -0500 Add glGetError() and gluErrorString(). ----------------------------------------------------------------------- Summary of changes: gl-error.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++- include/gl.h | 5 ++++- include/glu.h | 3 +++ 3 files changed, 53 insertions(+), 2 deletions(-) mode change 100755 => 100644 Makefile mode change 100755 => 100644 gl-api.c mode change 100755 => 100644 gl-api.h mode change 100755 => 100644 gl-arrays.c mode change 100755 => 100644 gl-arrays.h mode change 100755 => 100644 gl-cap.c mode change 100755 => 100644 gl-clip-arrays.c mode change 100755 => 100644 gl-clip.c mode change 100755 => 100644 gl-clip.h mode change 100755 => 100644 gl-error.c mode change 100755 => 100644 gl-fog.c mode change 100755 => 100644 gl-framebuffer.c mode change 100755 => 100644 gl-light.c mode change 100755 => 100644 gl-light.h mode change 100755 => 100644 gl-matrix.c mode change 100755 => 100644 gl-pvr.c mode change 100755 => 100644 gl-pvr.h mode change 100755 => 100644 gl-rgb.c mode change 100755 => 100644 gl-rgb.h mode change 100755 => 100644 gl-sh4-light.S mode change 100755 => 100644 gl-sh4.h mode change 100755 => 100644 gl-texture.c mode change 100755 => 100644 glu-texture.c mode change 100755 => 100644 include/gl.h mode change 100755 => 100644 include/glext.h mode change 100755 => 100644 include/glu.h mode change 100755 => 100644 include/glut.h mode change 100755 => 100644 kos/dreamcast.cnf diff --git a/Makefile b/Makefile old mode 100755 new mode 100644 diff --git a/gl-api.c b/gl-api.c old mode 100755 new mode 100644 diff --git a/gl-api.h b/gl-api.h old mode 100755 new mode 100644 diff --git a/gl-arrays.c b/gl-arrays.c old mode 100755 new mode 100644 diff --git a/gl-arrays.h b/gl-arrays.h old mode 100755 new mode 100644 diff --git a/gl-cap.c b/gl-cap.c old mode 100755 new mode 100644 diff --git a/gl-clip-arrays.c b/gl-clip-arrays.c old mode 100755 new mode 100644 diff --git a/gl-clip.c b/gl-clip.c old mode 100755 new mode 100644 diff --git a/gl-clip.h b/gl-clip.h old mode 100755 new mode 100644 diff --git a/gl-error.c b/gl-error.c old mode 100755 new mode 100644 index d047653..ba487ec --- a/gl-error.c +++ b/gl-error.c @@ -2,6 +2,7 @@ libgl/gl-error.c Copyright (C) 2014 Josh Pearson + Copyright (C) 2016 Lawrence Sebald KOS Open GL State Machine Error Code Implementation. */ @@ -17,12 +18,27 @@ #define KOS_GL_INVALID_VALUE (1<<3) static GLsizei KOS_GL_ERROR_CODE; +static GLenum gl_last_error = GL_NO_ERROR; static char KOS_GL_ERROR_FUNCTION[64] = { '\0' }; +/* Quoth the GL Spec: + When an error occurs, the error flag is set to the appropriate error code + value. No other errors are recorded until glGetError is called, the error + code is returned, and the flag is reset to GL_NO_ERROR. + + So, we only record an error here if the error code is currently unset. + Nothing in the spec requires recording multiple error flags, although it is + allowed by the spec. We take the easy way out for now. */ +static void set_err_flag(GLenum error) { + if(gl_last_error == GL_NO_ERROR) + gl_last_error = error; +} + void _glKosThrowError(GLenum error, char *function) { sprintf(KOS_GL_ERROR_FUNCTION, "%s\n", function); + set_err_flag(error); switch(error) { case GL_INVALID_ENUM: @@ -69,4 +85,33 @@ void _glKosPrintError() { printf("KOS GL ERROR: GL_INVALID_VALUE\n"); _glKosResetError(); -} \ No newline at end of file +} + +GLenum glGetError(void) { + GLenum rv = gl_last_error; + + gl_last_error = GL_NO_ERROR; + return rv; +} + +const GLubyte *gluErrorString(GLenum error) { + switch(error) { + case GL_NO_ERROR: + return (GLubyte *)"no error"; + + case GL_INVALID_ENUM: + return (GLubyte *)"invalid enumerant"; + + case GL_INVALID_OPERATION: + return (GLubyte *)"invalid operation"; + + case GL_INVALID_VALUE: + return (GLubyte *)"invalid value"; + + case GL_OUT_OF_MEMORY: + return (GLubyte *)"out of memory"; + + default: + return (GLubyte *)"unknown error"; + } +} diff --git a/gl-fog.c b/gl-fog.c old mode 100755 new mode 100644 diff --git a/gl-framebuffer.c b/gl-framebuffer.c old mode 100755 new mode 100644 diff --git a/gl-light.c b/gl-light.c old mode 100755 new mode 100644 diff --git a/gl-light.h b/gl-light.h old mode 100755 new mode 100644 diff --git a/gl-matrix.c b/gl-matrix.c old mode 100755 new mode 100644 diff --git a/gl-pvr.c b/gl-pvr.c old mode 100755 new mode 100644 diff --git a/gl-pvr.h b/gl-pvr.h old mode 100755 new mode 100644 diff --git a/gl-rgb.c b/gl-rgb.c old mode 100755 new mode 100644 diff --git a/gl-rgb.h b/gl-rgb.h old mode 100755 new mode 100644 diff --git a/gl-sh4-light.S b/gl-sh4-light.S old mode 100755 new mode 100644 diff --git a/gl-sh4.h b/gl-sh4.h old mode 100755 new mode 100644 diff --git a/gl-texture.c b/gl-texture.c old mode 100755 new mode 100644 diff --git a/glu-texture.c b/glu-texture.c old mode 100755 new mode 100644 diff --git a/include/gl.h b/include/gl.h old mode 100755 new mode 100644 index c57476e..9808254 --- a/include/gl.h +++ b/include/gl.h @@ -2,7 +2,7 @@ libgl/gl.h Copyright (C) 2013-2014 Josh "PH3NOM" Pearson - Copyright (C) 2014 Lawrence Sebald + Copyright (C) 2014, 2016 Lawrence Sebald Some functionality adapted from the original KOS libgl: Copyright (C) 2001 Dan Potter @@ -659,6 +659,9 @@ GLAPI void APIENTRY glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); GLAPI GLenum APIENTRY glCheckFramebufferStatus(GLenum target); +/* Error handling */ +GLAPI GLenum APIENTRY glGetError(void); + /* Non Operational Stubs for portability */ GLAPI void APIENTRY glAlphaFunc(GLenum func, GLclampf ref); GLAPI void APIENTRY glLineWidth(GLfloat width); diff --git a/include/glext.h b/include/glext.h old mode 100755 new mode 100644 diff --git a/include/glu.h b/include/glu.h old mode 100755 new mode 100644 index dcb89f2..6397441 --- a/include/glu.h +++ b/include/glu.h @@ -2,6 +2,7 @@ libgl/glu.h Copyright (C) 2013-2014 Josh "PH3NOM" Pearson + Copyright (C) 2016 Lawrence Sebald Some functionality adapted from the original KOS libgl: Copyright (C) 2001 Dan Potter @@ -42,6 +43,8 @@ GLAPI void APIENTRY glhLookAtf2(GLfloat *eyePosition3D, GLfloat *center3D, GLfloat *upVector3D); +GLAPI const GLubyte* APIENTRY gluErrorString(GLenum error); + __END_DECLS #endif /* !__GL_GLU_H */ diff --git a/include/glut.h b/include/glut.h old mode 100755 new mode 100644 diff --git a/kos/dreamcast.cnf b/kos/dreamcast.cnf old mode 100755 new mode 100644 hooks/post-receive -- The KallistiOS port of OpenGL. |
From: Lawrence S. <ljs...@us...> - 2015-12-24 03:47:35
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 4fafabbed82481771967c8439d2220c0a67793df (commit) from 3b548217d8a33be76d01c86621bc7b32da923930 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4fafabbed82481771967c8439d2220c0a67793df Author: Lawrence Sebald <ljs...@us...> Date: Wed Dec 23 22:47:16 2015 -0500 Add <arch/byteorder.h>. ----------------------------------------------------------------------- Summary of changes: include/kos.h | 1 + kernel/arch/dreamcast/include/arch/byteorder.h | 118 ++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 0 deletions(-) create mode 100644 kernel/arch/dreamcast/include/arch/byteorder.h diff --git a/include/kos.h b/include/kos.h index 4129df3..55c7b1c 100644 --- a/include/kos.h +++ b/include/kos.h @@ -64,6 +64,7 @@ __BEGIN_DECLS #include <arch/types.h> #include <arch/exec.h> #include <arch/stack.h> +#include <arch/byteorder.h> #ifdef _arch_dreamcast # include <arch/gdb.h> diff --git a/kernel/arch/dreamcast/include/arch/byteorder.h b/kernel/arch/dreamcast/include/arch/byteorder.h new file mode 100644 index 0000000..9b5ffea --- /dev/null +++ b/kernel/arch/dreamcast/include/arch/byteorder.h @@ -0,0 +1,118 @@ +/* KallistiOS ##version## + + arch/dreamcast/include/arch/byteorder.h + Copyright (C) 2015 Lawrence Sebald + +*/ + +/** \file arch/byteorder.h + \brief Byte-order related macros. + + This file contains architecture-specific byte-order related macros and/or + functions. Each platform should define six macros/functions in this file: + arch_swap16, arch_swap32, arch_ntohs, arch_ntohl, arch_htons, and + arch_htonl. The first two of these swap the byte order of 16-bit and 32-bit + integers, respectively. The other four macros will be used by the kernel to + implement the network-related byte order functions. + + \author Lawrence Sebald +*/ + +#ifndef __ARCH_BYTEORDER_H +#define __ARCH_BYTEORDER_H + +#include <sys/cdefs.h> +__BEGIN_DECLS + +#include <sys/_types.h> + +/** \brief Define the byte-order of the platform in use. */ +#define BYTE_ORDER LITTLE_ENDIAN + +/** \brief Swap the byte order of a 16-bit integer. + + This macro swaps the byte order of a 16-bit integer in an architecture- + defined manner. + + \param x The value to be byte-swapped. This should be a uint16, + or equivalent. + \return The swapped value. +*/ +#define arch_swap16(x) ({ \ + uint16 __x = (x); \ + __asm__ __volatile__("swap.b %0, %0" : "=r" (__x) : "0" (__x)); \ + __x; \ +}) + +/** \brief Swap the byte order of a 32-bit integer. + + This macro swaps the byte order of a 32-bit integer in an architecture- + defined manner. + + \param x The value to be byte-swapped. This should be a uint32, + or equivalent. + \return The swapped value. +*/ +#define arch_swap32(x) ({ \ + uint32 __x = (x); \ + __asm__ __volatile__("swap.b %0, %0\n\t" \ + "swap.w %0, %0\n\t" \ + "swap.b %0, %0\n\t" : "=r"(__x) : "0" (__x)); \ + __x; \ +}) + +/** \brief Convert network-to-host short. + + This macro converts a network byte order (big endian) value to the host's + native byte order. On a little endian system (like the Dreamcast), this + should just call arch_swap16(). On a big endian system, this should be a + no-op. + + \param x The value to be converted. This should be a uint16, + or equivalent. + \return The converted value. +*/ +#define arch_ntohs(x) arch_swap16(x) + +/** \brief Convert network-to-host long. + + This macro converts a network byte order (big endian) value to the host's + native byte order. On a little endian system (like the Dreamcast), this + should just call arch_swap32(). On a big endian system, this should be a + no-op. + + \param x The value to be converted. This should be a uint32, + or equivalent. + \return The converted value. +*/ +#define arch_ntohl(x) arch_swap32(x) + +/** \brief Convert host-to-network short. + + This macro converts a value in the host's native byte order to network byte + order (big endian). On a little endian system (like the Dreamcast), this + should just call arch_swap16(). On a big endian system, this should be a + no-op. + + \param x The value to be converted. This should be a uint16, + or equivalent. + \return The converted value. +*/ +#define arch_htons(x) arch_swap16(x) + +/** \brief Convert host-to-network long. + + This macro converts a value in the host's native byte order to network byte + order (big endian). On a little endian system (like the Dreamcast), this + should just call arch_swap32(). On a big endian system, this should be a + no-op. + + \param x The value to be converted. This should be a uint32, + or equivalent. + \return The converted value. +*/ +#define arch_htonl(x) arch_swap32(x) + +__END_DECLS + +#endif /* !__ARCH_BYTEORDER_H */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2015-11-09 01:10:38
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 3b548217d8a33be76d01c86621bc7b32da923930 (commit) from 439d9e1dca4fd85ed2179863bff02d61a1ca96ed (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3b548217d8a33be76d01c86621bc7b32da923930 Author: Lawrence Sebald <ljs...@us...> Date: Sun Nov 8 20:10:15 2015 -0500 Update the CHANGELOG for the last commit... ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 1427084..8aa4227 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -72,6 +72,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- - DC Added a very simple light gun example [LS] - DC Added support for Spanish keyboards [Xavier Vallejo == XV] - DC Added rudimentary support for OCRAM in linker script [CG] +- *** Added the C11 aligned_alloc() function [LS] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Dan Potter == DP] hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2015-11-09 01:07:57
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 439d9e1dca4fd85ed2179863bff02d61a1ca96ed (commit) via f8ac6895b37908c5bb43f3b69fc694bffa90e725 (commit) via 9d40f14ddae9f02eb016bc667043bfb3aa66ba22 (commit) from 47c0d9da02a26c74310b0d7d13dd5ee367d736cb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 439d9e1dca4fd85ed2179863bff02d61a1ca96ed Author: Lawrence Sebald <ljs...@us...> Date: Sun Nov 8 20:07:23 2015 -0500 Add C11 aligned_alloc() function and clean up malloc.h documentation. commit f8ac6895b37908c5bb43f3b69fc694bffa90e725 Merge: 9d40f14 47c0d9d Author: Lawrence Sebald <ljs...@us...> Date: Sun Nov 8 19:33:19 2015 -0500 Merge branch 'master' of ssh://git.code.sf.net/p/cadcdev/kallistios commit 9d40f14ddae9f02eb016bc667043bfb3aa66ba22 Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 12 17:28:17 2015 -0400 Fix formatting on AUTHORS file. ----------------------------------------------------------------------- Summary of changes: AUTHORS | 3 +- include/malloc.h | 182 +++++++++++++++++++++++++++------------ kernel/libc/c11/Makefile | 5 +- kernel/libc/c11/aligned_alloc.c | 18 ++++ 4 files changed, 149 insertions(+), 59 deletions(-) create mode 100644 kernel/libc/c11/aligned_alloc.c diff --git a/AUTHORS b/AUTHORS index 36ccd30..8f3b3a8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -22,8 +22,7 @@ please see the README.KOS file in the doc directory. Contributors list (under the normal KOS license): ------------------------------------------------- Dan Potter: 1997, 2000, 2001, 2002, 2003, 2004 -Lawrence Sebald: 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, - 2015 +Lawrence Sebald: 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Sam Steele: 2004 Gil Megidish: 2002 Florian Schulze: 2002 diff --git a/include/malloc.h b/include/malloc.h index 3e7f0bb..08e4503 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -1,7 +1,8 @@ /* KallistiOS ##version## malloc.h - Copyright (C)2003 Dan Potter + Copyright (C) 2003 Dan Potter + Copyright (C) 2015 Lawrence Sebald */ @@ -11,6 +12,7 @@ This implements standard C heap allocation, deallocation, and stats. \author Dan Potter + \author Lawrence Sebald */ #ifndef __MALLOC_H @@ -48,81 +50,144 @@ struct mallinfo { int keepcost; }; -/** \brief allocate memory +/** \brief Allocate a block of memory. - This allocates the specified size of bytes onto the heap. This memory is not - freed automatically if the returned pointer goes out of scope. Thus you must - call \ref free to reclaim the used space when finished. + This function allocates a block of memory of the specified number of bytes + on the heap. This memory must later be freed by way of the free() function. + The memory *is not* freed simply because a pointer to it goes out of scope. - \param size is the size in bytes to allocate - \return a pointer to the newly allocated address or NULL on errors. - \see free - \note the memory chunk is uninitialized - \note NULL may also be returned if size is 0 + \param size Number of bytes of memory to allocate. + \return A pointer to the newly allocated block of memory, or + NULL on failure. + + \see free + \see calloc + \note The block of memory returned is completely + uninitialized and may contain random data. */ -void * malloc(size_t size); +void *malloc(size_t size); + +/** \brief Allocate a block of memory and initialize it to 0. -/** \brief allocate memory on the heap and initialize it to 0 + This function allocates a block of memory of size * nmemb bytes, + initializing it to all zero bytes in the process. In other words, this + function allocates an array of nmemb elements that are each size bytes in + length. Just as with malloc(), you are responsible for calling free() on the + block of memory when you are done with it. - This allocates a chunk of memory of size * nmemb. In otherwords, an array - with nmemb elements of size or size[nmemb]. + \param nmemb Number of elements to allocate space for. + \param size Size of each element in the array. + \return A pointer to the newly allocated block of memory, or + NULL on failure. - \param nmemb is the amount of elements - \param size the size of each element - \return a pointer to the newly allocated address or NULL on errors. - \see free - \note the memory chunk is set to zero - \note NULL may be returned if nmemb or size is 0 + \see free + \see malloc */ -void * calloc(size_t nmemb, size_t size); +void *calloc(size_t nmemb, size_t size); + +/** \brief Release a previously allocated block of memory. -/** \brief releases memory that was previous allocated + This function frees memory that has been previously allocated by way of any + of the allocation functions in this file (malloc(), calloc(), memalign(), + valloc(), or aligned_alloc()), releasing the memory to be potentially used + for any future allocations. - frees the memory space that had previously been allocated by malloc or - calloc. + \param ptr A pointer to the block of memory to be freed. - \param ptr is a pointer to the address of allocated ram - \note no action is taken if NULL is passed - \note calling free on the same ptr more than once should not be expected to - behave in a reproducable maner as it is unpredictable. + \note Passing a NULL pointer to this function has no + effect. + \note Attempting to free the same block of memory twice + exhibits undefined behavior (i.e, it may crash, it + may do something else evil, etc). + \note Attempting to free a block of memory that was not + allocated by way of the normal allocation functions + exhibits undefined behavior. */ -void free(void * ptr); +void free(void *ptr); + +/** \brief Change the size of a previously allocated block of memory. + + This function changes the size of the previously allocated block of memory + from its current size to the specified size. This may involve reallocating + and copying the data from the original pointer to a new location in memory. + + If this function returns non-NULL, the old pointer is considered invalid and + should not be used (unless, of course, the returned pointer is the same as + the old pointer). No action is needed to clean up the old pointer, as this + function will have freed it if necessary. + + If this function returns NULL, the old pointer is still valid and has not + had its size changed. + + \param ptr A pointer to the block of memory to resize. It must + have been previously allocated by way of one of the + memory allocation functions in this file (or must + be NULL). + \param size The requested size of the new block of memory. + \return A pointer to the newly allocted/resized block of + memory on success, or NULL on failure. + + \note If ptr is NULL on a call to this function, the + function acts the same as malloc(size). + \note If ptr is non-NULL and size is zero, this function + *does not* free the block of memory -- it simply + returns a block that is of minimal size. By the + standard, this pointer must not be dereferenced. +*/ +void *realloc(void *ptr, size_t size); + +/** \brief Allocate a block of memory aligned to a specified block size. + + This function allocates a block of memory such that the lowest address in + the block is aligned to a multiple of alignment bytes. This is useful, for + instance, for things like DMA that require aligned blocks of memory to work. -/** \brief changes the size of previously allocated memory + Over-reliance on memalign will most certainly cause memory fragmentation, so + you should only use it when it is actually necessary. - The size of ptr is changed to size. If data has already been placed in the - memory area at that location, it's preserved up to size. If size is larger - then the previously allocated memory, the new area will be unititialized. + \param alignment The alignment requested for the block of memory. + This must be a power-of-two. + \param size The number of bytes of memory to allocate. + \return A pointer to the newly allocated block of memory on + success, or NULL on failure. - \param ptr the address pointer that's been previously returned by malloc/calloc - \param size the new size to give to the memory - \return a pointer to the new address - \note if ptr is NULL the call is basically a malloc(size) - \note if ptr is not NULL, and size is 0 the call is basically a free(ptr) + \note All memory allocation functions will have their + blocks aligned on 8-byte boundaries. There is no + reason to call this function if you need less than + 16-byte alignment. */ -void * realloc(void * ptr, size_t size); +void *memalign(size_t alignment, size_t size); -/** \brief allocate memory aligned memory +/** \brief Allocate a block of memory aligned to the system page size. - Memory of size is allocated with the address being a multiple of alignment + This function allocates a block of memory such that the lowest address in + the block is aligned to the system page size (typically 4096 bytes). It + basically ends up doing return memalign(PAGESIZE, size). - \param alignment a multiple of two that the memory address will be aligned to - \param size the size of the memory to allocate - \return a pointer to the newly allocated address (aligned to alignment) or - NULL on errors + \param size The number of bytes of memory to allocate. + \return A pointer to the newly allocated block of memory on + success, or NULL on failure. + + \see PAGESIZE + \see <arch/arch.h> */ -void * memalign(size_t alignment, size_t size); +void *valloc(size_t size); + +#if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ >= 201112L) -/** \brief allocates memory aligned to the system page size +/** \brief Allocate memory aligned to a specified block size. - Memory is allocated of size and is aligned to the system page size. - This ends up basically being: memolign(PAGESIZE, size) + This function is the standard-compliant C11 method for allocating aligned + blocks of memory. It works mostly the same as memalign(), although the + size must be a multiple of the alignment. - \param size the size of the memory to allocate - \return a pointer to the newly allocated memory address - \see arch/arch.h + \param alignment Required alignment of the memory block. + \param size Number of bytes of memory to allocate. + \return A pointer to the newly allocated memory block. */ -void * valloc(size_t size); +void *aligned_alloc(size_t alignment, size_t size); + +#endif /* !defined(__STRICT_ANSI__) || (__STDC_VERSION__ >= 201112L) */ /** \brief Sets tunable parameters for malloc related options. */ @@ -149,7 +214,15 @@ int mallopt(int, int); */ void malloc_stats(); -/** \brief KOS specfic calls +/** \brief Determine if it is safe to call malloc() in an IRQ context. + + This function checks the value of the internal spinlock that is used for + malloc() to ensure that a call to it will not freeze the running process. + This is only really useful in an IRQ context to ensure that a call to + malloc() (or some other memory allocation function) won't cause a deadlock. + + \retval 1 If it is safe to call malloc() in the current IRQ. + \retval 0 Otherwise. */ int malloc_irq_safe(); @@ -164,4 +237,3 @@ int mem_check_all(); __END_DECLS #endif /* __MALLOC_H */ - diff --git a/kernel/libc/c11/Makefile b/kernel/libc/c11/Makefile index 31327ef..df0b67f 100644 --- a/kernel/libc/c11/Makefile +++ b/kernel/libc/c11/Makefile @@ -1,7 +1,7 @@ # KallistiOS ##version## # # kernel/libc/c11/Makefile -# Copyright (C) 2014 Lawrence Sebald +# Copyright (C) 2014, 2015 Lawrence Sebald # KOS_CFLAGS += -std=c11 @@ -10,6 +10,7 @@ OBJS = call_once.o cnd_broadcast.o cnd_destroy.o cnd_init.o cnd_signal.o \ cnd_timedwait.o cnd_wait.o mtx_destroy.o mtx_init.o mtx_lock.o \ mtx_timedlock.o mtx_trylock.o mtx_unlock.o thrd_create.o thrd_current.o \ thrd_detach.o thrd_equal.o thrd_exit.o thrd_join.o thrd_sleep.o \ - thrd_yield.o tss_create.o tss_delete.o tss_get.o tss_set.o + thrd_yield.o tss_create.o tss_delete.o tss_get.o tss_set.o \ + aligned_alloc.o include $(KOS_BASE)/Makefile.prefab diff --git a/kernel/libc/c11/aligned_alloc.c b/kernel/libc/c11/aligned_alloc.c new file mode 100644 index 0000000..d5ae9a8 --- /dev/null +++ b/kernel/libc/c11/aligned_alloc.c @@ -0,0 +1,18 @@ +/* KallistiOS ##version## + + aligned_alloc.c + Copyright (C) 2015 Lawrence Sebald +*/ + +#include <malloc.h> + +/* Declare memalign, since it may not be available in strict standard-compliant + mode. */ +extern void *memalign(size_t alignment, size_t size); + +void *aligned_alloc(size_t alignment, size_t size) { + if(size % alignment) + return NULL; + + return memalign(alignment, size); +} hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: PH3NOM <ph...@us...> - 2015-09-09 18:45:31
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The KallistiOS port of OpenGL.". The branch, master has been updated via dd765f80d6657f9d42558019a9a721a98904dae0 (commit) from 3df4244bc24235629621e4c9281d135ed5e281d8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit dd765f80d6657f9d42558019a9a721a98904dae0 Author: Josh Pearson <ph...@us...> Date: Wed Sep 9 11:45:09 2015 -0700 Foramt cleanup on gl-rgb.c ----------------------------------------------------------------------- Summary of changes: gl-rgb.c | 78 +++++++++++++++++++++++++++++----------------------------- gl-rgb.h | 6 ++-- gl-texture.c | 4 +- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/gl-rgb.c b/gl-rgb.c index 500555a..e364a9d 100755 --- a/gl-rgb.c +++ b/gl-rgb.c @@ -119,41 +119,41 @@ uint16 __glKosAverageBiPixelARGB4444(uint16 p1, uint16 p2) { //===================================================================================================// //== Colorspace Conversion ==// -static uint16 _glConvPixelRGBAU32(uint8 r, uint8 g, uint8 b, uint8 a) { +static uint16 _glKosConvPixelRGBAU32(uint8 r, uint8 g, uint8 b, uint8 a) { return (uint16)((a & RGB4_MAX) << ARGB4444_ALPHA_SHIFT) | ((r & RGB4_MAX) << ARGB4444_RED_SHIFT) | ((g & RGB4_MAX) << ARGB4444_GREEN_SHIFT) | ((b & RGB4_MAX)); } -static uint16 _glConvPixelRGBU24(uint8 r, uint8 g, uint8 b) { +static uint16 _glKosConvPixelRGBU24(uint8 r, uint8 g, uint8 b) { return (uint16)((r & RGB5_MAX) << RGB565_RED_SHIFT) | ((g & RGB6_MAX) << RGB565_GREEN_SHIFT) | ((b & RGB5_MAX)); } -static void _glConvPixelsRGBF(int w, int h, float *src, uint16 *dst) { +static void _glKosConvPixelsRGBF(int w, int h, float *src, uint16 *dst) { int i; for(i = 0; i < w * h; i++) { - dst[i] = _glConvPixelRGBU24((uint8)(src[i * 3 + 0] * RGB5_MAX), - (uint8)(src[i * 3 + 1] * RGB6_MAX), - (uint8)(src[i * 3 + 2] * RGB5_MAX)); + dst[i] = _glKosConvPixelRGBU24((uint8)(src[i * 3 + 0] * RGB5_MAX), + (uint8)(src[i * 3 + 1] * RGB6_MAX), + (uint8)(src[i * 3 + 2] * RGB5_MAX)); } } -static void _glConvPixelsRGBAF(int w, int h, float *src, uint16 *dst) { +static void _glKosConvPixelsRGBAF(int w, int h, float *src, uint16 *dst) { int i; for(i = 0; i < w * h; i++) { - dst[i] = _glConvPixelRGBAU32((uint8)(src[i * 4 + 0] * RGB4_MAX), - (uint8)(src[i * 4 + 1] * RGB4_MAX), - (uint8)(src[i * 4 + 2] * RGB4_MAX), - (uint8)(src[i * 4 + 3] * RGB4_MAX)); + dst[i] = _glKosConvPixelRGBAU32((uint8)(src[i * 4 + 0] * RGB4_MAX), + (uint8)(src[i * 4 + 1] * RGB4_MAX), + (uint8)(src[i * 4 + 2] * RGB4_MAX), + (uint8)(src[i * 4 + 3] * RGB4_MAX)); } } -static void _glConvPixelsRGBU24(int w, int h, uint8 *src, uint16 *dst) { +static void _glKosConvPixelsRGBU24(int w, int h, uint8 *src, uint16 *dst) { unsigned char r, g, b; int i; @@ -162,11 +162,11 @@ static void _glConvPixelsRGBU24(int w, int h, uint8 *src, uint16 *dst) { g = (src[i * 3 + 1] * RGB6_MAX) / RGB8_MAX; b = (src[i * 3 + 2] * RGB5_MAX) / RGB8_MAX; - dst[i] = _glConvPixelRGBU24(r, g, b); + dst[i] = _glKosConvPixelRGBU24(r, g, b); } } -static void _glConvPixelsRGBAU32(int w, int h, uint8 *src, uint16 *dst) { +static void _glKosConvPixelsRGBAU32(int w, int h, uint8 *src, uint16 *dst) { unsigned char r, g, b, a; int i; @@ -176,11 +176,11 @@ static void _glConvPixelsRGBAU32(int w, int h, uint8 *src, uint16 *dst) { b = (src[i * 4 + 2] * RGB4_MAX) / RGB8_MAX; a = (src[i * 4 + 3] * RGB4_MAX) / RGB8_MAX; - dst[i] = _glConvPixelRGBAU32(r, g, b, a); + dst[i] = _glKosConvPixelRGBAU32(r, g, b, a); } } -static void _glConvPixelsRGBS24(int w, int h, int8 *src, uint16 *dst) { +static void _glKosConvPixelsRGBS24(int w, int h, int8 *src, uint16 *dst) { unsigned char r, g, b; int i; @@ -189,11 +189,11 @@ static void _glConvPixelsRGBS24(int w, int h, int8 *src, uint16 *dst) { g = ((src[i * 3 + 1] + S8_NEG_OFT) * RGB6_MAX) / RGB8_MAX; b = ((src[i * 3 + 2] + S8_NEG_OFT) * RGB5_MAX) / RGB8_MAX; - dst[i] = _glConvPixelRGBU24(r, g, b); + dst[i] = _glKosConvPixelRGBU24(r, g, b); } } -static void _glConvPixelsRGBAS32(int w, int h, int8 *src, uint16 *dst) { +static void _glKosConvPixelsRGBAS32(int w, int h, int8 *src, uint16 *dst) { unsigned char r, g, b, a; int i; @@ -203,11 +203,11 @@ static void _glConvPixelsRGBAS32(int w, int h, int8 *src, uint16 *dst) { b = ((src[i * 4 + 2] + S8_NEG_OFT) * RGB4_MAX) / RGB8_MAX; a = ((src[i * 4 + 3] + S8_NEG_OFT) * RGB4_MAX) / RGB8_MAX; - dst[i] = _glConvPixelRGBAU32(r, g, b, a); + dst[i] = _glKosConvPixelRGBAU32(r, g, b, a); } } -static void _glConvPixelsRGBS48(int w, int h, int16 *src, uint16 *dst) { +static void _glKosConvPixelsRGBS48(int w, int h, int16 *src, uint16 *dst) { unsigned char r, g, b; int i; @@ -216,11 +216,11 @@ static void _glConvPixelsRGBS48(int w, int h, int16 *src, uint16 *dst) { g = ((src[i * 3 + 1] + S16_NEG_OFT) * RGB6_MAX) / RGB16_MAX; b = ((src[i * 3 + 2] + S16_NEG_OFT) * RGB5_MAX) / RGB16_MAX; - dst[i] = _glConvPixelRGBU24(r, g, b); + dst[i] = _glKosConvPixelRGBU24(r, g, b); } } -static void _glConvPixelsRGBAS64(int w, int h, int16 *src, uint16 *dst) { +static void _glKosConvPixelsRGBAS64(int w, int h, int16 *src, uint16 *dst) { unsigned char r, g, b, a; int i; @@ -230,11 +230,11 @@ static void _glConvPixelsRGBAS64(int w, int h, int16 *src, uint16 *dst) { b = ((src[i * 4 + 2] + S16_NEG_OFT) * RGB4_MAX) / RGB16_MAX; a = ((src[i * 4 + 3] + S16_NEG_OFT) * RGB4_MAX) / RGB16_MAX; - dst[i] = _glConvPixelRGBAU32(r, g, b, a); + dst[i] = _glKosConvPixelRGBAU32(r, g, b, a); } } -static void _glConvPixelsRGBU48(int w, int h, uint16 *src, uint16 *dst) { +static void _glKosConvPixelsRGBU48(int w, int h, uint16 *src, uint16 *dst) { unsigned char r, g, b; int i; @@ -243,11 +243,11 @@ static void _glConvPixelsRGBU48(int w, int h, uint16 *src, uint16 *dst) { g = ((src[i * 3 + 1]) * RGB6_MAX) / RGB16_MAX; b = ((src[i * 3 + 2]) * RGB5_MAX) / RGB16_MAX; - dst[i] = _glConvPixelRGBU24(r, g, b); + dst[i] = _glKosConvPixelRGBU24(r, g, b); } } -static void _glConvPixelsRGBAU64(int w, int h, uint16 *src, uint16 *dst) { +static void _glKosConvPixelsRGBAU64(int w, int h, uint16 *src, uint16 *dst) { unsigned char r, g, b, a; int i; @@ -257,54 +257,54 @@ static void _glConvPixelsRGBAU64(int w, int h, uint16 *src, uint16 *dst) { b = (src[i * 4 + 2] * RGB4_MAX) / RGB16_MAX; a = (src[i * 4 + 3] * RGB4_MAX) / RGB16_MAX; - dst[i] = _glConvPixelRGBAU32(r, g, b, a); + dst[i] = _glKosConvPixelRGBAU32(r, g, b, a); } } -void _glPixelConvertRGB(int format, int w, int h, void *src, uint16 *dst) { +void _glKosPixelConvertRGB(int format, int w, int h, void *src, uint16 *dst) { switch(format) { case GL_BYTE: - _glConvPixelsRGBS24(w, h, (int8 *)src, dst); + _glKosConvPixelsRGBS24(w, h, (int8 *)src, dst); break; case GL_UNSIGNED_BYTE: - _glConvPixelsRGBU24(w, h, (uint8 *)src, dst); + _glKosConvPixelsRGBU24(w, h, (uint8 *)src, dst); break; case GL_SHORT: - _glConvPixelsRGBS48(w, h, (int16 *)src, dst); + _glKosConvPixelsRGBS48(w, h, (int16 *)src, dst); break; case GL_UNSIGNED_SHORT: - _glConvPixelsRGBU48(w, h, (uint16 *)src, dst); + _glKosConvPixelsRGBU48(w, h, (uint16 *)src, dst); break; case GL_FLOAT: - _glConvPixelsRGBF(w, h, (float *)src, dst); + _glKosConvPixelsRGBF(w, h, (float *)src, dst); break; } } -void _glPixelConvertRGBA(int format, int w, int h, void *src, uint16 *dst) { +void _glKosPixelConvertRGBA(int format, int w, int h, void *src, uint16 *dst) { switch(format) { case GL_BYTE: - _glConvPixelsRGBAS32(w, h, (int8 *)src, dst); + _glKosConvPixelsRGBAS32(w, h, (int8 *)src, dst); break; case GL_UNSIGNED_BYTE: - _glConvPixelsRGBAU32(w, h, (uint8 *)src, dst); + _glKosConvPixelsRGBAU32(w, h, (uint8 *)src, dst); break; case GL_SHORT: - _glConvPixelsRGBAS64(w, h, (int16 *)src, dst); + _glKosConvPixelsRGBAS64(w, h, (int16 *)src, dst); break; case GL_UNSIGNED_SHORT: - _glConvPixelsRGBAU64(w, h, (uint16 *)src, dst); + _glKosConvPixelsRGBAU64(w, h, (uint16 *)src, dst); break; case GL_FLOAT: - _glConvPixelsRGBAF(w, h, (float *)src, dst); + _glKosConvPixelsRGBAF(w, h, (float *)src, dst); break; } } diff --git a/gl-rgb.h b/gl-rgb.h index 3d4632e..847078a 100755 --- a/gl-rgb.h +++ b/gl-rgb.h @@ -62,9 +62,9 @@ typedef GLfloat GLrgba4f[4]; #define ARGB_PACK_ARGBF(a,r,g,b) (((a*0xFF) << 24) | ((r*0xFF) << 16) | ((g*0xFF)<<8) | (b*0xFF)) #define S8_NEG_OFT 128 // Absolute Value of Minimum 8bit Signed Range // -#define S16_NEG_OFT 32768 // Absolute Value of Minimum bit Signed Range // +#define S16_NEG_OFT 32768 // Absolute Value of Minimum 16bit Signed Range // -void _glPixelConvertRGB(int format, int w, int h, void *src, uint16 *dst); -void _glPixelConvertRGBA(int format, int w, int h, void *src, uint16 *dst); +void _glKosPixelConvertRGB(int format, int w, int h, void *src, uint16 *dst); +void _glKosPixelConvertRGBA(int format, int w, int h, void *src, uint16 *dst); #endif diff --git a/gl-texture.c b/gl-texture.c index 80c4ffa..2e701ce 100755 --- a/gl-texture.c +++ b/gl-texture.c @@ -273,13 +273,13 @@ void APIENTRY glTexImage2D(GLenum target, GLint level, GLint internalFormat, switch(internalFormat) { case GL_RGB: - _glPixelConvertRGB(type, width, height, (void *)data, tex); + _glKosPixelConvertRGB(type, width, height, (void *)data, tex); GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->color = (PVR_TXRFMT_RGB565 | PVR_TXRFMT_NONTWIDDLED); sq_cpy(GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->data, tex, bytes); break; case GL_RGBA: - _glPixelConvertRGBA(type, width, height, (void *)data, tex); + _glKosPixelConvertRGBA(type, width, height, (void *)data, tex); GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->color = (PVR_TXRFMT_ARGB4444 | PVR_TXRFMT_NONTWIDDLED); sq_cpy(GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->data, tex, bytes); break; hooks/post-receive -- The KallistiOS port of OpenGL. |