Last change
on this file since 242 was
228,
checked in by meunier, 12 years ago
|
Added support for memspaces and const.
Added an interrupt masking to the "giet_context_switch" syscall
Corrected two bugs in boot/boot_init.c (one minor and one regarding barriers initialization)
Reformatted the code in all files.
|
File size:
1.3 KB
|
Line | |
---|
1 | |
---|
2 | #include "srl_private_types.h" |
---|
3 | |
---|
4 | |
---|
5 | //////////////////////////////////////////////////////////////////////////////////////// |
---|
6 | // mempcy() |
---|
7 | // GCC requires this function. Taken from MutekH. |
---|
8 | //////////////////////////////////////////////////////////////////////////////////////// |
---|
9 | void * memcpy(void *_dst, const void * _src, unsigned int size) { |
---|
10 | unsigned int * dst = _dst; |
---|
11 | const unsigned int * src = _src; |
---|
12 | if (!((unsigned int) dst & 3) && !((unsigned int) src & 3) ) |
---|
13 | while (size > 3) { |
---|
14 | *dst++ = *src++; |
---|
15 | size -= 4; |
---|
16 | } |
---|
17 | |
---|
18 | unsigned char *cdst = (unsigned char*)dst; |
---|
19 | unsigned char *csrc = (unsigned char*)src; |
---|
20 | |
---|
21 | while (size--) { |
---|
22 | *cdst++ = *csrc++; |
---|
23 | } |
---|
24 | return _dst; |
---|
25 | } |
---|
26 | |
---|
27 | |
---|
28 | //////////////////////////////////////////////////////////////////////////////////////// |
---|
29 | // mempcy() |
---|
30 | // GCC requires this function. Taken from MutekH. |
---|
31 | //////////////////////////////////////////////////////////////////////////////////////// |
---|
32 | inline void * memset(void * dst, int s, size_t count) { |
---|
33 | char * a = (char *) dst; |
---|
34 | while (count--){ |
---|
35 | *a++ = (char)s; |
---|
36 | } |
---|
37 | return dst; |
---|
38 | } |
---|
39 | |
---|
40 | |
---|
41 | // Local Variables: |
---|
42 | // tab-width: 4 |
---|
43 | // c-basic-offset: 4 |
---|
44 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
45 | // indent-tabs-mode: nil |
---|
46 | // End: |
---|
47 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
48 | |
---|
Note: See
TracBrowser
for help on using the repository browser.