Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002404 [Squeak] VM feature N/A 12-23-05 01:34 01-18-06 19:23
Reporter tim View Status public  
Assigned To tim
Priority high Resolution fixed  
Status closed   Product Version 3.8
Summary 0002404: Add VM filename conversion access and endianness access to interpreterProxy for plugin use
Description Original request:-
    From: bert@impara.de
    Subject: Plugins and Platforms
    Date: November 25, 2005 3:47:42 AM PST (CA)
    To: vm-dev@discuss.squeakfoundation.org

Hi folks,

when writing a plugin in Slang I encountered two problems wrt platform specifics:

1) convert a squeak pathname to a platform pathname:

    * my plugin links to a library that expects a platform file path
    * must convert from Squeak path (char encoding etc.)
    * sqFilenameFromString() should do this

    * PROBLEM: this does not work in an external plugin
    * because it is just a macro pointing to some platform-code function that would have to be linked to the external plugin

    * PROPOSAL: provide an ioFilenameFromString() function exported from the VM
    * looked up by plugin via interpreterProxy->ioLoadFunctionFrom("ioFilenameFromString", "")
    * could trivially be implemented by using sqFilenameFromString macro?

2) endianness:

    * I need to know the current platform's endianness
    * because the linked library provides 8 bit bitmap data in platform order
    * and I want to adjust the Squeak form from the plugin (set depth to -8 on little-endian machine)

    * PROBLEM: which function/macro to use?

    * there seem to be several:
    - LSB_FIRST used in B3DAcceleratorPlugin.c
    - MSB_FIRST used in sqWin32Window.c
    - WORDS_BIGENDIAN defined on Mac OS and Unix - is this the one?
Additional Information An interpreterProxy function for ioFilenameFromString is easy enough - we have sqFileNameFromString provided in the base code. It is nominally a macro although several platforms recast it as a function. There is also the slight fiddly bit of the sqFilenameFromStringOpen stuff for OSX to consider.
It looks as if simply making an Interpreter method ioFilenameFromString that points to sqfilenameFromString will do. Add equivalent to InterpreterProxy as well and of course to sqVirtualMachine.[ch]

There isn't any single universal macro or value to indicate endianess so I'll add one. A macro will be most useful since it can be set in a sqPlatformSpecific.h or from a makefile command as a result of autoconf or other OS gymnastics.
Attached Files  Interpreter-isBigEnder-dtl.1.cs.gz [^] (639 bytes) 12-29-05 03:29
 EndianPlugin-dtl.1.cs.gz [^] (737 bytes) 12-29-05 03:29

- Relationships

- Notes
(0003396 - 477 - 523 - 523 - 523 - 523 - 523)
lewis
12-29-05 03:30

In VMMaker3.8b5-64, a macro is introduced for VMENDIANNESS. This should not be necessary, since endianness can be tested at runtime.

Interpreter-isBigEnder-dtl.1.cs provides the runtime check.

EndianPlugin-dtl.1.cs is a plugin to verify that it works.

This has been tested only on an Intel 32 bit box, so it needs at least a check on a Mac. To test, build the EndianPlugin, then evaluate "EndianPlugin endianness = Smalltalk endianness", which should evaluate to true.
 
(0003420 - 27 - 27 - 27 - 27 - 27 - 27)
tim
01-02-06 21:04

VMMaker3.8b5-64B has fixes.
 
(0003536 - 16 - 16 - 16 - 16 - 16 - 16)
MarcusDenker
01-18-06 19:23

fixed in vmmaker
 

- Issue History
Date Modified Username Field Change
12-23-05 01:34 tim New Issue
12-23-05 01:37 tim Status new => assigned
12-23-05 01:37 tim Assigned To  => tim
12-29-05 03:29 lewis File Added: Interpreter-isBigEnder-dtl.1.cs.gz
12-29-05 03:29 lewis File Added: EndianPlugin-dtl.1.cs.gz
12-29-05 03:30 lewis Note Added: 0003396
12-29-05 03:30 lewis Issue Monitored: lewis
01-02-06 21:04 tim Status assigned => resolved
01-02-06 21:04 tim Fixed in Version  => 3.8
01-02-06 21:04 tim Resolution open => fixed
01-02-06 21:04 tim Note Added: 0003420
01-18-06 19:23 MarcusDenker Status resolved => closed
01-18-06 19:23 MarcusDenker Note Added: 0003536


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
53 total queries executed.
36 unique queries executed.
Powered by Mantis Bugtracker