Go to the source code of this file.
|
| #define | uacpi_memcpy memcpy |
| |
| #define | uacpi_memmove memmove |
| |
| #define | uacpi_memset memset |
| |
| #define | uacpi_memcmp memcmp |
| |
| #define | uacpi_free(mem, _) uacpi_kernel_free(mem) |
| |
| #define | uacpi_memzero(ptr, size) uacpi_memset(ptr, 0, size) |
| |
| #define | UACPI_COMPARE(x, y, op) ((x) op (y) ? (x) : (y)) |
| |
| #define | UACPI_MIN(x, y) UACPI_COMPARE(x, y, <) |
| |
| #define | UACPI_MAX(x, y) UACPI_COMPARE(x, y, >) |
| |
| #define | UACPI_ALIGN_UP_MASK(x, mask) (((x) + (mask)) & ~(mask)) |
| |
| #define | UACPI_ALIGN_UP(x, val, type) UACPI_ALIGN_UP_MASK(x, (type)(val) - 1) |
| |
| #define | UACPI_ALIGN_DOWN_MASK(x, mask) ((x) & ~(mask)) |
| |
| #define | UACPI_ALIGN_DOWN(x, val, type) UACPI_ALIGN_DOWN_MASK(x, (type)(val) - 1) |
| |
| #define | UACPI_IS_ALIGNED_MASK(x, mask) (((x) & (mask)) == 0) |
| |
| #define | UACPI_IS_ALIGNED(x, val, type) UACPI_IS_ALIGNED_MASK(x, (type)(val) - 1) |
| |
| #define | UACPI_IS_POWER_OF_TWO(x, type) UACPI_IS_ALIGNED(x, x, type) |
| |
| #define | uacpi_kernel_alloc_zeroed uacpi_builtin_alloc_zeroed |
| |
|
| void * | memcpy (void *dest, const void *src, uacpi_size count) |
| |
| void * | memmove (void *dest, const void *src, uacpi_size count) |
| |
| void * | memset (void *dest, int ch, uacpi_size count) |
| |
| int | memcmp (const void *lhs, const void *rhs, uacpi_size count) |
| |
| uacpi_size | uacpi_strlen (const uacpi_char *str) |
| |
| uacpi_size | uacpi_strnlen (const uacpi_char *str, uacpi_size max) |
| |
| uacpi_i32 | uacpi_strcmp (const uacpi_char *lhs, const uacpi_char *rhs) |
| |
| uacpi_i32 | uacpi_snprintf (uacpi_char *buffer, uacpi_size capacity, const uacpi_char *fmt,...) |
| |
| uacpi_i32 | uacpi_vsnprintf (uacpi_char *buffer, uacpi_size capacity, const uacpi_char *fmt, uacpi_va_list vlist) |
| |
| void | uacpi_memcpy_zerout (void *dst, const void *src, uacpi_size dst_size, uacpi_size src_size) |
| |
| uacpi_u8 | uacpi_bit_scan_forward (uacpi_u64) |
| |
| uacpi_u8 | uacpi_bit_scan_backward (uacpi_u64) |
| |
| void * | uacpi_builtin_alloc_zeroed (uacpi_size size) |
| |
◆ UACPI_ALIGN_DOWN
◆ UACPI_ALIGN_DOWN_MASK
◆ UACPI_ALIGN_UP
◆ UACPI_ALIGN_UP_MASK
◆ UACPI_COMPARE
◆ uacpi_free
◆ UACPI_IS_ALIGNED
◆ UACPI_IS_ALIGNED_MASK
◆ UACPI_IS_POWER_OF_TWO
◆ uacpi_kernel_alloc_zeroed
◆ UACPI_MAX
◆ uacpi_memcmp
◆ uacpi_memcpy
◆ uacpi_memmove
◆ uacpi_memset
◆ uacpi_memzero
◆ UACPI_MIN
◆ memcmp()
Definition at line 9 of file memcmp.c.
10{
12 const unsigned char *p1 =
s1, *p2 =
s2;
13 do {
14 if (*p1++ != *p2++)
15 return (*--p1 - *--p2);
17 }
18 return 0;
19}
◆ memcpy()
Definition at line 74 of file intrin_x86.h.
75{
77}
#define memmove(s1, s2, n)
◆ memmove()
Definition at line 8 of file memmove.c.
9{
10 char *char_dest = (
char *)
dest;
11 char *char_src = (
char *)
src;
12
13 if ((char_dest <= char_src) || (char_dest >= (char_src+
count)))
14 {
15
17 {
18 *char_dest = *char_src;
19 char_dest++;
20 char_src++;
22 }
23 }
24 else
25 {
26
29
31 {
32 *char_dest = *char_src;
33 char_dest--;
34 char_src--;
36 }
37 }
38
40}
GLuint GLuint GLsizei count
◆ memset()
Definition at line 8 of file memset.c.
9{
10 char *char_src = (
char *)
src;
11
14 char_src++;
16 }
18}
◆ uacpi_bit_scan_backward()
Definition at line 154 of file stdlib.c.
155{
156#if defined(_MSC_VER) && !defined(__clang__)
159
160#ifdef _WIN64
163 return 0;
164
166#else
171 return 0;
172
174 }
175
177#endif
178
179#else
181 return 0;
182
183 return 64 - __builtin_clzll(
value);
184#endif
185}
unsigned char _BitScanReverse(unsigned long *_Index, unsigned long _Mask)
Referenced by gas_get_access_bit_width(), and handle_unary_math().
◆ uacpi_bit_scan_forward()
Definition at line 124 of file stdlib.c.
125{
126#if defined(_MSC_VER) && !defined(__clang__)
129
130#ifdef _WIN64
133 return 0;
134
136#else
141 return 0;
142
144 }
145
147#endif
148
149#else
150 return __builtin_ffsll(
value);
151#endif
152}
unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask)
Referenced by handle_unary_math().
◆ uacpi_builtin_alloc_zeroed()
Definition at line 188 of file stdlib.c.
189{
191
195
198}
#define uacpi_memzero(ptr, size)
void * uacpi_kernel_alloc(uacpi_size size)
◆ uacpi_memcpy_zerout()
Definition at line 112 of file stdlib.c.
114{
116
117 if (bytes_to_copy)
119
120 if (dst_size > bytes_to_copy)
122}
Referenced by buffer_alloc_and_store(), build_table_id(), do_aml_resource_to_native(), do_native_resource_to_aml(), exec_op(), handle_buffer(), handle_ref_or_deref_of(), handle_special_field(), object_assign_with_implicit_cast(), object_to_integer(), uacpi_dispatch_opregion_io(), uacpi_read_field_unit(), uacpi_write_buffer_field(), and write_buffer_index().
◆ uacpi_snprintf()
◆ uacpi_strcmp()
Definition at line 96 of file stdlib.c.
97{
100
101 while (lhs[
i] && rhs[
i]) {
102 if (lhs[
i] != rhs[
i])
103 return *(cucp)&lhs[
i] - *(cucp)&rhs[
i];
104
106 }
107
108 return *(cucp)&lhs[
i] - *(cucp)&rhs[
i];
109}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Referenced by find_interface_unlocked(), matches_any(), and uacpi_uninstall_interface().
◆ uacpi_strlen()
◆ uacpi_strnlen()
◆ uacpi_vsnprintf()
Definition at line 475 of file stdlib.c.
479{
483 .bytes_written = 0
484 };
485
490
494 .base = 10,
495 };
497
498 if (next_offset)
500
501 if (!next_conversion)
502 break;
503
504 fmt = next_conversion;
507 continue;
508 }
509
510
512
515 case '+':
516 case ' ':
519 continue;
520 case '-':
522 continue;
523 case '0':
525 continue;
526 case '#':
528 continue;
529 default:
530 return -1;
531 }
532 }
533
537 return -1;
538 }
539
542
545 } else {
547 return -1;
548 }
549 }
550
552
556 continue;
557 }
558
562
564 string = "<null>";
565
570 continue;
571 }
572
578 goto write_int;
579 }
580
587 } else {
588 return -1;
589 }
590 goto write_int;
591 }
592
599 } else {
600 return -1;
601 }
602 goto write_int;
603 }
604
612 } else {
613 return -1;
614 }
615 goto write_int;
616 }
617
625 } else {
626 return -1;
627 }
628 goto write_int;
629 }
630
636 } else {
637 return -1;
638 }
639
640 write_int:
644 }
645
647 }
648
651
654 }
655
657}
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
static uacpi_bool consume(const uacpi_char **string, const uacpi_char *token)
static void write_many(struct fmt_buf_state *fb_state, const uacpi_char *string, uacpi_size count)
static const uacpi_char * find_next_conversion(const uacpi_char *fmt, uacpi_size *offset)
static uacpi_u32 base_from_specifier(uacpi_char specifier)
@ PARSE_NUMBER_MODE_MAYBE
static uacpi_bool consume_one_of(const uacpi_char **string, const uacpi_char *list, uacpi_char *consumed_char)
static void write_one(struct fmt_buf_state *fb_state, uacpi_char c)
static uacpi_bool parse_number(const uacpi_char **fmt, enum parse_number_mode mode, uacpi_u64 *out_value)
static uacpi_bool is_uppercase_specifier(uacpi_char specifier)
static void write_integer(struct fmt_buf_state *fb_state, struct fmt_spec *fm, uacpi_u64 value)
Referenced by uacpi_log(), and uacpi_snprintf().