Commit 588c19e
Fix memcpy alignment problems for m68k architecture
1. On CPUs that do not support misaligned access (MISALIGNED_OK=0), such
as the 68000, memcpy() does not correctly copy regions larger than 64
KB when the destination is not long-word aligned.
2. The 68020 supports misaligned access, but this is not currently
implemented.
3. The 68000 can access long-word data at even addresses, but alignment
is checked as if the address must be a multiple of 4.
4. Because the loop count is checked using signed comparison, memcpy()
fails for data sizes larger than 2 GB.
This patch fixes these issues.1 parent 2a953c1 commit 588c19e
1 file changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
107 | 111 | | |
108 | 112 | | |
109 | | - | |
| 113 | + | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
0 commit comments