Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/Cog' into FapSessionId
Browse files Browse the repository at this point in the history
  • Loading branch information
akgrant committed Dec 14, 2018
2 parents b4344b7 + 6e233d3 commit 59b555f
Show file tree
Hide file tree
Showing 47 changed files with 483 additions and 435 deletions.
28 changes: 28 additions & 0 deletions build.linux64ARMv8/squeak.stack.spur/build/mvm
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -e
# Stack Spur VM with VM profiler and threaded heartbeat
INSTALLDIR=sqstkspur64linuxht
OPT="-g -O1 -fwrapv -DNDEBUG -DDEBUGVM=0"

if [ $# -ge 1 ]; then
INSTALLDIR="$1"; shift
fi
echo -n "clean? "
read a
case $a in
n|no|N|NO) echo "ok but this isn't safe!!";;
*) rm -f config.h; test -f Makefile && make reallyclean
esac
test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .)
test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .)
test -f config.h || ../../../platforms/unix/config/configure \
--with-vmversion=5.0 \
--with-src=spurstack64src --disable-cogit \
--without-vm-display-fbdev --without-npsqueak \
TARGET_ARCH="-march=armv8-a" \
CFLAGS="$OPT -D__ARM_ARCH_8A__ -D__arm__ -D__arm64__"
rm -f vm/sqUnixMain.o # nuke version info
rm -rf ../../../products/$INSTALLDIR
# prefer make install prefix=`readlink -f \`pwd\`/../../../products/$INSTALLDIR`
# but older linux readlinks lack the -f flag
make install-squeak install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG
15 changes: 15 additions & 0 deletions build.linux64ARMv8/squeak.stack.spur/makeallclean
@@ -0,0 +1,15 @@
#!/bin/sh -e
trap 'exit 2' HUP INT PIPE TERM
if [ "$1" = -fork ]; then
shift
for d in `dirname $0`/build*; do
(cd ./$d
echo y | ./mvm "$@") &
done
wait
else
for d in `dirname $0`/build*; do
(cd ./$d
echo y | ./mvm "$@")
done
fi
15 changes: 15 additions & 0 deletions build.linux64ARMv8/squeak.stack.spur/makealldirty
@@ -0,0 +1,15 @@
#!/bin/sh -e
trap 'exit 2' HUP INT PIPE TERM
if [ "$1" = -fork ]; then
shift
for d in `dirname $0`/build*; do
(cd ./$d
echo n | ./mvm "$@") &
done
wait
else
for d in `dirname $0`/build*; do
(cd ./$d
echo n | ./mvm "$@")
done
fi
13 changes: 13 additions & 0 deletions build.linux64ARMv8/squeak.stack.spur/plugins.ext
@@ -0,0 +1,13 @@
# Copied, perhaps edited, from ../../src/examplePlugins.ext
EXTERNAL_PLUGINS = \
B3DAcceleratorPlugin \
FileAttributesPlugin \
Squeak3D \
SqueakFFIPrims \
SqueakSSL \
LocalePlugin \
UnicodePlugin \
UnixOSProcessPlugin \
UUIDPlugin \
ImmX11Plugin \
XDisplayControlPlugin
38 changes: 38 additions & 0 deletions build.linux64ARMv8/squeak.stack.spur/plugins.int
@@ -0,0 +1,38 @@
# Copied, perhaps edited, from ../../src/examplePlugins.int
INTERNAL_PLUGINS = \
ADPCMCodecPlugin \
AioPlugin \
AsynchFilePlugin \
B2DPlugin \
BitBltPlugin \
BMPReadWriterPlugin \
CroquetPlugin \
HostWindowPlugin \
ZipPlugin \
DropPlugin \
DSAPrims \
FFTPlugin \
FileCopyPlugin \
FilePlugin \
FloatArrayPlugin \
FloatMathPlugin \
IA32ABI \
JoystickTabletPlugin \
JPEGReaderPlugin \
JPEGReadWriter2Plugin \
Klatt \
LargeIntegers \
Matrix2x3Plugin \
MIDIPlugin \
MiscPrimitivePlugin \
Mpeg3Plugin \
RePlugin \
SecurityPlugin \
SerialPlugin \
SocketPlugin \
SoundCodecPrims \
SoundGenerationPlugin \
SoundPlugin \
StarSqueakPlugin \
SurfacePlugin \
VMProfileLinuxSupportPlugin
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e
# assert VM with VM profiler and itimer heartbeat
INSTALLDIR=assert/cogspur64linux
INSTALLDIR=assert/phcogspur64linux
OPT="-g3 -O1 -fwrapv -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -DDEBUGVM=0 -DPharoVM"

if [ $# -ge 1 ]; then
Expand Down
2 changes: 1 addition & 1 deletion build.linux64x64/pharo.cog.spur/build.assert/mvm
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e
# assert PharoVM with VM profiler and threaded heartbeat
INSTALLDIR=assert/cogspur64linuxht
INSTALLDIR=assert/phcogspur64linuxht
OPT="-g3 -O1 -fwrapv -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -DDEBUGVM=0 -DPharoVM"

if [ $# -ge 1 ]; then
Expand Down
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e
# debug Spur VM with VM profiler and itimer heartbeat
INSTALLDIR=debug/cogspur64linux
INSTALLDIR=debug/phcogspur64linux
OPT="-g3 -O0 -fwrapv -DDEBUGVM=1 -DPharoVM"

if [ $# -ge 1 ]; then
Expand Down
2 changes: 1 addition & 1 deletion build.linux64x64/pharo.cog.spur/build.debug/mvm
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e
# debug PharoVM with VM profiler and threaded heartbeat
INSTALLDIR=debug/cogspur64linuxht
INSTALLDIR=debug/phcogspur64linuxht
OPT="-g3 -O0 -fwrapv -DDEBUGVM=1 -DPharoVM"

if [ $# -ge 1 ]; then
Expand Down
2 changes: 1 addition & 1 deletion build.linux64x64/pharo.cog.spur/build.itimerheartbeat/mvm
Expand Up @@ -2,7 +2,7 @@
set -e
# PharoVM with VM profiler and itimer heartbeat
THIRDPARTYLIBS="libsdl2 openssl libssh2 libgit2"
INSTALLDIR=cogspur64linux
INSTALLDIR=phcogspur64linux
# Some gcc versions create a broken VM using -O2
case $(c99 -dumpversion) in
3.4.*) OPT="-g -O1 -fwrapv -DNDEBUG -DDEBUGVM=0";;
Expand Down
2 changes: 1 addition & 1 deletion build.linux64x64/pharo.cog.spur/build/mvm
Expand Up @@ -2,7 +2,7 @@
set -ex
# PharoVM with VM profiler and threaded heartbeat
THIRDPARTYLIBS="libsdl2 openssl libssh2 libgit2"
INSTALLDIR=cogspur64linuxht
INSTALLDIR=phcogspur64linuxht

# Some gcc versions create a broken VM using -O2
case $(c99 -dumpversion) in
Expand Down
Expand Up @@ -184,12 +184,13 @@ typedef struct B3DPrimitiveLight {
/* module initialization support */
int b3dxInitialize(void); /* return true on success, false on error */
int b3dxShutdown(void); /* return true on success, false on error */
int b3dLoadClientState(int, float *, int, float *, int, float *, int, float *, int);

/* Texture support primitives */
int b3dxAllocateTexture(int renderer, int w, int h, int d); /* return handle or -1 on error */
int b3dxDestroyTexture(int renderer, int handle); /* return true on success, false on error */
int b3dxActualTextureDepth(int renderer, int handle); /* return depth or <0 on error */
int b3dxTextureColorMasks(int renderer, int handle, int masks[4]); /* return true on success, false on error */
int b3dxTextureColorMasks(int renderer, int handle, unsigned int masks[4]); /* return true on success, false on error */
int b3dxUploadTexture(int renderer, int handle, int w, int h, int d, void* bits); /* return true on success, false on error */
int b3dxTextureByteSex(int renderer, int handle); /* return > 0 for MSB, = 0 for LSB, < 0 for error */
int b3dxTextureSurfaceHandle(int renderer, int handle); /* return handle or <0 if error */
Expand All @@ -204,7 +205,7 @@ int b3dxGetRendererSurfaceHandle(int handle); /* return handle or <0 if error */
int b3dxGetRendererSurfaceWidth(int handle); /* return width or <0 if error */
int b3dxGetRendererSurfaceHeight(int handle); /* return height or <0 if error */
int b3dxGetRendererSurfaceDepth(int handle); /* return depth or <0 if error */
int b3dxGetRendererColorMasks(int handle, int *masks); /* return true on success, false on error */
int b3dxGetRendererColorMasks(int handle, unsigned int *masks); /* return true on success, false on error */

int b3dxSetViewport(int handle, int x, int y, int w, int h); /* return true on success, false on error */
int b3dxClearDepthBuffer(int handle); /* return true on success, false on error */
Expand Down
Expand Up @@ -142,7 +142,7 @@ int glGetRendererSurfaceHandle(int handle) {
return -1; /* e.g., fail */
}

int glGetRendererColorMasks(int handle, int *masks) {
int glGetRendererColorMasks(int handle, unsigned int *masks) {
/* If a surface is provided, this is the place to fill
in the color masks for the surface. Since we don't
provide any, we just bail out.
Expand Down Expand Up @@ -248,7 +248,7 @@ int glActualTextureDepth(int rendererHandle, int handle) /* return depth or <0 o
return 32;
}

int glTextureColorMasks(int rendererHandle, int handle, int masks[4]) /* return true on success, false on error */
int glTextureColorMasks(int rendererHandle, int handle, unsigned int masks[4]) /* return true on success, false on error */
{
struct glRenderer *renderer = glRendererFromHandle(rendererHandle);
if(!renderer) return 0;
Expand Down
3 changes: 3 additions & 0 deletions platforms/Cross/plugins/IA32ABI/x64win64abicc.c
Expand Up @@ -38,6 +38,9 @@ extern
#endif
struct VirtualMachine* interpreterProxy;

#ifdef _MSC_VER
# define alloca _alloca
#endif
#if __GNUC__
# define setsp(sp) __asm__ volatile ("movq %0,%%rsp" : : "m"(sp))
# define getsp() ({ void *sp; __asm__ volatile ("movq %%rsp,%0" : "=r"(sp) : ); sp;})
Expand Down
5 changes: 3 additions & 2 deletions platforms/Cross/plugins/SecurityPlugin/SecurityPlugin.h
Expand Up @@ -15,8 +15,6 @@ sqInt ioCanConnectToPort(sqInt netAddr, sqInt port);
sqInt ioCanCreateSocketOfType(sqInt netType, sqInt socketType);
sqInt ioCanCreateSocketOfType(sqInt netType, sqInt socketType);
sqInt ioCanConnectToPort(sqInt netAddr, sqInt port);
sqInt ioDisableSocketAccess(void);
sqInt ioHasSocketAccess(void);
sqInt ioCanCreatePathOfSize(char* pathString, sqInt pathStringLength);
sqInt ioCanDeleteFileOfSize(char* pathString, sqInt pathStringLength);
sqInt ioCanDeletePathOfSize(char* pathString, sqInt pathStringLength);
Expand All @@ -28,4 +26,7 @@ sqInt ioCanRenameFileOfSize(char* pathString, sqInt pathStringLength);
sqInt ioCanRenameImage(void);
sqInt ioCanSetFileTypeOfSize(char* pathString, sqInt pathStringLength);
sqInt ioDisableFileAccess(void);
sqInt ioDisableSocketAccess(void);
sqInt ioHasEnvironmentAccess(void);
sqInt ioHasFileAccess(void);
sqInt ioHasSocketAccess(void);
1 change: 1 addition & 0 deletions platforms/Cross/plugins/SerialPlugin/SerialPlugin.h
Expand Up @@ -6,6 +6,7 @@ int serialPortShutdown(void);

#pragma export on
int serialPortClose(int portNum);
int serialPortCloseByName(const char *portName);
int serialPortCount(void);
int serialPortOpen(int portNum, int baudRate, int stopBitsType, int parityType, int dataBits,
int inFlowCtrl, int outFlowCtrl, int xOnChar, int xOffChar);
Expand Down
Expand Up @@ -11,9 +11,9 @@
* NOTES:
* Feb 22nd, 2002, JMM enable 16 ports for serial, versus four, which was capped at 2?
****************************************************************************/

#include "sq.h"
#include "SerialPlugin.h"
#include <Carbon/Carbon.h>

extern struct VirtualMachine *interpreterProxy;

Expand Down Expand Up @@ -44,8 +44,7 @@ int serialPortShutdown() {
EXPORT (int) serialPortCount(void) {
/* Return the number of serial ports available on this machine */
return false;

}
}

int serialPortIsOpen(int portNum) {
if ((portNum < 0) || (portNum >= MAX_PORTS)) return false;
Expand Down Expand Up @@ -77,6 +76,10 @@ EXPORT (int) serialPortClose(int portNum) {
#pragma unused(portNum)
return false;
}
EXPORT (int) serialPortCloseByName(const char *portName) {
#pragma unused(portName)
return false;
}

EXPORT (int) serialPortOpen(
int portNum, int baudRate, int stopBitsType, int parityType, int dataBits,
Expand Down Expand Up @@ -122,18 +125,9 @@ EXPORT (int) serialPortWriteFrom(int portNum, int count, void *bufferPtr) {
synchronous: it doesn't return until the data has been sent. However, other
implementations may return before transmission is complete. */

long int byteCount = count;
int osErr;

if (!serialPortIsOpen(portNum)) {
return interpreterProxy->success(false);
}
#pragma unused(portNum,count,bufferPtr)

osErr = FSWrite(outRefNum[portNum], &byteCount, (char *) bufferPtr);
if (osErr != noErr) {
return interpreterProxy->success(false);
}
return byteCount;
return interpreterProxy->success(false);
}

EXPORT (int) serialPortWriteFromByName(const char *portName, int count, void *bufferPtr) {
Expand Down
6 changes: 3 additions & 3 deletions platforms/iOS/plugins/AioPlugin/Makefile
@@ -1,5 +1,5 @@
INCDIRS:=../../platforms/Cross/plugins/FilePlugin \
../../platforms/Cross/plugins/SocketPlugin \
../../platforms/unix/vm
INCDIRS:=$(PLATDIR)/Cross/plugins/FilePlugin \
$(PLATDIR)/Cross/plugins/SocketPlugin \
$(PLATDIR)/unix/vm

include ../common/Makefile.plugin
6 changes: 3 additions & 3 deletions platforms/iOS/plugins/AsynchFilePlugin/Makefile
@@ -1,5 +1,5 @@
SRCDIRS:=../../platforms/unix/plugins/AsynchFilePlugin
INCDIRS:=../../platforms/Cross/plugins/AsynchFilePlugin \
../../platforms/unix/vm
SRCDIRS:=$(PLATDIR)/unix/plugins/AsynchFilePlugin
INCDIRS:=$(PLATDIR)/Cross/plugins/AsynchFilePlugin \
$(PLATDIR)/unix/vm

include ../common/Makefile.plugin
6 changes: 3 additions & 3 deletions platforms/iOS/plugins/B3DAcceleratorPlugin/Makefile
Expand Up @@ -2,9 +2,9 @@
# of Carbon code & is hence 32-bit only. So include the Carbon frameworks.
# Until this can be rewritten this implies no 64-bit OpenGL on Mac OS X :-(.

INCDIRS:=../../platforms/Cross/plugins/FilePlugin \
../../platforms/unix/vm
INCDIRS:=../../platforms/unix/vm
INCDIRS:=$(PLATDIR)/Cross/plugins/FilePlugin \
$(PLATDIR)/unix/vm
INCDIRS:=$(PLATDIR)/unix/vm

EXTRADYFLAGS=-Wl,-U,_getImageName,-U,_getSTWindow,-U,_setWindowChangedHook,-U,_warning \
-Wl,-U,_getMainWindowOpenGLContext,-U,_createOpenGLTextureLayerHandle,-U,_destroyOpenGLTextureLayerHandle,-U,_setOpenGLTextureLayerContent
Expand Down
4 changes: 2 additions & 2 deletions platforms/iOS/plugins/FileAttributesPlugin/Makefile
Expand Up @@ -2,8 +2,8 @@
# FileAttributesPlugin uses sq2uxPath() and ux2sqPath(), provided by sqUnixCharConv.h
#
#
SRCDIRS:=../../platforms/unix/vm ../../platforms/unix/plugins/FileAttributesPlugin
INCDIRS:=../../platforms/unix/vm ../../platforms/unix/plugins/FileAttributesPlugin
SRCDIRS:=$(PLATDIR)/unix/vm $(PLATDIR)/unix/plugins/FileAttributesPlugin
INCDIRS:=$(PLATDIR)/unix/vm $(PLATDIR)/unix/plugins/FileAttributesPlugin
LIBSRC:=FileAttributesPlugin.c sqUnixCharConv.c faSupport.c faCommon.c

include ../common/Makefile.plugin
Expand Down
4 changes: 2 additions & 2 deletions platforms/iOS/plugins/FileCopyPlugin/Makefile
@@ -1,5 +1,5 @@
SRCDIRS:=../../platforms/unix/plugins/FileCopyPlugin \
../../platforms/unix/vm
SRCDIRS:=$(PLATDIR)/unix/plugins/FileCopyPlugin \
$(PLATDIR)/unix/vm

LIBSRC:=FileCopyPlugin.c sqUnixFileCopyPlugin.c sqUnixCharConv.c

Expand Down
2 changes: 1 addition & 1 deletion platforms/iOS/plugins/FilePlugin/Makefile
@@ -1,3 +1,3 @@
INCDIRS:=../../platforms/minheadless/unix
INCDIRS:=$(PLATDIR)/minheadless/unix

include ../common/Makefile.plugin
6 changes: 3 additions & 3 deletions platforms/iOS/plugins/Mpeg3Plugin/Makefile
@@ -1,6 +1,6 @@
INCDIRS:=../../platforms/Cross/plugins/Mpeg3Plugin/libmpeg \
../../platforms/Cross/plugins/Mpeg3Plugin/libmpeg/audio \
../../platforms/Cross/plugins/Mpeg3Plugin/libmpeg/video
INCDIRS:=$(PLATDIR)/Cross/plugins/Mpeg3Plugin/libmpeg \
$(PLATDIR)/Cross/plugins/Mpeg3Plugin/libmpeg/audio \
$(PLATDIR)/Cross/plugins/Mpeg3Plugin/libmpeg/video

SRCDIRS:=$(INCDIRS)
EXCLUDESRC:=%/dump.c %/dump2.c %/mpeg3toc.c %/mpeg3cat.c %/testaudio.c %/udump.c %/worksheet.c %/test.c
Expand Down
6 changes: 3 additions & 3 deletions platforms/iOS/plugins/ObjectiveCPlugin/Makefile
@@ -1,7 +1,7 @@
EXTRALIBS:=-undefined dynamic_lookup -framework Foundation
CFLAGS:=-x objective-c
INCDIRS:=../../platforms/iOS/plugins/SqueakObjectiveC
SRCDIRS:=../../platforms/iOS/plugins/SqueakObjectiveC
INCDIRS:=$(PLATDIR)/iOS/plugins/SqueakObjectiveC
SRCDIRS:=$(PLATDIR)/iOS/plugins/SqueakObjectiveC
LIBSRC:=squeakProxy.m squeakSUnitTester.m

include ../common/Makefile.plugin
include ../common/Makefile.plugin
4 changes: 3 additions & 1 deletion platforms/iOS/plugins/SecurityPlugin/Makefile
@@ -1,3 +1,5 @@
INCDIRS:=../../platforms/Cross/plugins/FilePlugin
SRCDIRS:=$(PLATDIR)/unix/plugins/SecurityPlugin
INCDIRS:=$(PLATDIR)/Cross/plugins/FilePlugin $(PLATDIR)/Cross/plugins/SecurityPlugin
LIBSRC:=SecurityPlugin.c sqUnixSecurity.c

include ../common/Makefile.plugin

0 comments on commit 59b555f

Please sign in to comment.