iPXE
Functions
mlx_utils_priv.c File Reference
#include <unistd.h>
#include <stdlib.h>
#include <strings.h>
#include "../../mlx_utils/include/private/mlx_utils_priv.h"

Go to the source code of this file.

Functions

mlx_status mlx_utils_delay_in_ms_priv (IN mlx_uint32 msecs)
 
mlx_status mlx_utils_delay_in_us_priv (IN mlx_uint32 usecs)
 
mlx_status mlx_utils_ilog2_priv (IN mlx_uint32 i, OUT mlx_uint32 *log)
 
mlx_status mlx_utils_init_lock_priv (OUT void **lock __attribute__((unused)))
 
mlx_status mlx_utils_free_lock_priv (IN void *lock __attribute__((unused)))
 
mlx_status mlx_utils_acquire_lock_priv (IN void *lock __attribute__((unused)))
 
mlx_status mlx_utils_release_lock_priv (IN void *lock __attribute__((unused)))
 
mlx_status mlx_utils_rand_priv (IN mlx_utils *utils __attribute__((unused)), OUT mlx_uint32 *rand_num)
 

Function Documentation

◆ mlx_utils_delay_in_ms_priv()

mlx_status mlx_utils_delay_in_ms_priv ( IN mlx_uint32  msecs)

Definition at line 14 of file mlx_utils_priv.c.

17 {
18  mdelay(msecs);
19  return MLX_SUCCESS;
20 }
#define MLX_SUCCESS
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition: timer.c:78

References mdelay(), and MLX_SUCCESS.

Referenced by mlx_utils_delay_in_ms().

◆ mlx_utils_delay_in_us_priv()

mlx_status mlx_utils_delay_in_us_priv ( IN mlx_uint32  usecs)

Definition at line 23 of file mlx_utils_priv.c.

26 {
27  udelay(usecs);
28  return MLX_SUCCESS;
29 }
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:60
#define MLX_SUCCESS

References MLX_SUCCESS, and udelay().

Referenced by mlx_utils_delay_in_us().

◆ mlx_utils_ilog2_priv()

mlx_status mlx_utils_ilog2_priv ( IN mlx_uint32  i,
OUT mlx_uint32 log 
)

Definition at line 32 of file mlx_utils_priv.c.

36 {
37  *log = ( fls ( i ) - 1 );
38  return MLX_SUCCESS;
39 }
#define MLX_SUCCESS
#define fls(x)
Find last (i.e.
Definition: strings.h:166

References fls, and MLX_SUCCESS.

Referenced by mlx_utils_ilog2().

◆ mlx_utils_init_lock_priv()

mlx_status mlx_utils_init_lock_priv ( OUT void **lock   __attribute__(unused))

Definition at line 42 of file mlx_utils_priv.c.

45 {
46  return MLX_SUCCESS;
47 }
#define MLX_SUCCESS

References MLX_SUCCESS.

◆ mlx_utils_free_lock_priv()

mlx_status mlx_utils_free_lock_priv ( IN void *lock   __attribute__(unused))

Definition at line 50 of file mlx_utils_priv.c.

53 {
54  return MLX_SUCCESS;
55 }
#define MLX_SUCCESS

References MLX_SUCCESS.

◆ mlx_utils_acquire_lock_priv()

mlx_status mlx_utils_acquire_lock_priv ( IN void *lock   __attribute__(unused))

Definition at line 58 of file mlx_utils_priv.c.

61 {
62  return MLX_SUCCESS;
63 }
#define MLX_SUCCESS

References MLX_SUCCESS.

◆ mlx_utils_release_lock_priv()

mlx_status mlx_utils_release_lock_priv ( IN void *lock   __attribute__(unused))

Definition at line 66 of file mlx_utils_priv.c.

69 {
70  return MLX_SUCCESS;
71 }
#define MLX_SUCCESS

References MLX_SUCCESS.

◆ mlx_utils_rand_priv()

mlx_status mlx_utils_rand_priv ( IN mlx_utils *utils   __attribute__(unused),
OUT mlx_uint32 rand_num 
)

Definition at line 74 of file mlx_utils_priv.c.

78 {
79  do {
80  *rand_num = rand();
81  } while ( *rand_num == 0 );
82  return MLX_SUCCESS;
83 }
static int rand(void)
Definition: stdlib.h:59
#define MLX_SUCCESS

References MLX_SUCCESS, and rand().