Skip to content

Commit

Permalink
m8: update kernel from lollipop gpe
Browse files Browse the repository at this point in the history
* package name: m8stockui-3.4.0-g62722b0.zip

Change-Id: I520e2b70e1b690c5d54bd78c439922d5d0274e2a
  • Loading branch information
invisiblek authored and u-ra committed Dec 12, 2014
1 parent 6772cb4 commit df6d8fd
Show file tree
Hide file tree
Showing 30,637 changed files with 2,357,198 additions and 820,649 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
38 changes: 22 additions & 16 deletions AndroidKernel.mk
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ $(KERNEL_OUT):
mkdir -p $(KERNEL_OUT)

$(KERNEL_CONFIG): $(KERNEL_OUT)
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- $(KERNEL_DEFCONFIG)
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) $(KERNEL_DEFCONFIG)

$(KERNEL_OUT)/piggy : $(TARGET_PREBUILT_INT_KERNEL)
$(hide) gunzip -c $(KERNEL_OUT)/arch/arm/boot/compressed/piggy.gzip > $(KERNEL_OUT)/piggy
Expand All @@ -84,7 +84,7 @@ ifeq ($(KERNEL_ENABLE_EXFAT), m)
cp -rf vendor/tuxera/exfat/$(KERNEL_EXFAT_PATH) kernel/fs/
mkdir -p $(KERNEL_OUT)/fs/$(KERNEL_EXFAT_PATH)
# Update exFAT module after vmlinux but before modules
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- vmlinux
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) vmlinux
ifeq ($(HTC_DEBUG_FLAG), DEBUG)
ifeq ($(strip $(KERNEL_EXFAT_VERSION)),)
./kernel/update_tuxera.sh -p $(KERNEL_EXFAT_PATH) -t target/htc.d/htc -o $(KERNEL_OUT)
Expand All @@ -110,26 +110,32 @@ endif

endif
endif
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi-
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- modules
$(MAKE) -C kernel O=../$(KERNEL_OUT) INSTALL_MOD_PATH=../../$(KERNEL_MODULES_INSTALL) INSTALL_MOD_STRIP=1 ARCH=arm CROSS_COMPILE=arm-eabi- modules_install
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME)
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) modules
$(MAKE) -C kernel O=../$(KERNEL_OUT) INSTALL_MOD_PATH=../../$(KERNEL_MODULES_INSTALL) INSTALL_MOD_STRIP=1 ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) modules_install
ifeq ($(KERNEL_ENABLE_EXFAT), m)
ifeq ($(HTC_DEBUG_FLAG), DEBUG)
# Build exfat modules for DEBUG
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- SUBDIRS=$(BUILD_PATH)/kernel/fs/$(KERNEL_EXFAT_PATH)/objects modules
$(MAKE) -C kernel O=../$(KERNEL_OUT) SUBDIRS=fs/$(KERNEL_EXFAT_PATH)/objects INSTALL_MOD_PATH=../../$(KERNEL_MODULES_INSTALL) ARCH=arm CROSS_COMPILE=arm-eabi- modules_install
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) SUBDIRS=$(BUILD_PATH)/kernel/fs/$(KERNEL_EXFAT_PATH)/objects modules
$(MAKE) -C kernel O=../$(KERNEL_OUT) SUBDIRS=fs/$(KERNEL_EXFAT_PATH)/objects INSTALL_MOD_PATH=../../$(KERNEL_MODULES_INSTALL) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) modules_install
cp kernel/fs/$(KERNEL_EXFAT_PATH)/objects/texfat.ko $(KERNEL_MODULES_OUT)/
mkdir -p $(TARGET_OUT)/bin/
cp -rf kernel/fs/$(KERNEL_EXFAT_PATH)/bin/* $(TARGET_OUT)/bin/
else
ifeq ($(TARGET_BUILD_VARIANT), user)
# Build exfat modules for NonDebug-USER
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- SUBDIRS=$(BUILD_PATH)/kernel/fs/$(KERNEL_EXFAT_PATH)/objects-user modules
$(MAKE) -C kernel O=../$(KERNEL_OUT) SUBDIRS=fs/$(KERNEL_EXFAT_PATH)/objects-user INSTALL_MOD_PATH=../../$(KERNEL_MODULES_INSTALL) ARCH=arm CROSS_COMPILE=arm-eabi- modules_install
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) SUBDIRS=$(BUILD_PATH)/kernel/fs/$(KERNEL_EXFAT_PATH)/objects-user modules
$(MAKE) -C kernel O=../$(KERNEL_OUT) SUBDIRS=fs/$(KERNEL_EXFAT_PATH)/objects-user INSTALL_MOD_PATH=../../$(KERNEL_MODULES_INSTALL) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) modules_install
cp kernel/fs/$(KERNEL_EXFAT_PATH)/objects-user/texfat.ko $(KERNEL_MODULES_OUT)/
mkdir -p $(TARGET_OUT)/bin/
cp -rf kernel/fs/$(KERNEL_EXFAT_PATH)/bin/* $(TARGET_OUT)/bin/
else
# Build exfat modules for NonDebug-USERDEBUG
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- SUBDIRS=$(BUILD_PATH)/kernel/fs/$(KERNEL_EXFAT_PATH)/objects-userdebug modules
$(MAKE) -C kernel O=../$(KERNEL_OUT) SUBDIRS=fs/$(KERNEL_EXFAT_PATH)/objects-userdebug INSTALL_MOD_PATH=../../$(KERNEL_MODULES_INSTALL) ARCH=arm CROSS_COMPILE=arm-eabi- modules_install
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) SUBDIRS=$(BUILD_PATH)/kernel/fs/$(KERNEL_EXFAT_PATH)/objects-userdebug modules
$(MAKE) -C kernel O=../$(KERNEL_OUT) SUBDIRS=fs/$(KERNEL_EXFAT_PATH)/objects-userdebug INSTALL_MOD_PATH=../../$(KERNEL_MODULES_INSTALL) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) modules_install
cp kernel/fs/$(KERNEL_EXFAT_PATH)/objects-userdebug/texfat.ko $(KERNEL_MODULES_OUT)/
mkdir -p $(TARGET_OUT)/bin/
cp -rf kernel/fs/$(KERNEL_EXFAT_PATH)/bin/* $(TARGET_OUT)/bin/
endif
endif
endif
Expand All @@ -138,7 +144,7 @@ endif
$(append-dtb)
ifeq ($(MOCANA_FIPS_MODULE), true)
vendor/mocana/scripts/build_dar.sh -s `pwd`/vendor/mocana -k 3.4.10 -K `pwd`/kernel -t `pwd`/$(KERNEL_MODULES_OUT) -z `pwd`/$(KERNEL_OUT)
$(MAKE) -C kernel ARCH=arm CROSS_COMPILE=arm-eabi- mrproper
$(MAKE) -C kernel ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) mrproper
endif
ifeq ($(KERNEL_ENABLE_EXFAT), m)
rm kernel/tuxera_update_htc.sh
Expand All @@ -147,16 +153,16 @@ ifeq ($(KERNEL_ENABLE_EXFAT), m)
rm -rf kernel/fs/texfat*
endif
$(KERNEL_HEADERS_INSTALL): $(KERNEL_OUT) $(KERNEL_CONFIG)
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- headers_install
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) headers_install

kerneltags: $(KERNEL_OUT) $(KERNEL_CONFIG)
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- tags
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) tags

kernelconfig: $(KERNEL_OUT) $(KERNEL_CONFIG)
env KCONFIG_NOTIMESTAMP=true \
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- menuconfig
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) menuconfig
env KCONFIG_NOTIMESTAMP=true \
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- savedefconfig
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- PRIVATE_RCMS_NAME=$(PRIVATE_RCMS_NAME) savedefconfig
cp $(KERNEL_OUT)/defconfig kernel/arch/arm/configs/$(KERNEL_DEFCONFIG)

endif
30 changes: 24 additions & 6 deletions Documentation/accounting/getdelays.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
#include <linux/taskstats.h>
#include <linux/cgroupstats.h>

/*
* Generic macros for dealing with netlink sockets. Might be duplicated
* elsewhere. It is recommended that commercial grade applications use
* libnl or libnetlink and use the interfaces provided by the library
*/
#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
#define GENLMSG_PAYLOAD(glh) (NLMSG_PAYLOAD(glh, 0) - GENL_HDRLEN)
#define NLA_DATA(na) ((void *)((char*)(na) + NLA_HDRLEN))
Expand All @@ -54,7 +59,9 @@ __u64 stime, utime;
} \
}

/* Maximum size of response requested or message sent */
#define MAX_MSG_SIZE 1024
/* Maximum number of cpus expected to be specified in a cpumask */
#define MAX_CPUS 32

struct msgtemplate {
Expand All @@ -76,6 +83,9 @@ static void usage(void)
fprintf(stderr, " -C: container path\n");
}

/*
* Create a raw netlink socket and bind
*/
static int create_nl_socket(int protocol)
{
int fd;
Expand Down Expand Up @@ -147,6 +157,10 @@ static int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid,
}


/*
* Probe the controller in genetlink to find the family id
* for the TASKSTATS family
*/
static int get_family_id(int sd)
{
struct {
Expand All @@ -164,7 +178,7 @@ static int get_family_id(int sd)
CTRL_ATTR_FAMILY_NAME, (void *)name,
strlen(TASKSTATS_GENL_NAME)+1);
if (rc < 0)
return 0;
return 0; /* sendto() failure? */

rep_len = recv(sd, &ans, sizeof(ans), 0);
if (ans.n.nlmsg_type == NLMSG_ERROR ||
Expand Down Expand Up @@ -319,14 +333,14 @@ int main(int argc, char *argv[])
break;
case 'c':


/* Block SIGCHLD for sigwait() later */
if (sigemptyset(&sigset) == -1)
err(1, "Failed to empty sigset");
if (sigaddset(&sigset, SIGCHLD))
err(1, "Failed to set sigchld in sigset");
sigprocmask(SIG_BLOCK, &sigset, NULL);


/* fork/exec a child */
tid = fork();
if (tid < 0)
err(1, "Fork failed\n");
Expand All @@ -335,7 +349,7 @@ int main(int argc, char *argv[])
&argv[optind - 1]) < 0)
exit(-1);


/* Set the command type and avoid further processing */
cmd_type = TASKSTATS_CMD_ATTR_PID;
forking = 1;
break;
Expand Down Expand Up @@ -390,6 +404,10 @@ int main(int argc, char *argv[])
goto err;
}

/*
* If we forked a child, wait for it to exit. Cannot use waitpid()
* as all the delicious data would be reaped as part of the wait
*/
if (tid && forking) {
int sig_received;
sigwait(&sigset, &sig_received);
Expand Down Expand Up @@ -452,11 +470,11 @@ int main(int argc, char *argv[])
len += NLA_ALIGN(na->nla_len);
switch (na->nla_type) {
case TASKSTATS_TYPE_AGGR_TGID:

/* Fall through */
case TASKSTATS_TYPE_AGGR_PID:
aggr_len = NLA_PAYLOAD(na->nla_len);
len2 = 0;

/* For nested attributes, na follows */
na = (struct nlattr *) NLA_DATA(na);
done = 0;
while (len2 < aggr_len) {
Expand Down
33 changes: 32 additions & 1 deletion Documentation/arm/SH-Mobile/vrl4.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@
* for more details.
*/

/*
* usage: vrl4 < zImage > out
* dd if=out of=/dev/sdx bs=512 seek=1 # Write the image to sector 1
*
* Reads a zImage from stdin and writes a vrl4 image to stdout.
* In practice this means writing a padded vrl4 header to stdout followed
* by the zImage.
*
* The padding places the zImage at ALIGN bytes into the output.
* The vrl4 uses ALIGN + START_BASE as the start_address.
* This is where the mask ROM will jump to after verifying the header.
*
* The header sets copy_size to min(sizeof(zImage), MAX_BOOT_PROG_LEN) + ALIGN.
* That is, the mask ROM will load the padded header (ALIGN bytes)
* And then MAX_BOOT_PROG_LEN bytes of the image, or the entire image,
* whichever is smaller.
*
* The zImage is not modified in any way.
*/

#define _BSD_SOURCE
#include <endian.h>
Expand Down Expand Up @@ -37,11 +56,23 @@ struct hdr {
.magic2 = htole32(0xe59ff008), \
.reserved3 = htole16(0x1) }

/* Align to 512 bytes, the MMCIF sector size */
#define ALIGN_BITS 9
#define ALIGN (1 << ALIGN_BITS)

#define START_BASE 0xe55b0000

/*
* With an alignment of 512 the header uses the first sector.
* There is a 128 sector (64kbyte) limit on the data loaded by the mask ROM.
* So there are 127 sectors left for the boot programme. But in practice
* Only a small portion of a zImage is needed, 16 sectors should be more
* than enough.
*
* Note that this sets how much of the zImage is copied by the mask ROM.
* The entire zImage is present after the header and is loaded
* by the code in the boot program (which is the first portion of the zImage).
*/
#define MAX_BOOT_PROG_LEN (16 * 512)

#define ROUND_UP(x) ((x + ALIGN - 1) & ~(ALIGN - 1))
Expand Down Expand Up @@ -123,7 +154,7 @@ int main(void)
if (do_write(1, boot_program, prog_len) < 0)
return 1;


/* Write out the rest of the kernel */
while (1) {
prog_len = do_read(0, boot_program, sizeof(boot_program));
if (prog_len < 0)
Expand Down
50 changes: 50 additions & 0 deletions Documentation/auxdisplay/cfag12864b-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
*
*/

/*
* ------------------------
* start of cfag12864b code
* ------------------------
*/

#include <string.h>
#include <fcntl.h>
Expand Down Expand Up @@ -50,6 +55,13 @@ int cfag12864b_fd;
unsigned char * cfag12864b_mem;
unsigned char cfag12864b_buffer[CFAG12864B_SIZE];

/*
* init a cfag12864b framebuffer device
*
* No error: return = 0
* Unable to open: return = -1
* Unable to mmap: return = -2
*/
static int cfag12864b_init(char *path)
{
cfag12864b_fd = open(path, O_RDWR);
Expand All @@ -66,26 +78,41 @@ static int cfag12864b_init(char *path)
return 0;
}

/*
* exit a cfag12864b framebuffer device
*/
static void cfag12864b_exit(void)
{
munmap(cfag12864b_mem, CFAG12864B_SIZE);
close(cfag12864b_fd);
}

/*
* set (x, y) pixel
*/
static void cfag12864b_set(unsigned char x, unsigned char y)
{
if (CFAG12864B_CHECK(x, y))
cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] |=
CFAG12864B_BIT(x % CFAG12864B_BPB);
}

/*
* unset (x, y) pixel
*/
static void cfag12864b_unset(unsigned char x, unsigned char y)
{
if (CFAG12864B_CHECK(x, y))
cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] &=
~CFAG12864B_BIT(x % CFAG12864B_BPB);
}

/*
* is set (x, y) pixel?
*
* Pixel off: return = 0
* Pixel on: return = 1
*/
static unsigned char cfag12864b_isset(unsigned char x, unsigned char y)
{
if (CFAG12864B_CHECK(x, y))
Expand All @@ -96,6 +123,9 @@ static unsigned char cfag12864b_isset(unsigned char x, unsigned char y)
return 0;
}

/*
* not (x, y) pixel
*/
static void cfag12864b_not(unsigned char x, unsigned char y)
{
if (cfag12864b_isset(x, y))
Expand All @@ -104,6 +134,9 @@ static void cfag12864b_not(unsigned char x, unsigned char y)
cfag12864b_set(x, y);
}

/*
* fill (set all pixels)
*/
static void cfag12864b_fill(void)
{
unsigned short i;
Expand All @@ -112,6 +145,9 @@ static void cfag12864b_fill(void)
cfag12864b_buffer[i] = 0xFF;
}

/*
* clear (unset all pixels)
*/
static void cfag12864b_clear(void)
{
unsigned short i;
Expand All @@ -120,6 +156,12 @@ static void cfag12864b_clear(void)
cfag12864b_buffer[i] = 0;
}

/*
* format a [128*64] matrix
*
* Pixel off: src[i] = 0
* Pixel on: src[i] > 0
*/
static void cfag12864b_format(unsigned char * matrix)
{
unsigned char i, j, n;
Expand All @@ -137,11 +179,19 @@ static void cfag12864b_format(unsigned char * matrix)
}
}

/*
* blit buffer to lcd
*/
static void cfag12864b_blit(void)
{
memcpy(cfag12864b_mem, cfag12864b_buffer, CFAG12864B_SIZE);
}

/*
* ----------------------
* end of cfag12864b code
* ----------------------
*/

#include <stdio.h>

Expand Down
Loading

0 comments on commit df6d8fd

Please sign in to comment.