Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mpi_read_raw_data - Read a raw byte stream as a positive integer*@xbuffer: The data to read*@nbytes: The amount of data to read

Proto:MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes)

Type:MPI

Parameter:

TypeParameterName
const void *xbuffer
size_tnbytes
37  buffer = xbuffer
41  MPI val = NULL
43  When nbytes > 0 && buffer[0] == 0 cycle
44  buffer++
45  nbytes--
48  nbits = nbytes * 8
49  If nbits > MAX_EXTERN_MPI_BITS Then
50  pr_info("MPI: mpi too large (%u bits)\n", nbits)
51  Return NULL
53  If nbytes > 0 Then nbits -= _leading_zeros - Count the number of zeros from the MSB back*@x: The value* Count the number of leading zeros from the MSB going towards the LSB in @x.* If the MSB of @x is set, the result is 0. - BITS_PER_LONG - 8
56  nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB)
57  val = -- mpiutil.c --
58  If Not val Then Return NULL
60  the real number of valid bits (info only) = nbits
61  indicates a negative number = 0
62  number of valid limbs = nlimbs
64  If nbytes > 0 Then
65  i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB
66  i %= BYTES_PER_MPI_LIMB
67  When j > 0 cycle
68  a = 0
69  When i < BYTES_PER_MPI_LIMB cycle
70  a <<= 8
71  a |= buffer++
73  i = 0
77  Return val
Caller
NameDescribe
mpi_read_from_buffer