[ccan] [PATCH] cpuid: new module
Rusty Russell
rusty at rustcorp.com.au
Fri Sep 27 13:53:40 EST 2013
Ahmed Samy <f.fallen45 at gmail.com> writes:
> Hi Rusty,
> On Thu, Sep 26, 2013 at 4:12 AM, Rusty Russell <rusty at rustcorp.com.au>wrote:
>>
>> Whatever is easiest for you...
>
> Both are fine... Any reason why haven't you applied the patches?
>
> Anyway, here's a tree with the changes:
> https://github.com/decltype/ccan.git cpuid
Thanks, it doesn't pass ccanlint here though. See patch below, which
fixed it for me; feel free to apply or just ack and I will (I
generally don't touch others' modules unless there's some sweeping
change I need to make).
Please send your ssh key, so you can push straight to the ccan
repository.
Cheers,
Rusty.
diff --git a/ccan/cpuid/BSD-MIT b/ccan/cpuid/BSD-MIT
deleted file mode 120000
index 2354d12..0000000
--- a/ccan/cpuid/BSD-MIT
+++ /dev/null
@@ -1 +0,0 @@
-../../licenses/BSD-MIT
\ No newline at end of file
diff --git a/ccan/cpuid/LICENSE b/ccan/cpuid/LICENSE
new file mode 120000
index 0000000..2354d12
--- /dev/null
+++ b/ccan/cpuid/LICENSE
@@ -0,0 +1 @@
+../../licenses/BSD-MIT
\ No newline at end of file
diff --git a/ccan/cpuid/_info b/ccan/cpuid/_info
index 1603b4b..569dc21 100644
--- a/ccan/cpuid/_info
+++ b/ccan/cpuid/_info
@@ -8,10 +8,11 @@
*
* Example:
* #include <ccan/cpuid/cpuid.h>
+ * #include <stdio.h>
*
- * int main()
+ * int main(void)
* {
- * int highest;
+ * uint32_t highest;
* cpuid(CPU_HIGHEST_EXTENDED_FUNCTION_SUPPORTED, &highest);
* printf ("Highest extended function supported: %d\n", highest);
*
diff --git a/ccan/cpuid/cpuid.h b/ccan/cpuid/cpuid.h
index 305d69a..0a9fc9d 100644
--- a/ccan/cpuid/cpuid.h
+++ b/ccan/cpuid/cpuid.h
@@ -69,7 +69,7 @@ typedef enum cpuid {
CPU_HIGHEST_EXTENDED_FUNCTION_SUPPORTED = 0x80000000,
CPU_EXTENDED_PROC_INFO_FEATURE_BITS = 0x80000001,
- CPU_PROC_BRAND_STRING = 0x80000002,
+ CPU_PROC_BRAND_STRING = 0x80000002,
CPU_L1_CACHE_AND_TLB_IDS = 0x80000005,
CPU_EXTENDED_L2_CACHE_FEATURES = 0x80000006,
CPU_ADV_POWER_MGT_INFO = 0x80000007,
diff --git a/ccan/cpuid/test/run.c b/ccan/cpuid/test/run.c
index c96f3ab..c77fd25 100644
--- a/ccan/cpuid/test/run.c
+++ b/ccan/cpuid/test/run.c
@@ -1,9 +1,9 @@
-#include "cpuid.h"
+#include "../cpuid.c"
#include <stdio.h>
#include <stdint.h>
-int main()
+int main(void)
{
if (!cpuid_is_supported()) {
printf ("CPUID instruction is not supported by this CPU\n");
More information about the ccan
mailing list