We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8881288 + 9276df2 commit d17aceaCopy full SHA for d17acea
src/kernel/kmalloc.asm
@@ -7,6 +7,7 @@ bits 32
7
section .text
8
9
extern memmove
10
+extern clamp
11
12
global kmalloc
13
global kset
@@ -87,6 +88,29 @@ push EDI
87
88
add EAX, [EBP+12]
89
sub EAX, 1 ;Calculating where the last byte of the desired reservation is, by adding size to offset and subtracting 1
90
91
+ mov EBX, [offset]
92
+ add EBX, [size]
93
+ sub EBX, 1
94
+
95
+ push EBX
96
+ mov ECX, [offset]
97
+ push ECX
98
+ push EAX
99
+ call clamp
100
+ add ESP, 12
101
102
103
104
105
106
107
+ push DWORD [EBP+8]
108
109
110
+ mov [EBP+8], EAX
111
112
+ pop EAX
113
114
sub EAX, [offset]
115
mov EDX, 0
116
mov EBX, KMALLOC_BLOCK_SIZE
0 commit comments