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+
2+The following copyright notice covers the contents of this
3+directory, sub-directories, and files contents:
4+
5+Inferno® Copyright © 1996-1999 Lucent Technologies Inc. All rights reserved.
6+Inferno revisions Copyright © 1997-1999 Vita Nuova Limited. All rights reserved.
7+Inferno revisions Copyright © 2000-2015 Vita Nuova Holdings Limited. All rights reserved.
8+Inferno new material Copyright © 2000-2015 Vita Nuova Holdings Limited. All rights reserved.
9+
10+Inferno, Styx, Dis and Limbo are registered trademarks of Vita Nuova Holdings Limited in the USA and other countries.
11+Plan 9 is a registered trademark of Lucent Technologies Inc.
12+
13+This program is free software; you can redistribute it and/or modify
14+it under the terms of the GNU General Public License (`GPL') as published by
15+the Free Software Foundation; either version 2 of the License, or
16+(at your option) any later version.
17+
18+This program is distributed in the hope that it will be useful,
19+but WITHOUT ANY WARRANTY; without even the implied warranty of
20+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+GNU General Public License for more details.
22+
23+You should have received a copy of the GNU General Public License
24+along with this program; if not, write to the Free Software
25+Foundation, 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
3737 | `[PERF]` | Potential for performance improvement. |
3838 | `[PAL]` | Work that should be done in a platform abstraction layer (PAL). |
3939
40+See `readme.md` or `license.txt` in source directories for further details or specific licensing.
41+
4042 # References
4143
4244 Dis 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
4749
4850 # Licenses
4951
52+See source directory for a `license.txt` that defines the license, otherwise licenses for the DisVM project are defined below.
53+
5054 ### [RFC1321](https://www.ietf.org/rfc/rfc1321.txt) ###
5155
5256 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
8084
8185 THE 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.
8286
87+### Unless otherwise stated in a `license.txt` or above - [MIT License](https://opensource.org/licenses/MIT) ###
88+
89+Copyright (c) 2017 ARR
90+
91+Permission is hereby granted, free of charge, to any person obtaining a copy
92+of this software and associated documentation files (the "Software"), to deal
93+in the Software without restriction, including without limitation the rights
94+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
95+copies of the Software, and to permit persons to whom the Software is
96+furnished to do so, subject to the following conditions:
97+
98+The above copyright notice and this permission notice shall be included in all
99+copies or substantial portions of the Software.
100+
101+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
102+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
103+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
104+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
105+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
106+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
107+SOFTWARE.
src/exec/readme.md+16−0
@@ -0,0 +1,16 @@
1+disvm-exec
2+========================
3+
4+Represents a command line example of using the DisVM. The resulting executable contains a
5+debugger with support loading to limbo symbol files (`.sbl`). The `disvm-exe` executable
6+expects the supplied module to implement the `Exec` contract defined in `limbo/Exec.m`.
7+
8+Use the `-h` flag for details on how to use `disvm-exec`.
9+
10+## Examples
11+
12+Compile `md5sum.b` limbo file and emit symbol file:
13+ `disvm-exec -q limbo.dis -g md5sum.b`
14+
15+Debug 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
1010 #define DISVM_VERSION_MAJOR 1
1111 #define DISVM_VERSION_MINOR 0
1212 #define DISVM_VERSION_PATCH 0
13−#define DISVM_VERSION_LABEL "alpha"
13+#define DISVM_VERSION_LABEL "beta"
1414
1515 #endif // _DISVM_SRC_INCLUDE_VM_VERSION_H_
src/vm/execution_table.cpp+1−1
@@ -679,7 +679,7 @@ namespace · 678 unmodified lines
679679 break;
680680 }
681681
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());
683683 r.next_pc = target_pc;
684684 }
685685
src/vm/math/Mathmod.cpp+2−2
@@ -598,7 +598,7 @@ Math_realbits32(vm_registers_t &r, vm_t &vm) · 597 unmodified lines
598598 auto &fp = r.stack.peek_frame()->base<F_Math_realbits32>();
599599
600600 auto x = static_cast<float>(fp.x);
601− uint32_t t;
601+ word_t t;
602602 std::memcpy(&t, &x, sizeof(x));
603603
604604 *fp.ret = t;
@@ -610,7 +610,7 @@ Math_realbits64(vm_registers_t &r, vm_t &vm) · 5 unmodified lines
610610 auto &fp = r.stack.peek_frame()->base<F_Math_realbits64>();
611611
612612 auto x = fp.x;
613− uint64_t t;
613+ big_t t;
614614 std::memcpy(&t, &x, sizeof(x));
615615 static_assert(sizeof(t) == sizeof(x), "Real should be 64-bits");
616616
src/vm/sys/print.cpp+4−4
@@ -84,12 +84,12 @@ word_t disvm::runtime::sys::printf_to_buffer( · 83 unmodified lines
8484 case '*': // Placeholder for word argument
8585 {
8686 const auto w = *reinterpret_cast<word_t *>(msg_args);
87− std::array<char, sizeof("-2147483648")> buffer;
88− const auto len = std::sprintf(buffer.data(), "%d", w);
87+ std::array<char, sizeof("-2147483648")> local_buffer;
88+ const auto len = std::sprintf(local_buffer.data(), "%d", w);
8989 if (len < 0)
9090 return -1;
9191
92− format.insert(std::end(format), buffer.data(), buffer.data() + len);
92+ format.insert(std::end(format), local_buffer.data(), local_buffer.data() + len);
9393 msg_args += sizeof(w);
9494 continue;
9595 }
@@ -172,7 +172,7 @@ word_t disvm::runtime::sys::printf_to_buffer( · 76 unmodified lines
172172 type_alloc = alloc->alloc_type.get();
173173 }
174174
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));
176176 msg_args += sizeof(p);
177177 break;
178178 }
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
9595 curr++;
9696 state = utf8::decode_step(state, codepoint, c);
9797 if (state == utf8::decode_state_t::accept)
98− return (curr - begin);
98+ return static_cast<std::size_t>(curr - begin);
9999 }
100100
101101 // Empty string