Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\kexec_core.c Create Date:2022-07-28 11:03:09
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:crash_shrink_memory

Proto:int crash_shrink_memory(unsigned long new_size)

Type:int

Parameter:

TypeParameterName
unsigned longnew_size
1008  ret = 0
1013  mutex_lock( & kexec_mutex)
1015  If kexec_crash_image Then
1016  ret = -ENOENT
1017  Go to unlock
1019  start = start
1020  end = end
1021  old_size = If end == 0 Then 0 Else end - start + 1
1022  If new_size >= old_size Then
1023  ret = If new_size == old_size Then 0 Else -EINVAL
1024  Go to unlock
1027  ram_res = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
1028  If Not ram_res Then
1029  ret = -ENOMEM
1030  Go to unlock
1033  start = undup - round up to the next specified multiple*@x: the value to up*@y: multiple to round up to* Rounds @x up to next multiple of @y. If @y will always be a power* of 2, consider using the faster round_up().(start, KEXEC_CRASH_MEM_ALIGN)
1034  end = undup - round up to the next specified multiple*@x: the value to up*@y: multiple to round up to* Rounds @x up to next multiple of @y. If @y will always be a power* of 2, consider using the faster round_up().(start + new_size, KEXEC_CRASH_MEM_ALIGN)
1036  crash_free_reserved_phys_range(end, end)
1038  If ((start == end) && (parent != NULL)) Then lease_resource - release a previously reserved resource*@old: resource pointer
1041  start = end
1042  end = end
1043  flags = Driver has marked this resource busy | I/O resource extended types
1044  name = "System RAM"
1046  end = end - 1
1048  sert_resource - Inserts a resource in the resource tree*@parent: parent of the new resource*@new: new resource to insert* Returns 0 on success, -EBUSY if the resource can't be inserted
1050  unlock :
1051  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1052  Return ret
Caller
NameDescribe
kexec_crash_size_store