Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168300
b: refs/heads/master
c: f0ede3f
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Nov 9, 2009
1 parent 1047f57 commit 90f261f
Show file tree
Hide file tree
Showing 41 changed files with 284 additions and 214 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 43758dd88fdf1e5b3897c7a04dfae0afb8313dea
refs/heads/master: f0ede3f36188237d124b457d6735941d8e2cf981
3 changes: 3 additions & 0 deletions trunk/arch/m32r/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ config M32R
select HAVE_IDE
select HAVE_OPROFILE
select INIT_ALL_POSSIBLE
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_LZMA

config SBUS
bool
Expand Down
16 changes: 13 additions & 3 deletions trunk/arch/m32r/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# create a compressed vmlinux image from the original vmlinux
#

targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o \
piggy.o vmlinux.lds
targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
vmlinux.bin.lzma head.o misc.o piggy.o vmlinux.lds

OBJECTS = $(obj)/head.o $(obj)/misc.o

Expand All @@ -27,6 +27,12 @@ $(obj)/vmlinux.bin: vmlinux FORCE
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
$(call if_changed,gzip)

$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
$(call if_changed,bzip2)

$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
$(call if_changed,lzma)

CFLAGS_misc.o += -fpic

ifdef CONFIG_MMU
Expand All @@ -37,5 +43,9 @@ endif

OBJCOPYFLAGS += -R .empty_zero_page

$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
suffix_$(CONFIG_KERNEL_GZIP) = gz
suffix_$(CONFIG_KERNEL_BZIP2) = bz2
suffix_$(CONFIG_KERNEL_LZMA) = lzma

$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE
$(call if_changed,ld)
143 changes: 26 additions & 117 deletions trunk/arch/m32r/boot/compressed/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,140 +9,49 @@
* Adapted for SH by Stuart Menefy, Aug 1999
*
* 2003-02-12: Support M32R by Takeo Takahashi
* This is based on arch/sh/boot/compressed/misc.c.
*/

#include <linux/string.h>

/*
* gzip declarations
*/

#define OF(args) args
#define STATIC static

#undef memset
#undef memcpy
#define memzero(s, n) memset ((s), 0, (n))

typedef unsigned char uch;
typedef unsigned short ush;
typedef unsigned long ulg;

#define WSIZE 0x8000 /* Window size must be at least 32k, */
/* and a power of two */

static uch *inbuf; /* input buffer */
static uch window[WSIZE]; /* Sliding window buffer */

static unsigned insize = 0; /* valid bytes in inbuf */
static unsigned inptr = 0; /* index of next byte to be processed in inbuf */
static unsigned outcnt = 0; /* bytes in output buffer */

/* gzip flag byte */
#define ASCII_FLAG 0x01 /* bit 0 set: file probably ASCII text */
#define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */
#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
#define COMMENT 0x10 /* bit 4 set: file comment present */
#define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */
#define RESERVED 0xC0 /* bit 6,7: reserved */

#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf())

/* Diagnostic functions */
#ifdef DEBUG
# define Assert(cond,msg) {if(!(cond)) error(msg);}
# define Trace(x) fprintf x
# define Tracev(x) {if (verbose) fprintf x ;}
# define Tracevv(x) {if (verbose>1) fprintf x ;}
# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
#else
# define Assert(cond,msg)
# define Trace(x)
# define Tracev(x)
# define Tracevv(x)
# define Tracec(c,x)
# define Tracecv(c,x)
#endif

static int fill_inbuf(void);
static void flush_window(void);
static void error(char *m);

static unsigned char *input_data;
static int input_len;

static long bytes_out = 0;
static uch *output_data;
static unsigned long output_ptr = 0;

#include "m32r_sio.c"

static unsigned long free_mem_ptr;
static unsigned long free_mem_end_ptr;

#define HEAP_SIZE 0x10000

#include "../../../../lib/inflate.c"

void* memset(void* s, int c, size_t n)
#ifdef CONFIG_KERNEL_BZIP2
static void *memset(void *s, int c, size_t n)
{
int i;
char *ss = (char*)s;
char *ss = s;

for (i=0;i<n;i++) ss[i] = c;
while (n--)
*ss++ = c;
return s;
}
#endif

void* memcpy(void* __dest, __const void* __src,
size_t __n)
{
int i;
char *d = (char *)__dest, *s = (char *)__src;

for (i=0;i<__n;i++) d[i] = s[i];
return __dest;
}

/* ===========================================================================
* Fill the input buffer. This is called only when the buffer is empty
* and at least one byte is really needed.
*/
static int fill_inbuf(void)
{
if (insize != 0) {
error("ran out of input data");
}

inbuf = input_data;
insize = input_len;
inptr = 1;
return inbuf[0];
}
#ifdef CONFIG_KERNEL_GZIP
#define BOOT_HEAP_SIZE 0x10000
#include "../../../../lib/decompress_inflate.c"
#endif

/* ===========================================================================
* Write the output window window[0..outcnt-1] and update crc and bytes_out.
* (Used for the decompressed data only.)
*/
static void flush_window(void)
{
ulg c = crc; /* temporary variable */
unsigned n;
uch *in, *out, ch;
#ifdef CONFIG_KERNEL_BZIP2
#define BOOT_HEAP_SIZE 0x400000
#include "../../../../lib/decompress_bunzip2.c"
#endif

in = window;
out = &output_data[output_ptr];
for (n = 0; n < outcnt; n++) {
ch = *out++ = *in++;
c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
}
crc = c;
bytes_out += (ulg)outcnt;
output_ptr += (ulg)outcnt;
outcnt = 0;
}
#ifdef CONFIG_KERNEL_LZMA
#define BOOT_HEAP_SIZE 0x10000
#include "../../../../lib/decompress_unlzma.c"
#endif

static void error(char *x)
{
Expand All @@ -153,20 +62,20 @@ static void error(char *x)
while(1); /* Halt */
}

/* return decompressed size */
void
decompress_kernel(int mmu_on, unsigned char *zimage_data,
unsigned int zimage_len, unsigned long heap)
{
unsigned char *input_data = zimage_data;
int input_len = zimage_len;
unsigned char *output_data;

output_data = (unsigned char *)CONFIG_MEMORY_START + 0x2000
+ (mmu_on ? 0x80000000 : 0);
free_mem_ptr = heap;
free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;
input_data = zimage_data;
input_len = zimage_len;
free_mem_end_ptr = free_mem_ptr + BOOT_HEAP_SIZE;

makecrc();
puts("Uncompressing Linux... ");
gunzip();
puts("Ok, booting the kernel.\n");
puts("\nDecompressing Linux... ");
decompress(input_data, input_len, NULL, NULL, output_data, NULL, error);
puts("done.\nBooting the kernel.\n");
}
2 changes: 1 addition & 1 deletion trunk/arch/m32r/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ unsigned long send_IPI_mask_phys(cpumask_t physid_mask, int ipi_num,

if (mask & ~physids_coerce(phys_cpu_present_map))
BUG();
if (ipi_num >= NR_IPIS)
if (ipi_num >= NR_IPIS || ipi_num < 0)
BUG();

mask <<= IPI_SHIFT;
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/m32r/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ u32 arch_gettimeoffset(void)
count = 0;

count = (latch - count) * TICK_SIZE;
elapsed_time = (count + latch / 2) / latch;
elapsed_time = DIV_ROUND_CLOSEST(count, latch);
/* NOTE: LATCH is equal to the "interval" value (= reload count). */

#else /* CONFIG_SMP */
Expand All @@ -93,7 +93,7 @@ u32 arch_gettimeoffset(void)
p_count = count;

count = (latch - count) * TICK_SIZE;
elapsed_time = (count + latch / 2) / latch;
elapsed_time = DIV_ROUND_CLOSEST(count, latch);
/* NOTE: LATCH is equal to the "interval" value (= reload count). */
#endif /* CONFIG_SMP */
#elif defined(CONFIG_CHIP_M32310)
Expand Down Expand Up @@ -211,7 +211,7 @@ void __init time_init(void)

bus_clock = boot_cpu_data.bus_clock;
divide = boot_cpu_data.timer_divide;
latch = (bus_clock/divide + HZ / 2) / HZ;
latch = DIV_ROUND_CLOSEST(bus_clock/divide, HZ);

printk("Timer start : latch = %ld\n", latch);

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/m32r/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ SECTIONS
_etext = .; /* End of text section */

EXCEPTION_TABLE(16)
NOTES

RODATA
RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
_edata = .; /* End of data section */
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ config ARCH_SPARSEMEM_DEFAULT
config ARCH_POPULATES_NODE_MAP
def_bool y

config SYS_SUPPORTS_HUGETLBFS
def_bool y
depends on PPC_BOOK3S_64

source "mm/Kconfig"

config ARCH_MEMORY_PROBE
Expand Down
15 changes: 14 additions & 1 deletion trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ int update_persistent_clock(struct timespec now)
return ppc_md.set_rtc_time(&tm);
}

void read_persistent_clock(struct timespec *ts)
static void __read_persistent_clock(struct timespec *ts)
{
struct rtc_time tm;
static int first = 1;
Expand All @@ -800,10 +800,23 @@ void read_persistent_clock(struct timespec *ts)
return;
}
ppc_md.get_rtc_time(&tm);

ts->tv_sec = mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
}

void read_persistent_clock(struct timespec *ts)
{
__read_persistent_clock(ts);

/* Sanitize it in case real time clock is set below EPOCH */
if (ts->tv_sec < 0) {
ts->tv_sec = 0;
ts->tv_nsec = 0;
}

}

/* clocksource code */
static cycle_t rtc_read(struct clocksource *cs)
{
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/powerpc/kvm/timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ static inline void kvmppc_set_exit_type(struct kvm_vcpu *vcpu, int type) {}
static inline void kvmppc_account_exit_stat(struct kvm_vcpu *vcpu, int type)
{
/* type has to be known at build time for optimization */

/* The BUILD_BUG_ON below breaks in funny ways, commented out
* for now ... -BenH
BUILD_BUG_ON(__builtin_constant_p(type));
*/
switch (type) {
case EXT_INTR_EXITS:
vcpu->stat.ext_intr_exits++;
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/mm/mmu_context_nohash.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
* also clear mm->cpu_vm_mask bits when processes are migrated
*/

#define DEBUG_MAP_CONSISTENCY
#define DEBUG_CLAMP_LAST_CONTEXT 31
//#define DEBUG_MAP_CONSISTENCY
//#define DEBUG_CLAMP_LAST_CONTEXT 31
//#define DEBUG_HARDER

/* We don't use DEBUG because it tends to be compiled in always nowadays
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/powerpc/platforms/pseries/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,6 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
/* Read config space back so we can restore after reset */
read_msi_msg(virq, &msg);
entry->msg = msg;

unmask_msi_irq(virq);
}

return 0;
Expand Down
9 changes: 9 additions & 0 deletions trunk/arch/powerpc/platforms/pseries/xics.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/init.h>
#include <linux/radix-tree.h>
#include <linux/cpu.h>
#include <linux/msi.h>
#include <linux/of.h>

#include <asm/firmware.h>
Expand Down Expand Up @@ -219,6 +220,14 @@ static void xics_unmask_irq(unsigned int virq)

static unsigned int xics_startup(unsigned int virq)
{
/*
* The generic MSI code returns with the interrupt disabled on the
* card, using the MSI mask bits. Firmware doesn't appear to unmask
* at that level, so we do it here by hand.
*/
if (irq_to_desc(virq)->msi_desc)
unmask_msi_irq(virq);

/* unmask it */
xics_unmask_irq(virq);
return 0;
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/amd_iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ extern irqreturn_t amd_iommu_int_handler(int irq, void *data);
extern void amd_iommu_flush_all_domains(void);
extern void amd_iommu_flush_all_devices(void);
extern void amd_iommu_shutdown(void);
extern void amd_iommu_apply_erratum_63(u16 devid);
#else
static inline int amd_iommu_init(void) { return -ENODEV; }
static inline void amd_iommu_detect(void) { }
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static inline void load_LDT(mm_context_t *pc)

static inline unsigned long get_desc_base(const struct desc_struct *desc)
{
return desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24);
return (unsigned)(desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24));
}

static inline void set_desc_base(struct desc_struct *desc, unsigned long base)
Expand Down
Loading

0 comments on commit 90f261f

Please sign in to comment.