History

Merged in release_mgmt (pull request #14)

Making repo public * Add licensing details for limbo directory Create readme.md for disvm-exec project Fix code analysis violations/warnings * Update version to 'beta' - public release

Aaron R Robinson committed 9 years ago

Commit 68d4d691 parent 887c99f8 files · +75 −9Browse files

Unified · Split

8 files
  1. limbo/license.txt +25 −0
  2. readme.md +25 −0
  3. src/exec/readme.md +16 −0
  4. src/include/vm_version.h +1 −1
  5. src/vm/execution_table.cpp +1 −1
  6. src/vm/math/Mathmod.cpp +2 −2
  7. src/vm/sys/print.cpp +4 −4
  8. src/vm/utf8.cpp +1 −1
limbo/license.txt+25−0
@@ -0,0 +1,25 @@
1
2The following copyright notice covers the contents of this
3directory, sub-directories, and files contents:
4
5Inferno® Copyright © 1996-1999 Lucent Technologies Inc. All rights reserved.
6Inferno revisions Copyright © 1997-1999 Vita Nuova Limited. All rights reserved.
7Inferno revisions Copyright © 2000-2015 Vita Nuova Holdings Limited. All rights reserved.
8Inferno new material Copyright © 2000-2015 Vita Nuova Holdings Limited. All rights reserved.
9
10Inferno, Styx, Dis and Limbo are registered trademarks of Vita Nuova Holdings Limited in the USA and other countries.
11Plan 9 is a registered trademark of Lucent Technologies Inc.
12
13This program is free software; you can redistribute it and/or modify
14it under the terms of the GNU General Public License (`GPL') as published by
15the Free Software Foundation; either version 2 of the License, or
16(at your option) any later version.
17
18This program is distributed in the hope that it will be useful,
19but WITHOUT ANY WARRANTY; without even the implied warranty of
20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21GNU General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with this program; if not, write to the Free Software
25Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
readme.md+25−0
@@ -37,6 +37,8 @@ The source tree is as follows: · 36 unmodified lines
37| `[PERF]` | Potential for performance improvement. |37| `[PERF]` | Potential for performance improvement. |
38| `[PAL]` | Work that should be done in a platform abstraction layer (PAL). |38| `[PAL]` | Work that should be done in a platform abstraction layer (PAL). |
39 39
40See `readme.md` or `license.txt` in source directories for further details or specific licensing.
41
40# References42# References
41 43
42Dis VM specification: http://www.vitanuova.com/inferno/papers/dis.html44Dis VM specification: http://www.vitanuova.com/inferno/papers/dis.html
@@ -47,6 +49,8 @@ Inferno OS - Original Dis VM implementation: https://bitbucket.org/inferno-os/in · 4 unmodified lines
47 49
48# Licenses50# Licenses
49 51
52See source directory for a `license.txt` that defines the license, otherwise licenses for the DisVM project are defined below.
53
50### [RFC1321](https://www.ietf.org/rfc/rfc1321.txt) ###54### [RFC1321](https://www.ietf.org/rfc/rfc1321.txt) ###
51 55
52 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All56 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
@@ -80,3 +84,24 @@ The above copyright notice and this permission notice shall be included in all c · 27 unmodified lines
80 84
81THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.85THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
82 86
87### Unless otherwise stated in a `license.txt` or above - [MIT License](https://opensource.org/licenses/MIT) ###
88
89Copyright (c) 2017 ARR
90
91Permission is hereby granted, free of charge, to any person obtaining a copy
92of this software and associated documentation files (the "Software"), to deal
93in the Software without restriction, including without limitation the rights
94to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
95copies of the Software, and to permit persons to whom the Software is
96furnished to do so, subject to the following conditions:
97
98The above copyright notice and this permission notice shall be included in all
99copies or substantial portions of the Software.
100
101THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
102IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
103FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
104AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
105LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
106OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
107SOFTWARE.
src/exec/readme.md+16−0
@@ -0,0 +1,16 @@
1disvm-exec
2========================
3
4Represents a command line example of using the DisVM. The resulting executable contains a
5debugger with support loading to limbo symbol files (`.sbl`). The `disvm-exe` executable
6expects the supplied module to implement the `Exec` contract defined in `limbo/Exec.m`.
7
8Use the `-h` flag for details on how to use `disvm-exec`.
9
10## Examples
11
12Compile `md5sum.b` limbo file and emit symbol file:
13 `disvm-exec -q limbo.dis -g md5sum.b`
14
15Debug the compiled `md5sum.dis` module:
16 `disvm-exec -de md5sum.dis md5sum.b`
src/include/vm_version.h+1−1
@@ -10,6 +10,6 @@ · 9 unmodified lines
10#define DISVM_VERSION_MAJOR 110#define DISVM_VERSION_MAJOR 1
11#define DISVM_VERSION_MINOR 011#define DISVM_VERSION_MINOR 0
12#define DISVM_VERSION_PATCH 012#define DISVM_VERSION_PATCH 0
13#define DISVM_VERSION_LABEL "alpha"13#define DISVM_VERSION_LABEL "beta"
14 14
15#endif // _DISVM_SRC_INCLUDE_VM_VERSION_H_15#endif // _DISVM_SRC_INCLUDE_VM_VERSION_H_
src/vm/execution_table.cpp+1−1
@@ -679,7 +679,7 @@ namespace · 678 unmodified lines
679 break;679 break;
680 }680 }
681 681
682 assert(0 <= static_cast<std::size_t>(target_pc) && static_cast<std::size_t>(target_pc) < r.module_ref->code_section.size());682 assert(0 <= target_pc && static_cast<std::size_t>(target_pc) < r.module_ref->code_section.size());
683 r.next_pc = target_pc;683 r.next_pc = target_pc;
684 }684 }
685 685
src/vm/math/Mathmod.cpp+2−2
@@ -598,7 +598,7 @@ Math_realbits32(vm_registers_t &r, vm_t &vm) · 597 unmodified lines
598 auto &fp = r.stack.peek_frame()->base<F_Math_realbits32>();598 auto &fp = r.stack.peek_frame()->base<F_Math_realbits32>();
599 599
600 auto x = static_cast<float>(fp.x);600 auto x = static_cast<float>(fp.x);
601 uint32_t t;601 word_t t;
602 std::memcpy(&t, &x, sizeof(x));602 std::memcpy(&t, &x, sizeof(x));
603 603
604 *fp.ret = t;604 *fp.ret = t;
@@ -610,7 +610,7 @@ Math_realbits64(vm_registers_t &r, vm_t &vm) · 5 unmodified lines
610 auto &fp = r.stack.peek_frame()->base<F_Math_realbits64>();610 auto &fp = r.stack.peek_frame()->base<F_Math_realbits64>();
611 611
612 auto x = fp.x;612 auto x = fp.x;
613 uint64_t t;613 big_t t;
614 std::memcpy(&t, &x, sizeof(x));614 std::memcpy(&t, &x, sizeof(x));
615 static_assert(sizeof(t) == sizeof(x), "Real should be 64-bits");615 static_assert(sizeof(t) == sizeof(x), "Real should be 64-bits");
616 616
src/vm/sys/print.cpp+4−4
@@ -84,12 +84,12 @@ word_t disvm::runtime::sys::printf_to_buffer( · 83 unmodified lines
84 case '*': // Placeholder for word argument84 case '*': // Placeholder for word argument
85 {85 {
86 const auto w = *reinterpret_cast<word_t *>(msg_args);86 const auto w = *reinterpret_cast<word_t *>(msg_args);
87 std::array<char, sizeof("-2147483648")> buffer;87 std::array<char, sizeof("-2147483648")> local_buffer;
88 const auto len = std::sprintf(buffer.data(), "%d", w);88 const auto len = std::sprintf(local_buffer.data(), "%d", w);
89 if (len < 0)89 if (len < 0)
90 return -1;90 return -1;
91 91
92 format.insert(std::end(format), buffer.data(), buffer.data() + len);92 format.insert(std::end(format), local_buffer.data(), local_buffer.data() + len);
93 msg_args += sizeof(w);93 msg_args += sizeof(w);
94 continue;94 continue;
95 }95 }
@@ -172,7 +172,7 @@ word_t disvm::runtime::sys::printf_to_buffer( · 76 unmodified lines
172 type_alloc = alloc->alloc_type.get();172 type_alloc = alloc->alloc_type.get();
173 }173 }
174 174
175 wb = std::snprintf(b_curr, (b_end - b_curr), "%" PRIuPTR ".%#08" PRIxPTR, rc, reinterpret_cast<std::size_t>(type_alloc));175 wb = std::snprintf(b_curr, (b_end - b_curr), "%" PRIuPTR ".%#08" PRIxPTR, static_cast<std::uintptr_t>(rc), reinterpret_cast<std::uintptr_t>(type_alloc));
176 msg_args += sizeof(p);176 msg_args += sizeof(p);
177 break;177 break;
178 }178 }
src/vm/utf8.cpp+1−1
@@ -95,7 +95,7 @@ std::size_t disvm::runtime::utf8::decode(const uint8_t *str, rune_t &codepoint) · 94 unmodified lines
95 curr++;95 curr++;
96 state = utf8::decode_step(state, codepoint, c);96 state = utf8::decode_step(state, codepoint, c);
97 if (state == utf8::decode_state_t::accept)97 if (state == utf8::decode_state_t::accept)
98 return (curr - begin);98 return static_cast<std::size_t>(curr - begin);
99 }99 }
100 100
101 // Empty string101 // Empty string