A lightweight VM which allows for easy custom programs to be made on the device without having to worry about linking and PIC code and all of that. BSD licensed. See https://bitbucket.org/earlz/lightvm/ for the upstream general purpose repository

Dependents:   MbedConsole

Committer:
earlz
Date:
Fri Apr 12 04:12:59 2013 +0000
Revision:
0:dac6a7d43ed2
Initial import. Upstream changeset 29:8dd470477c0b / tip

Who changed what in which revision?

UserRevisionLine numberNew contents of line
earlz 0:dac6a7d43ed2 1
earlz 0:dac6a7d43ed2 2 /**
earlz 0:dac6a7d43ed2 3 <Copyright Header>
earlz 0:dac6a7d43ed2 4 Copyright (c) 2013 Jordan "Earlz" Earls <http://Earlz.net>
earlz 0:dac6a7d43ed2 5 All rights reserved.
earlz 0:dac6a7d43ed2 6
earlz 0:dac6a7d43ed2 7 Redistribution and use in source and binary forms, with or without
earlz 0:dac6a7d43ed2 8 modification, are permitted provided that the following conditions
earlz 0:dac6a7d43ed2 9 are met:
earlz 0:dac6a7d43ed2 10
earlz 0:dac6a7d43ed2 11 1. Redistributions of source code must retain the above copyright
earlz 0:dac6a7d43ed2 12 notice, this list of conditions and the following disclaimer.
earlz 0:dac6a7d43ed2 13 2. Redistributions in binary form must reproduce the above copyright
earlz 0:dac6a7d43ed2 14 notice, this list of conditions and the following disclaimer in the
earlz 0:dac6a7d43ed2 15 documentation and/or other materials provided with the distribution.
earlz 0:dac6a7d43ed2 16 3. The name of the author may not be used to endorse or promote products
earlz 0:dac6a7d43ed2 17 derived from this software without specific prior written permission.
earlz 0:dac6a7d43ed2 18
earlz 0:dac6a7d43ed2 19 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
earlz 0:dac6a7d43ed2 20 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
earlz 0:dac6a7d43ed2 21 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
earlz 0:dac6a7d43ed2 22 THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
earlz 0:dac6a7d43ed2 23 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
earlz 0:dac6a7d43ed2 24 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
earlz 0:dac6a7d43ed2 25 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
earlz 0:dac6a7d43ed2 26 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
earlz 0:dac6a7d43ed2 27 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
earlz 0:dac6a7d43ed2 28 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
earlz 0:dac6a7d43ed2 29 </Copyright Header>
earlz 0:dac6a7d43ed2 30 */
earlz 0:dac6a7d43ed2 31
earlz 0:dac6a7d43ed2 32 #ifndef LIGHTVM_CONFIG_H
earlz 0:dac6a7d43ed2 33 #define LIGHTVM_CONFIG_H
earlz 0:dac6a7d43ed2 34
earlz 0:dac6a7d43ed2 35 //configuration directives
earlz 0:dac6a7d43ed2 36
earlz 0:dac6a7d43ed2 37 /*
earlz 0:dac6a7d43ed2 38 The optimal opcache size in bytes.
earlz 0:dac6a7d43ed2 39 This is the maximum amount of bytes that can possibly be read in a single operation
earlz 0:dac6a7d43ed2 40
earlz 0:dac6a7d43ed2 41 */
earlz 0:dac6a7d43ed2 42 //#define OPTIMAL_OPCACHE_SIZE 4
earlz 0:dac6a7d43ed2 43
earlz 0:dac6a7d43ed2 44
earlz 0:dac6a7d43ed2 45
earlz 0:dac6a7d43ed2 46 //options
earlz 0:dac6a7d43ed2 47
earlz 0:dac6a7d43ed2 48 /*
earlz 0:dac6a7d43ed2 49 Use this to ensure that exactly 16-bit registers are used
earlz 0:dac6a7d43ed2 50 */
earlz 0:dac6a7d43ed2 51 //#define EXACT_REGISTERS
earlz 0:dac6a7d43ed2 52 /*
earlz 0:dac6a7d43ed2 53 Use this to give the greater world the middle finger and use
earlz 0:dac6a7d43ed2 54 optimizations that will make the VM environment non-portable.
earlz 0:dac6a7d43ed2 55 Includes making registers take up exactly 32 bits, rather than 64
earlz 0:dac6a7d43ed2 56 */
earlz 0:dac6a7d43ed2 57 //#define SCREW_PORTABILITY
earlz 0:dac6a7d43ed2 58
earlz 0:dac6a7d43ed2 59 //#define ALIGN_OPCACHE
earlz 0:dac6a7d43ed2 60
earlz 0:dac6a7d43ed2 61 //#define USE_OPCACHE
earlz 0:dac6a7d43ed2 62
earlz 0:dac6a7d43ed2 63 //Use this to specify that string "plain text" error messages are populated as well as an error code when something goes wrong
earlz 0:dac6a7d43ed2 64 #define INCLUDE_ERROR_MESSAGES
earlz 0:dac6a7d43ed2 65
earlz 0:dac6a7d43ed2 66 //Specifies IP should be validated to be within our memory block.
earlz 0:dac6a7d43ed2 67 //This makes the VM "safer", but also slower
earlz 0:dac6a7d43ed2 68 //#define VALIDATE_IP_WITHIN_MEMORY
earlz 0:dac6a7d43ed2 69
earlz 0:dac6a7d43ed2 70 #endif
earlz 0:dac6a7d43ed2 71