Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73580
b: refs/heads/master
c: dbb2ed2
h: refs/heads/master
v: v3
  • Loading branch information
Pierre Ynard authored and David S. Miller committed Nov 13, 2007
1 parent 532d152 commit 381aae9
Show file tree
Hide file tree
Showing 17 changed files with 169 additions and 54 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: a7fe77161da48a74c60dc19fc4ca3a73ab761d37
refs/heads/master: dbb2ed24851a290616d66212dc75373fd863d636
3 changes: 0 additions & 3 deletions trunk/arch/powerpc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ endif
# No AltiVec instruction when building kernel
KBUILD_CFLAGS += $(call cc-option,-mno-altivec)

# No SPE instruction when building kernel
KBUILD_CFLAGS += $(call cc-option,-mno-spe)

# Enable unit-at-a-time mode when possible. It shrinks the
# kernel considerably.
KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
Expand Down
4 changes: 1 addition & 3 deletions trunk/arch/powerpc/kernel/btext.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ int btext_initialize(struct device_node *np)
pitch = *prop;
if (pitch == 1)
pitch = 0x1000;
prop = of_get_property(np, "linux,bootx-addr", NULL);
if (prop == NULL)
prop = of_get_property(np, "address", NULL);
prop = of_get_property(np, "address", NULL);
if (prop)
address = *prop;

Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/powerpc/kernel/entry_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,6 @@ syscall_exit_cont:
bne- 2f
1:
#endif /* CONFIG_44x */
BEGIN_FTR_SECTION
lwarx r7,0,r1
END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
stwcx. r0,0,r1 /* to clear the reservation */
lwz r4,_LINK(r1)
lwz r5,_CCR(r1)
Expand Down Expand Up @@ -720,9 +717,6 @@ restore:
mtctr r11

PPC405_ERR77(0,r1)
BEGIN_FTR_SECTION
lwarx r11,0,r1
END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
stwcx. r0,0,r1 /* to clear the reservation */

#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ static void register_decrementer_clockevent(int cpu)
*dec = decrementer_clockevent;
dec->cpumask = cpumask_of_cpu(cpu);

printk(KERN_DEBUG "clockevent: %s mult[%lx] shift[%d] cpu[%d]\n",
printk(KERN_INFO "clockevent: %s mult[%lx] shift[%d] cpu[%d]\n",
dec->name, dec->mult, dec->shift, cpu);

clockevents_register_device(dec);
Expand Down
16 changes: 12 additions & 4 deletions trunk/arch/powerpc/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*
*/

#undef DEBUG

#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h>
Expand Down Expand Up @@ -64,6 +66,12 @@

#include "mmu_decl.h"

#ifdef DEBUG
#define DBG(fmt...) printk(fmt)
#else
#define DBG(fmt...)
#endif

#if PGTABLE_RANGE > USER_VSID_RANGE
#warning Limited user VSID range means pagetable space is wasted
#endif
Expand Down Expand Up @@ -167,8 +175,8 @@ void pgtable_cache_init(void)
int size = pgtable_cache_size[i];
const char *name = pgtable_cache_name[i];

pr_debug("Allocating page table cache %s (#%d) "
"for size: %08x...\n", name, i, size);
DBG("Allocating page table cache %s (#%d) "
"for size: %08x...\n", name, i, size);
pgtable_cache[i] = kmem_cache_create(name,
size, size,
SLAB_PANIC,
Expand Down Expand Up @@ -231,8 +239,8 @@ int __meminit vmemmap_populate(struct page *start_page,
if (!p)
return -ENOMEM;

pr_debug("vmemmap %08lx allocated at %p, physical %08lx.\n",
start, p, __pa(p));
printk(KERN_WARNING "vmemmap %08lx allocated at %p, "
"physical %08lx.\n", start, p, __pa(p));

mapped = htab_bolt_mapping(start, start + page_size,
__pa(p), mode_rw, mmu_linear_psize,
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/mm/tlb_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ unsigned long pte_freelist_forced_free;
((PAGE_SIZE - sizeof(struct pte_freelist_batch)) \
/ sizeof(pgtable_free_t))

#ifdef CONFIG_SMP
static void pte_free_smp_sync(void *arg)
{
/* Do nothing, just ensure we sync with all CPUs */
}
#endif

/* This is only called when we are critically out of memory
* (and fail to get a page in pte_free_tlb).
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/powerpc/sysdev/cpm_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ int __init cpm_muram_init(void)
int i = 0;
int ret = 0;

printk("cpm_muram_init\n");

spin_lock_init(&cpm_muram_lock);
/* initialize the info header */
rh_init(&cpm_muram_info, 1,
Expand Down Expand Up @@ -191,7 +193,7 @@ void __iomem *cpm_muram_addr(unsigned long offset)
EXPORT_SYMBOL(cpm_muram_addr);

/**
* cpm_muram_dma - turn a muram virtual address into a DMA address
* cpm_muram_phys - turn a muram virtual address into a DMA address
* @offset: virtual address from cpm_muram_addr() to convert
*/
dma_addr_t cpm_muram_dma(void __iomem *addr)
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/ppc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,6 @@ syscall_exit_cont:
bne- 2f
1:
#endif /* CONFIG_44x */
BEGIN_FTR_SECTION
lwarx r7,0,r1
END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
stwcx. r0,0,r1 /* to clear the reservation */
lwz r4,_LINK(r1)
lwz r5,_CCR(r1)
Expand Down Expand Up @@ -716,9 +713,6 @@ restore:
mtctr r11

PPC405_ERR77(0,r1)
BEGIN_FTR_SECTION
lwarx r11,0,r1
END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
stwcx. r0,0,r1 /* to clear the reservation */

#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
Expand Down
10 changes: 4 additions & 6 deletions trunk/drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,18 @@ static int acpi_battery_technology(struct acpi_battery *battery)
return POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
}

static int acpi_battery_get_state(struct acpi_battery *battery);
static int acpi_battery_update(struct acpi_battery *battery);

static int acpi_battery_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{
struct acpi_battery *battery = to_acpi_battery(psy);

if (acpi_battery_present(battery)) {
/* run battery update only if it is present */
acpi_battery_get_state(battery);
} else if (psp != POWER_SUPPLY_PROP_PRESENT)
if ((!acpi_battery_present(battery)) &&
psp != POWER_SUPPLY_PROP_PRESENT)
return -ENODEV;
acpi_battery_update(battery);
switch (psp) {
case POWER_SUPPLY_PROP_STATUS:
if (battery->state & 0x01)
Expand Down Expand Up @@ -458,7 +457,6 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
return;
device_remove_file(battery->bat.dev, &alarm_attr);
power_supply_unregister(&battery->bat);
battery->bat.dev = NULL;
}

static int acpi_battery_update(struct acpi_battery *battery)
Expand Down
50 changes: 45 additions & 5 deletions trunk/fs/ext2/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
return desc + offset;
}

static inline int
block_in_use(unsigned long block, struct super_block *sb, unsigned char *map)
{
return ext2_test_bit ((block -
le32_to_cpu(EXT2_SB(sb)->s_es->s_first_data_block)) %
EXT2_BLOCKS_PER_GROUP(sb), map);
}

/*
* Read the bitmap for a given block_group, reading into the specified
* slot in the superblock's bitmap cache.
Expand All @@ -78,20 +86,51 @@ struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
static struct buffer_head *
read_block_bitmap(struct super_block *sb, unsigned int block_group)
{
int i;
struct ext2_group_desc * desc;
struct buffer_head * bh = NULL;

unsigned int bitmap_blk;

desc = ext2_get_group_desc (sb, block_group, NULL);
if (!desc)
goto error_out;
bh = sb_bread(sb, le32_to_cpu(desc->bg_block_bitmap));
return NULL;
bitmap_blk = le32_to_cpu(desc->bg_block_bitmap);
bh = sb_bread(sb, bitmap_blk);
if (!bh)
ext2_error (sb, "read_block_bitmap",
ext2_error (sb, __FUNCTION__,
"Cannot read block bitmap - "
"block_group = %d, block_bitmap = %u",
block_group, le32_to_cpu(desc->bg_block_bitmap));
error_out:

/* check whether block bitmap block number is set */
if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
/* bad block bitmap */
goto error_out;
}
/* check whether the inode bitmap block number is set */
bitmap_blk = le32_to_cpu(desc->bg_inode_bitmap);
if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
/* bad block bitmap */
goto error_out;
}
/* check whether the inode table block number is set */
bitmap_blk = le32_to_cpu(desc->bg_inode_table);
for (i = 0; i < EXT2_SB(sb)->s_itb_per_group; i++, bitmap_blk++) {
if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
/* bad block bitmap */
goto error_out;
}
}

return bh;

error_out:
brelse(bh);
ext2_error(sb, __FUNCTION__,
"Invalid block bitmap - "
"block_group = %d, block = %u",
block_group, bitmap_blk);
return NULL;
}

static void release_blocks(struct super_block *sb, int count)
Expand Down Expand Up @@ -1422,6 +1461,7 @@ unsigned long ext2_count_free_blocks (struct super_block * sb)
#endif
}


static inline int test_root(int a, int b)
{
int num = b;
Expand Down
48 changes: 44 additions & 4 deletions trunk/fs/ext3/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb,
return desc + offset;
}

static inline int
block_in_use(ext3_fsblk_t block, struct super_block *sb, unsigned char *map)
{
return ext3_test_bit ((block -
le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block)) %
EXT3_BLOCKS_PER_GROUP(sb), map);
}

/**
* read_block_bitmap()
* @sb: super block
Expand All @@ -93,20 +101,51 @@ struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb,
static struct buffer_head *
read_block_bitmap(struct super_block *sb, unsigned int block_group)
{
int i;
struct ext3_group_desc * desc;
struct buffer_head * bh = NULL;
ext3_fsblk_t bitmap_blk;

desc = ext3_get_group_desc (sb, block_group, NULL);
if (!desc)
goto error_out;
bh = sb_bread(sb, le32_to_cpu(desc->bg_block_bitmap));
return NULL;
bitmap_blk = le32_to_cpu(desc->bg_block_bitmap);
bh = sb_bread(sb, bitmap_blk);
if (!bh)
ext3_error (sb, "read_block_bitmap",
ext3_error (sb, __FUNCTION__,
"Cannot read block bitmap - "
"block_group = %d, block_bitmap = %u",
block_group, le32_to_cpu(desc->bg_block_bitmap));
error_out:

/* check whether block bitmap block number is set */
if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
/* bad block bitmap */
goto error_out;
}
/* check whether the inode bitmap block number is set */
bitmap_blk = le32_to_cpu(desc->bg_inode_bitmap);
if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
/* bad block bitmap */
goto error_out;
}
/* check whether the inode table block number is set */
bitmap_blk = le32_to_cpu(desc->bg_inode_table);
for (i = 0; i < EXT3_SB(sb)->s_itb_per_group; i++, bitmap_blk++) {
if (!block_in_use(bitmap_blk, sb, bh->b_data)) {
/* bad block bitmap */
goto error_out;
}
}

return bh;

error_out:
brelse(bh);
ext3_error(sb, __FUNCTION__,
"Invalid block bitmap - "
"block_group = %d, block = %lu",
block_group, bitmap_blk);
return NULL;
}
/*
* The reservation window structure operations
Expand Down Expand Up @@ -1733,6 +1772,7 @@ ext3_fsblk_t ext3_count_free_blocks(struct super_block *sb)
#endif
}


static inline int test_root(int a, int b)
{
int num = b;
Expand Down
Loading

0 comments on commit 381aae9

Please sign in to comment.