| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 The Native Client Authors. All rights reserved. | 2 * Copyright 2010 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
| 4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #include <stdarg.h> | 7 #include <stdarg.h> |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 bool Suspend() { return true; } | 92 bool Suspend() { return true; } |
| 93 bool Resume() { return true; } | 93 bool Resume() { return true; } |
| 94 | 94 |
| 95 virtual void *GetContext() { return ctx_; } | 95 virtual void *GetContext() { return ctx_; } |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 uint8_t *ctx_; | 98 uint8_t *ctx_; |
| 99 uint32_t id_; | 99 uint32_t id_; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 IThread* IThread::Acquire(uint32_t id, bool create) { | 102 IThread* IThread::Create(uint32_t id, struct NaClAppThread *) { |
| 103 if (create) return new ThreadMock(id); | 103 return new ThreadMock(id); |
| 104 return NULL; | |
| 105 } | 104 } |
| 106 | 105 |
| 107 | 106 |
| 108 bool port::IPlatform::GetMemory(uint64_t addr, uint32_t len, void *dst) { | 107 bool port::IPlatform::GetMemory(uint64_t addr, uint32_t len, void *dst) { |
| 109 intptr_t iptr = static_cast<intptr_t>(addr); | 108 intptr_t iptr = static_cast<intptr_t>(addr); |
| 110 void *src = reinterpret_cast<void*>(iptr); | 109 void *src = reinterpret_cast<void*>(iptr); |
| 111 memcpy(dst, src, len); | 110 memcpy(dst, src, len); |
| 112 return true; | 111 return true; |
| 113 } | 112 } |
| 114 | 113 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 143 printf("Testing Host.\n"); | 142 printf("Testing Host.\n"); |
| 144 errs += TestHost(); | 143 errs += TestHost(); |
| 145 | 144 |
| 146 printf("Testing Target.\n"); | 145 printf("Testing Target.\n"); |
| 147 errs += TestTarget(); | 146 errs += TestTarget(); |
| 148 | 147 |
| 149 if (errs) printf("FAILED with %d errors.\n", errs); | 148 if (errs) printf("FAILED with %d errors.\n", errs); |
| 150 return errs; | 149 return errs; |
| 151 } | 150 } |
| 152 | 151 |
| OLD | NEW |