Revision: 2677 Author: eliot Date: 2013-01-31 10:00:18 -0800 (Thu, 31 Jan 2013) Log Message: ----------- Back out of the addition of the named serial port read & write primitives to the SerialPlugin. They're lacking adequate platform support right now.
Modified Paths: -------------- branches/Cog/src/plugins/SerialPlugin/SerialPlugin.c
Property Changed: ---------------- branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h ___________________________________________________________________ Modified: checkindate - Wed Jan 30 17:41:13 PST 2013 + Thu Jan 31 09:58:48 PST 2013
Modified: branches/Cog/src/plugins/SerialPlugin/SerialPlugin.c =================================================================== --- branches/Cog/src/plugins/SerialPlugin/SerialPlugin.c 2013-01-31 01:42:03 UTC (rev 2676) +++ branches/Cog/src/plugins/SerialPlugin/SerialPlugin.c 2013-01-31 18:00:18 UTC (rev 2677) @@ -1,9 +1,9 @@ /* Automatically generated by - SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.261 uuid: eeb310a3-23e0-41f6-8a92-5749b798e623 + SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.235 uuid: 954df856-3f83-498c-9735-6cd3777ba9c7 from - SerialPlugin VMMaker.oscog-eem.261 uuid: eeb310a3-23e0-41f6-8a92-5749b798e623 + SerialPlugin VMMaker.oscog-eem.235 uuid: 954df856-3f83-498c-9735-6cd3777ba9c7 */ -static char __buildInfo[] = "SerialPlugin VMMaker.oscog-eem.261 uuid: eeb310a3-23e0-41f6-8a92-5749b798e623 " __DATE__ ; +static char __buildInfo[] = "SerialPlugin VMMaker.oscog-eem.235 uuid: 954df856-3f83-498c-9735-6cd3777ba9c7 " __DATE__ ;
@@ -49,11 +49,8 @@ static sqInt msg(char *s); EXPORT(sqInt) primitiveSerialPortClose(void); EXPORT(sqInt) primitiveSerialPortOpen(void); -EXPORT(sqInt) primitiveSerialPortOpenByName(void); EXPORT(sqInt) primitiveSerialPortRead(void); -EXPORT(sqInt) primitiveSerialPortReadByName(void); EXPORT(sqInt) primitiveSerialPortWrite(void); -EXPORT(sqInt) primitiveSerialPortWriteByName(void); EXPORT(sqInt) setInterpreter(struct VirtualMachine*anInterpreter); EXPORT(sqInt) shutdownModule(void); static void sqAssert(sqInt aBool); @@ -69,7 +66,6 @@ static sqInt (*isBytes)(sqInt oop); static sqInt (*pop)(sqInt nItems); static sqInt (*popthenPush)(sqInt nItems, sqInt oop); -static sqInt (*slotSizeOf)(sqInt oop); static sqInt (*stackIntegerValue)(sqInt offset); static sqInt (*stackValue)(sqInt offset); static sqInt (*success)(sqInt aBoolean); @@ -81,7 +77,6 @@ extern sqInt isBytes(sqInt oop); extern sqInt pop(sqInt nItems); extern sqInt popthenPush(sqInt nItems, sqInt oop); -extern sqInt slotSizeOf(sqInt oop); extern sqInt stackIntegerValue(sqInt offset); extern sqInt stackValue(sqInt offset); extern sqInt success(sqInt aBoolean); @@ -91,9 +86,9 @@ struct VirtualMachine* interpreterProxy; static const char *moduleName = #ifdef SQUEAK_BUILTIN_PLUGIN - "SerialPlugin VMMaker.oscog-eem.261 (i)" + "SerialPlugin VMMaker.oscog-eem.235 (i)" #else - "SerialPlugin VMMaker.oscog-eem.261 (e)" + "SerialPlugin VMMaker.oscog-eem.235 (e)" #endif ;
@@ -192,48 +187,6 @@ }
EXPORT(sqInt) -primitiveSerialPortOpenByName(void) -{ - sqInt baudRate; - sqInt dataBits; - sqInt inFlowControl; - sqInt outFlowControl; - sqInt parityType; - char *port; - char *portName; - sqInt portNameSize; - sqInt stopBitsType; - sqInt xOffChar; - sqInt xOnChar; - - success(isBytes(stackValue(8))); - portName = ((char *) (firstIndexableField(stackValue(8)))); - baudRate = stackIntegerValue(7); - stopBitsType = stackIntegerValue(6); - parityType = stackIntegerValue(5); - dataBits = stackIntegerValue(4); - inFlowControl = stackIntegerValue(3); - outFlowControl = stackIntegerValue(2); - xOnChar = stackIntegerValue(1); - xOffChar = stackIntegerValue(0); - if (failed()) { - return null; - } - portNameSize = slotSizeOf(((int) portName) - 4); - port = calloc(portNameSize, sizeof(char)); - memcpy(port, portName, portNameSize); - serialPortOpenByName( - port, baudRate, stopBitsType, parityType, dataBits, - inFlowControl, outFlowControl, xOnChar, xOffChar); - free(port); - if (failed()) { - return null; - } - pop(9); - return null; -} - -EXPORT(sqInt) primitiveSerialPortRead(void) { char *array; @@ -265,44 +218,6 @@ }
EXPORT(sqInt) -primitiveSerialPortReadByName(void) -{ - char *array; - sqInt arrayPtr; - sqInt bytesRead; - sqInt count; - char *port; - char *portName; - sqInt portNameSize; - sqInt startIndex; - sqInt _return_value; - - success(isBytes(stackValue(3))); - portName = ((char *) (firstIndexableField(stackValue(3)))); - success(isBytes(stackValue(2))); - array = ((char *) (firstIndexableField(stackValue(2)))); - startIndex = stackIntegerValue(1); - count = stackIntegerValue(0); - if (failed()) { - return null; - } - success((startIndex >= 1) - && (((startIndex + count) - 1) <= (byteSizeOf(((sqInt)(long)(array) - 4))))); - portNameSize = slotSizeOf(((int) portName) - 4); - port = calloc(portNameSize, sizeof(char)); - memcpy(port, portName, portNameSize); - arrayPtr = ((((sqInt)array)) + startIndex) - 1; - bytesRead = serialPortReadIntoByName( port, count, arrayPtr); - free(port); - _return_value = integerObjectOf(bytesRead); - if (failed()) { - return null; - } - popthenPush(5, _return_value); - return null; -} - -EXPORT(sqInt) primitiveSerialPortWrite(void) { char *array; @@ -335,47 +250,7 @@ return null; }
-EXPORT(sqInt) -primitiveSerialPortWriteByName(void) -{ - char *array; - sqInt arrayPtr; - sqInt bytesWritten; - sqInt count; - char *port; - char *portName; - sqInt portNameSize; - sqInt startIndex; - sqInt _return_value;
- success(isBytes(stackValue(3))); - portName = ((char *) (firstIndexableField(stackValue(3)))); - success(isBytes(stackValue(2))); - array = ((char *) (firstIndexableField(stackValue(2)))); - startIndex = stackIntegerValue(1); - count = stackIntegerValue(0); - if (failed()) { - return null; - } - portNameSize = slotSizeOf(((int) portName) - 4); - port = calloc(portNameSize, sizeof(char)); - memcpy(port, portName, portNameSize); - success((startIndex >= 1) - && (((startIndex + count) - 1) <= (byteSizeOf(((sqInt)(long)(array) - 4))))); - if (!(failed())) { - arrayPtr = ((((sqInt)array)) + startIndex) - 1; - bytesWritten = serialPortWriteFromByName(port, count, arrayPtr); - } - free(port); - _return_value = integerObjectOf(bytesWritten); - if (failed()) { - return null; - } - popthenPush(5, _return_value); - return null; -} - - /* Note: This is coded so that it can be run in Squeak. */
EXPORT(sqInt) @@ -396,7 +271,6 @@ isBytes = interpreterProxy->isBytes; pop = interpreterProxy->pop; popthenPush = interpreterProxy->popthenPush; - slotSizeOf = interpreterProxy->slotSizeOf; stackIntegerValue = interpreterProxy->stackIntegerValue; stackValue = interpreterProxy->stackValue; success = interpreterProxy->success; @@ -425,11 +299,8 @@ {"SerialPlugin", "initialiseModule", (void*)initialiseModule}, {"SerialPlugin", "primitiveSerialPortClose", (void*)primitiveSerialPortClose}, {"SerialPlugin", "primitiveSerialPortOpen", (void*)primitiveSerialPortOpen}, - {"SerialPlugin", "primitiveSerialPortOpenByName", (void*)primitiveSerialPortOpenByName}, {"SerialPlugin", "primitiveSerialPortRead", (void*)primitiveSerialPortRead}, - {"SerialPlugin", "primitiveSerialPortReadByName", (void*)primitiveSerialPortReadByName}, {"SerialPlugin", "primitiveSerialPortWrite", (void*)primitiveSerialPortWrite}, - {"SerialPlugin", "primitiveSerialPortWriteByName", (void*)primitiveSerialPortWriteByName}, {"SerialPlugin", "setInterpreter", (void*)setInterpreter}, {"SerialPlugin", "shutdownModule", (void*)shutdownModule}, {NULL, NULL, NULL}
vm-dev@lists.squeakfoundation.org