mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-26 14:14:01 +08:00
d2fb8b4151
This patch modifies util/string.[ch] to add new function: perf_atoll() to parse string representing size in bytes. This function parses (\d+)(b|B|kb|KB|mb|MB|gb|GB) (e.g. "256MB") and returns its numeric value. (e.g. 268435456) Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <1258285013-4759-1-git-send-email-mitake@dcl.info.waseda.ac.jp> Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 lines
264 B
C
14 lines
264 B
C
#ifndef __PERF_STRING_H_
|
|
#define __PERF_STRING_H_
|
|
|
|
#include "types.h"
|
|
|
|
int hex2u64(const char *ptr, u64 *val);
|
|
char *strxfrchar(char *s, char from, char to);
|
|
s64 perf_atoll(const char *str);
|
|
|
|
#define _STR(x) #x
|
|
#define STR(x) _STR(x)
|
|
|
|
#endif /* __PERF_STRING_H */
|