Skip to content

Instantly share code, notes, and snippets.

@kangear
kangear / list.h
Last active August 29, 2015 14:15
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
#include <stdio.h>
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.

##porting rk616 Audio codec driver from 3.0 version kernel to 4.0 version kernel:

  • error: 'snd_soc_info_volsw_2r' undeclared here (not in a function)
  • error: 'struct snd_soc_codec' has no member named 'mutex'
  • error: 'struct snd_soc_dapm_widget' has no member named 'codec'
  • error: 'struct snd_soc_codec' has no member named 'hw_read'
  • error: 'struct snd_soc_codec' has no member named 'read'
  • error: 'struct snd_soc_codec' has no member named 'write'

编译RK3288内核,使用arm-linux-gnueabihf出现的问题。

  OBJCOPY pie/libpie_stage2.o
  LD      pie/pie_stage2.o
arm-linux-gnueabihf-ld: BFD (GNU Binutils for Ubuntu) 2.22 internal error, aborting at ../../bfd/elflink.c line 8758 in elf_link_output_extsym

arm-linux-gnueabihf-ld: Please report this bug.

解决方法是不再使用apt-get install安装的而使用Android源码中的prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-就没有问题了。

<6>[ 0.000000] Initializing cgroup subsys cpu
<5>[ 0.000000] Linux version 3.0.36+ (ybk@v-stone-hwubuntu) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #149 SMP PREEMPT Wed May 6 10:24:20 CST 2015
<4>[ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
<4>[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
<4>[ 0.000000] Machine: RK30board
<6>[ 0.000000] memory reserve: Memory(base:0x91800000 size:80M) reserved for <ion>
<6>[ 0.000000] memory reserve: Memory(base:0x90b00000 size:13M) reserved for <fb0 buf>
<6>[ 0.000000] memory reserve: Memory(base:0x90500000 size:6M) reserved for <camera_ipp_mem>
<6>[ 0.000000] memory reserve: Total reserved 99M
<4>[ 0.000000] Memory policy: ECC disabled, Data cache writeback
@kangear
kangear / freg-register_chrdev.c
Last active December 27, 2015 02:09
freg.c sample DON'T EDIT.
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
/* 主设备号 */
#define MAJOR_NUM 250
static ssize_t freg_read(struct file* filp, char __user *buf, size_t count, loff_t* f_pos);
static ssize_t freg_write(struct file* filp, const char __user *buf, size_t count, loff_t* f_pos);
@kangear
kangear / freg-alloc_chrdev_region.c
Last active December 27, 2015 02:09
That's OK, don't edit.
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/cdev.h>
#include <asm/uaccess.h>
static struct cdev freg_cdev; //An instance of a character device
static dev_t ndev; //The node of the device
/* "freg"设备的全局变量 */
@kangear
kangear / freg-register_chrdev_region.c
Last active December 27, 2015 03:49
is simple DON'T edit.
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/cdev.h>
#include <asm/uaccess.h>
static struct cdev freg_cdev; //An instance of a character device
static dev_t ndev; //The node of the device
/* "freg"设备的全局变量 */
diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
index 060db6a..65fdde2 100644
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -32,7 +32,7 @@ endif
# CC = gcc
#
-COPTS = -O2 -pipe -Wall -g
+COPTS = -static -O2 -pipe -Wall -g
@kangear
kangear / rk_dummy.c
Last active November 13, 2018 11:06
借此Machine驱动了解了ALSA on Soc的Machine驱动。这是一个简单版本的。
/*
* rk_dummy.c -- SoC audio for rockchip
*
* Driver for rockchip dummy audio
* based: 7aca69f9fe8f04ca37a01e2540960c53b24e3223 patch
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
diff --git a/libs/jadx/bin/jadx-gui b/libs/jadx/bin/jadx-gui
index 131a97e..c86b948 100755
--- a/libs/jadx/bin/jadx-gui
+++ b/libs/jadx/bin/jadx-gui
@@ -28,7 +28,7 @@ APP_NAME="jadx-gui"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and JADX_GUI_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xms128M" "-Xmx4g" "-Dawt.useSystemAAFontSettings=lcd" "-Dswing.aatext=true" "-XX:+UseG1GC"'
+DEFAULT_JVM_OPTS='"-Xms128M" "-Xmx8g" "-Dawt.useSystemAAFontSettings=lcd" "-Dswing.aatext=true" "-XX:+UseG1GC"'