Skip to content

Instantly share code, notes, and snippets.

View Oberon00's full-sized avatar

Christian Neumüller Oberon00

View GitHub Profile
@Oberon00
Oberon00 / ambiguousoverload.cpp
Last active December 19, 2015 07:59
C++ overload resolution and partial ordering of function template specializations
#include <iostream>
#include <cstddef>
template <std::size_t N>
void foo(char const (&)[N])
{
std::cout << "foo<" << N << ">(char const (&)["<< N << "])\n";
}
template <typename T>
@Oberon00
Oberon00 / shared_ptr_converter.hpp
Last active December 20, 2015 14:59
Workaround for incorrect `use_count()`s with `shared_ptr_converter`. To be integrated in Oberon00/luabind.
// Copyright Daniel Wallin 2009. Use, modification and distribution is
// subject to the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef LUABIND_SHARED_PTR_CONVERTER_090211_HPP
# define LUABIND_SHARED_PTR_CONVERTER_090211_HPP
# include <luabind/detail/decorate_type.hpp> // for LUABIND_DECORATE_TYPE
# include <luabind/detail/policy.hpp> // for default_converter, etc
# include <luabind/detail/yes_no.hpp>
<6>[ 0.000000] c0 Initializing cgroup subsys cpu
<5>[ 0.000000] c0 Linux version 3.0.64-CM-g526d694-dirty (cn@cn0-m2) (gcc version 4.7 (GCC) ) #3 SMP PREEMPT Mon Sep 8 19:37:02 CEST 2014
<4>[ 0.000000] c0 CPU: ARMv7 Processor [412fc091] revision 1 (ARMv7), cr=10c5387d
<4>[ 0.000000] c0 CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
<4>[ 0.000000] c0 Machine: SMDK4210
<4>[ 0.000000] c0 Memory policy: ECC disabled, Data cache writealloc
<4>[ 0.000000] c0 CPU EXYNOS4210 (id 0x43210211)
<7>[ 0.000000] c0 exynos4_init_clocks: initializing clocks
<6>[ 0.000000] c0 S3C24XX Clocks, Copyright 2004 Simtec Electronics
<3>[ 0.000000] c0 s3c_register_clksrc: clock audiocdclk has no registers set
@Oberon00
Oberon00 / indexed_print_seq.cpp
Created September 20, 2014 10:20
Print arguments with indices (custom lower bound).
#include <iostream>
// Integer sequence adapted from http://stackoverflow.com/a/17426611/2128694
// Just added the lower bound Lo.
template<class T> using Invoke = typename T::type;
template<unsigned...> struct seq{ using type = seq; };
template<class S1, class S2> struct concat;
@Oberon00
Oberon00 / irq.c.patch
Created December 5, 2014 14:42
Failed Exynos "Music Bug" fix attempt.
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -134,18 +134,15 @@ int __init arch_probe_nr_irqs(void)
static bool migrate_one_irq(struct irq_data *d)
{
unsigned int cpu = cpumask_any_and(d->affinity, cpu_online_mask);
- bool ret = false;
- if (cpu >= nr_cpu_ids) {
- cpu = cpumask_any(cpu_online_mask);
@Oberon00
Oberon00 / kernel-configuration.patch
Created December 5, 2014 15:28
Disabled PM_SLEEP_SMP, CONFIG_EXYNOS_PM_HOTPLUG , CONFIG_CPU_FREQ_GOV_PEGASUSQ
diff --git a/arch/arm/configs/cyanogenmod_i9100_defconfig b/arch/arm/configs/cyanogenmod_i9100_defconfig
index d4d365b..3baab75 100644
--- a/arch/arm/configs/cyanogenmod_i9100_defconfig
+++ b/arch/arm/configs/cyanogenmod_i9100_defconfig
@@ -391,12 +391,7 @@ CONFIG_EXYNOS4_SETUP_THERMAL=y
CONFIG_EXYNOS4_CPUFREQ=y
CONFIG_EXYNOS4210_1200MHZ_SUPPORT=y
# CONFIG_EXYNOS4210_1400MHZ_SUPPORT is not set
-
-#
@Oberon00
Oberon00 / 0001-Add-check-for-VPF-HW-state.patch
Last active August 29, 2015 14:11
More VFP state corruption debugging
From ef0e157bac9b44d81e890dff2c5dd7e7bc6873c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20Neum=C3=BCller?= <[email protected]>
Date: Sat, 20 Dec 2014 12:34:17 +0100
Subject: [PATCH 1/2] Add check for VPF HW state.
Change-Id: Ib936c2e83b0baa0d6440f5dada2cb16655dbcb76
---
arch/arm/vfp/vfphw.S | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
/* linux/arch/arm/mach-exynos/cpuidle-exynos4.c
*
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
@Oberon00
Oberon00 / 0001-cpu_pm-call-notifiers-during-suspend.patch
Last active August 29, 2015 14:11
Exynos 4210 FPU register corruption/music bug fix. (If you applied Lanchon's last change to vfphw.S, you should revert it before merging this).
From 56919e922baa154ac6e498bcc1520dc965065265 Mon Sep 17 00:00:00 2001
From: Colin Cross <[email protected]>
Date: Fri, 22 Jul 2011 14:57:09 -0700
Subject: [PATCH 1/5] cpu_pm: call notifiers during suspend
Implements syscore_ops in cpu_pm to call the cpu and
cpu cluster notifiers during suspend and resume,
allowing drivers receiving the notifications to
avoid implementing syscore_ops.
@Oberon00
Oberon00 / 0001-ARM-vfp-fix-a-hole-in-VFP-thread-migration.patch
Last active August 29, 2015 14:11
Full patchset for Exynos 4210 FPU corruption fix. (Revert Lanchon's changes that are not included here (that's just his last one) first!)
From fb62238974be027f3619881fc336ae41c01cfe76 Mon Sep 17 00:00:00 2001
From: Russell King <[email protected]>
Date: Sat, 9 Jul 2011 16:09:43 +0100
Subject: [PATCH 01/13] ARM: vfp: fix a hole in VFP thread migration
Fix a hole in the VFP thread migration. Lets define two threads.
Thread 1, we'll call 'interesting_thread' which is a thread which is
running on CPU0, using VFP (so vfp_current_hw_state[0] =
&interesting_thread->vfpstate) and gets migrated off to CPU1, where