Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mpi_write_to_sgl() - Funnction exports MPI to an sgl (msb first)* This function works in the same way as the mpi_read_buffer, but it* takes an sgl instead of u8 * buf.*@a: a multi precision integer*@sgl: scatterlist to write to. Needs to be at least

Proto:int mpi_write_to_sgl(MPI a, struct scatterlist *sgl, unsigned nbytes, int *sign)

Type:int

Parameter:

TypeParameterName
MPIa
struct scatterlist *sgl
unsignednbytes
int *sign
258  n = mpi_get_size() - returns max size required to store the number*@a: A multi precision integer for which we want to allocate a bufer* Return: size required to store the number
263  If sign Then sign = indicates a negative number
266  If nbytes < n Then Return -EOVERFLOW
269  nents = sg_nents_for_len - return total count of entries in scatterlist* needed to satisfy the supplied length*@sg: The scatterlist*@len: The total required length* Description:* Determines the number of entries in sg that are required to meet* the supplied
270  If nents < 0 Then Return -EINVAL
273  sg_miter_start - start mapping iteration over a sg list*@miter: sg mapping iter to be started*@sgl: sg list to iterate over*@nents: number of sg entries* Description:* Starts mapping iterator @miter.* Context:* Don't care.
274  sg_miter_next - proceed mapping iterator to the next mapping*@miter: sg mapping iter to proceed* Description:* Proceeds @miter to the next mapping. @miter should have been started* using sg_miter_start(). On successful return, @miter->page,
275  buf_len = length of the mapped area
276  p2 = pointer to the mapped area
278  When nbytes > n cycle
279  i = min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(unsigned, nbytes - n, buf_len)
280  memset(p2, 0, i)
281  p2 += i
282  nbytes -= i
284  buf_len -= i
285  If Not buf_len Then
292  When i >= 0 cycle
294  alimb = If array with the limbs [i] Then cpu_to_be32( array with the limbs [i]) Else 0
300  p = (u8 * ) & alimb
302  When x < size of alimb cycle
303  p2++ = p++
304  If Not --buf_len Then
312  sg_miter_stop - stop mapping iteration*@miter: sg mapping iter to be stopped* Description:* Stops mapping iterator @miter. @miter should have been started* using sg_miter_start(). A stopped iteration can be resumed by* calling sg_miter_next() on it
313  Return 0