auto set allocator (#285)

* hi3516ev300: auto set allocator

* revert changes in the building script
pull/301/head
cronyx 2022-07-28 14:29:48 +03:00 committed by GitHub
parent 242e2583f9
commit ada7762f69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -70,8 +70,21 @@ report_error()
exit 1
}
check_allocator() {
allocator=$(grep mmz_allocator /proc/cmdline)
if [ -z "${allocator}" ]; then
if [ ${mem_total} -ge 128 ]; then
set_allocator cma
else
set_allocator hisi
fi
fi
}
insert_osal()
{
check_allocator
MMZ=$(awk -F '=' '$1=="mmz"{print $2}' RS=" " /proc/cmdline)
if [ -z "$MMZ" ]; then
insmod hi_osal.ko anony=1 mmz_allocator=hisi mmz=anonymous,0,$mmz_start,$mmz_size || report_error