summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2009-06-07 21:27:05 +0000
committerJens Arnold <amiconn@rockbox.org>2009-06-07 21:27:05 +0000
commit1d6df54df27cb41c02226678a2c8f9feddd1a1e0 (patch)
tree5fdc6dd98ac0208f5c3351b062063af6914cbefb /firmware/drivers/ata.c
parentc3182ec333982e961d3babfbdb1125fd5bac7fb8 (diff)
downloadrockbox-1d6df54df27cb41c02226678a2c8f9feddd1a1e0.tar.gz
rockbox-1d6df54df27cb41c02226678a2c8f9feddd1a1e0.zip
Convert a number of places in core and plugins to use the BIT_N() macro instead of 1<<n. Speeds up things on SH1, and also reduces core binsize. Most notable speedups: 1 bit lcd driver: drawpixel +20%, drawline + 27%, hline +5%; jpeg viewer: +8% for 1/8 scaling. Other targets are unaffected.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21205 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r--firmware/drivers/ata.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 88633f0ec9..adc720eaf8 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -1268,7 +1268,7 @@ static int set_multiple_mode(int sectors)
1268#ifdef HAVE_ATA_DMA 1268#ifdef HAVE_ATA_DMA
1269static int get_best_mode(unsigned short identword, int max, int modetype) 1269static int get_best_mode(unsigned short identword, int max, int modetype)
1270{ 1270{
1271 unsigned short testbit = 1u << max; 1271 unsigned short testbit = BIT_N(max);
1272 1272
1273 while (1) { 1273 while (1) {
1274 if (identword & testbit) 1274 if (identword & testbit)
@@ -1335,7 +1335,7 @@ static int set_features(void)
1335 } 1335 }
1336 1336
1337 for (i=0; i < (int)(sizeof(features)/sizeof(features[0])); i++) { 1337 for (i=0; i < (int)(sizeof(features)/sizeof(features[0])); i++) {
1338 if (identify_info[features[i].id_word] & (1u << features[i].id_bit)) { 1338 if (identify_info[features[i].id_word] & BIT_N(features[i].id_bit)) {
1339 SET_REG(ATA_FEATURE, features[i].subcommand); 1339 SET_REG(ATA_FEATURE, features[i].subcommand);
1340 SET_REG(ATA_NSECTOR, features[i].parameter); 1340 SET_REG(ATA_NSECTOR, features[i].parameter);
1341 SET_REG(ATA_COMMAND, CMD_SET_FEATURES); 1341 SET_REG(ATA_COMMAND, CMD_SET_FEATURES);
@@ -1461,7 +1461,7 @@ int ata_init(void)
1461#ifdef MAX_PHYS_SECTOR_SIZE 1461#ifdef MAX_PHYS_SECTOR_SIZE
1462 /* Find out the physical sector size */ 1462 /* Find out the physical sector size */
1463 if((identify_info[106] & 0xe000) == 0x6000) 1463 if((identify_info[106] & 0xe000) == 0x6000)
1464 phys_sector_mult = 1 << (identify_info[106] & 0x000f); 1464 phys_sector_mult = BIT_N(identify_info[106] & 0x000f);
1465 else 1465 else
1466 phys_sector_mult = 1; 1466 phys_sector_mult = 1;
1467 1467