Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset a9bbe48d in mainline


Ignore:
Timestamp:
2010-01-27T22:23:50Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
e7aa9f4
Parents:
95e6c4f (diff), 1ccafee (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge formatting macros for userspace.

Location:
uspace
Files:
10 added
10 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mkfat/mkfat.c

    r95e6c4f ra9bbe48d  
    4444#include <devmap.h>
    4545#include <byteorder.h>
     46#include <sys/types.h>
     47#include <sys/typefmt.h>
     48#include <inttypes.h>
    4649#include <errno.h>
    4750#include "fat.h"
     
    157160                printf(NAME ": Warning, failed to obtain block device size.\n");
    158161        } else {
    159                 printf(NAME ": Block device has %llu blocks.\n", dev_nblocks);
     162                printf(NAME ": Block device has %" PRIuBN " blocks.\n",
     163                    dev_nblocks);
    160164                cfg.total_sectors = dev_nblocks;
    161165        }
  • uspace/app/taskdump/taskdump.c

    r95e6c4f ra9bbe48d  
    4141#include <task.h>
    4242#include <kernel/mm/as.h>
     43#include <sys/types.h>
     44#include <sys/typefmt.h>
    4345#include <libarch/istate.h>
    4446#include <macros.h>
     
    9395        rc = connect_task(task_id);
    9496        if (rc < 0) {
    95                 printf("Failed connecting to task %lld.\n", task_id);
     97                printf("Failed connecting to task %" PRIdTASKID ".\n", task_id);
    9698                return 1;
    9799        }
     
    100102        app_symtab = NULL;
    101103
    102         printf("Dumping task '%s' (task ID %lld).\n", app_name, task_id);
     104        printf("Dumping task '%s' (task ID %" PRIdTASKID ").\n", app_name, task_id);
    103105        autoload_syms();
    104106        putchar('\n');
     
    134136        if (rc < 0) {
    135137                printf("Error connecting\n");
    136                 printf("ipc_connect_task(%lld) -> %d ", task_id, rc);
     138                printf("ipc_connect_task(%" PRIdTASKID ") -> %d ", task_id, rc);
    137139                return rc;
    138140        }
     
    245247        printf("Threads:\n");
    246248        for (i = 0; i < n_threads; i++) {
    247                 printf(" [%d] hash: 0x%lx\n", 1+i, thash_buf[i]);
     249                printf(" [%d] hash: %p\n", 1+i, thash_buf[i]);
    248250
    249251                thread_dump(thash_buf[i]);
     
    289291        printf("Address space areas:\n");
    290292        for (i = 0; i < n_areas; i++) {
    291                 printf(" [%d] flags: %c%c%c%c base: 0x%lx size: 0x%lx\n", 1+i,
     293                printf(" [%d] flags: %c%c%c%c base: %p size: %p\n", 1+i,
    292294                    (ainfo_buf[i].flags & AS_AREA_READ) ? 'R' : '-',
    293295                    (ainfo_buf[i].flags & AS_AREA_WRITE) ? 'W' : '-',
     
    328330
    329331        sym_pc = fmt_sym_address(pc);
    330         printf("Thread 0x%lx crashed at %s. FP = 0x%lx\n", thash, sym_pc, fp);
     332        printf("Thread %p crashed at %s. FP = %p\n", thash, sym_pc, fp);
    331333        free(sym_pc);
    332334
  • uspace/app/trace/ipcp.c

    r95e6c4f ra9bbe48d  
    3636#include <stdlib.h>
    3737#include <adt/hash_table.h>
     38#include <sys/typefmt.h>
    3839
    3940#include "ipc_desc.h"
     
    200201
    201202        if ((display_mask & DM_IPC) != 0) {
    202                 printf("Call ID: 0x%lx, phone: %d, proto: %s, method: ", hash,
     203                printf("Call ID: %p, phone: %d, proto: %s, method: ", hash,
    203204                        phone, (proto ? proto->name : "n/a"));
    204205                ipc_m_print(proto, IPC_GET_METHOD(*call));
    205                 printf(" args: (%lu, %lu, %lu, %lu, %lu)\n", args[1], args[2],
     206                printf(" args: (%" PRIuIPCARG ", %" PRIuIPCARG ", %" PRIuIPCARG
     207                    ", %" PRIuIPCARG ", %" PRIuIPCARG ")\n", args[1], args[2],
    206208                    args[3], args[4], args[5]);
    207209        }
     
    279281
    280282        if ((display_mask & DM_IPC) != 0) {
    281                 printf("Response to 0x%lx: retval=%ld, args = (%lu, %lu, %lu, %lu, %lu)\n",
    282                         hash, retval, IPC_GET_ARG1(*answer),
    283                         IPC_GET_ARG2(*answer), IPC_GET_ARG3(*answer),
    284                         IPC_GET_ARG4(*answer), IPC_GET_ARG5(*answer));
     283                printf("Response to %p: retval=%ld, args = (%" PRIuIPCARG
     284                    ", %" PRIuIPCARG ", %" PRIuIPCARG ", %" PRIuIPCARG
     285                    ", %" PRIuIPCARG ")\n",
     286                    hash, retval, IPC_GET_ARG1(*answer),
     287                    IPC_GET_ARG2(*answer), IPC_GET_ARG3(*answer),
     288                    IPC_GET_ARG4(*answer), IPC_GET_ARG5(*answer));
    285289        }
    286290
     
    336340                /* Not a response */
    337341                if ((display_mask & DM_IPC) != 0) {
    338                         printf("Not a response (hash 0x%lx)\n", hash);
     342                        printf("Not a response (hash %p)\n", hash);
    339343                }
    340344                return;
  • uspace/app/trace/trace.c

    r95e6c4f ra9bbe48d  
    4949#include <io/keycode.h>
    5050#include <fibril_synch.h>
     51#include <sys/types.h>
     52#include <sys/typefmt.h>
    5153
    5254#include <libc.h>
     
    159161        if (rc < 0) {
    160162                printf("Error connecting\n");
    161                 printf("ipc_connect_task(%lld) -> %d ", task_id, rc);
     163                printf("ipc_connect_task(%" PRIdTASKID ") -> %d ", task_id, rc);
    162164                return rc;
    163165        }
     
    198200        printf("Threads:");
    199201        for (i = 0; i < n_threads; i++) {
    200                 printf(" [%d] (hash 0x%lx)", 1+i, thread_hash_buf[i]);
     202                printf(" [%d] (hash %p)", 1+i, thread_hash_buf[i]);
    201203        }
    202204        printf("\ntotal of %u threads\n", tb_needed / sizeof(uintptr_t));
     
    222224        case V_HASH:
    223225        case V_PTR:
    224                 printf("0x%08lx", val);
     226                printf("%p", val);
    225227                break;
    226228
     
    275277
    276278        putchar('(');
    277         if (n > 0) printf("%ld", sc_args[0]);
     279        if (n > 0) printf("%" PRIdSYSARG, sc_args[0]);
    278280        for (i = 1; i < n; i++) {
    279                 printf(", %ld", sc_args[i]);
     281                printf(", %" PRIdSYSARG, sc_args[i]);
    280282        }
    281283        putchar(')');
     
    508510        }
    509511
    510         printf("Start tracing thread [%d] (hash 0x%lx).\n", thread_id, thread_hash);
     512        printf("Start tracing thread [%d] (hash %p).\n", thread_id, thread_hash);
    511513
    512514        while (!abort_trace) {
     
    552554                                break;
    553555                        case UDEBUG_EVENT_THREAD_E:
    554                                 printf("Thread 0x%lx exited.\n", val0);
     556                                printf("Thread %p exited.\n", val0);
    555557                                fibril_mutex_lock(&state_lock);
    556558                                abort_trace = true;
     
    972974        rc = connect_task(task_id);
    973975        if (rc < 0) {
    974                 printf("Failed connecting to task %lld.\n", task_id);
     976                printf("Failed connecting to task %" PRIdTASKID ".\n", task_id);
    975977                return 1;
    976978        }
    977979
    978         printf("Connected to task %lld.\n", task_id);
     980        printf("Connected to task %" PRIdTASKID ".\n", task_id);
    979981
    980982        if (task_ldr != NULL)
  • uspace/srv/bd/ata_bd/ata_bd.c

    r95e6c4f ra9bbe48d  
    5959#include <devmap.h>
    6060#include <sys/types.h>
     61#include <inttypes.h>
    6162#include <errno.h>
    6263#include <bool.h>
     
    112113        printf(NAME ": ATA disk driver\n");
    113114
    114         printf("I/O address 0x%p/0x%p\n", ctl_physical, cmd_physical);
     115        printf("I/O address %p/%p\n", ctl_physical, cmd_physical);
    115116
    116117        if (ata_bd_init() != EOK)
     
    180181        }
    181182
    182         printf(" %llu blocks", d->blocks, d->blocks / (2 * 1024));
     183        printf(" %" PRIu64 " blocks", d->blocks, d->blocks / (2 * 1024));
    183184
    184185        mbytes = d->blocks / (2 * 1024);
    185186        if (mbytes > 0)
    186                 printf(" %llu MB.", mbytes);
     187                printf(" %" PRIu64 " MB.", mbytes);
    187188
    188189        printf("\n");
  • uspace/srv/bd/part/guid_part/guid_part.c

    r95e6c4f ra9bbe48d  
    5454#include <devmap.h>
    5555#include <sys/types.h>
     56#include <sys/typefmt.h>
     57#include <inttypes.h>
    5658#include <libblock.h>
    5759#include <devmap.h>
     
    196198                size_mb = (part->length * block_size + 1024 * 1024 - 1)
    197199                    / (1024 * 1024);
    198                 printf(NAME ": Registered device %s: %llu blocks %llu MB.\n",
    199                     name, part->length, size_mb);
     200                printf(NAME ": Registered device %s: %" PRIu64 " blocks "
     201                    "%" PRIuBN " MB.\n", name, part->length, size_mb);
    200202
    201203                part->dev = dev;
  • uspace/srv/bd/part/mbr_part/mbr_part.c

    r95e6c4f ra9bbe48d  
    6464#include <devmap.h>
    6565#include <sys/types.h>
     66#include <sys/typefmt.h>
     67#include <inttypes.h>
    6668#include <libblock.h>
    6769#include <devmap.h>
     
    247249                size_mb = (part->length * block_size + 1024 * 1024 - 1)
    248250                    / (1024 * 1024);
    249                 printf(NAME ": Registered device %s: %llu blocks %llu MB.\n",
    250                     name, part->length, size_mb);
     251                printf(NAME ": Registered device %s: %" PRIuBN " blocks "
     252                    "%" PRIu64 " MB.\n", name, part->length, size_mb);
    251253
    252254                part->dev = dev;
     
    274276        if (brb == NULL) {
    275277                printf(NAME ": Failed allocating memory.\n");
    276                 return ENOMEM; 
     278                return ENOMEM;
    277279        }
    278280
     
    289291        sgn = uint16_t_le2host(brb->signature);
    290292        if (sgn != BR_SIGNATURE) {
    291                 printf(NAME ": Invalid boot record signature 0x%04X.\n", sgn);
     293                printf(NAME ": Invalid boot record signature 0x%04" PRIX16
     294                    ".\n", sgn);
    292295                return EINVAL;
    293296        }
     
    333336                rc = block_read_direct(indev_handle, ba, 1, brb);
    334337                if (rc != EOK) {
    335                         printf(NAME ": Failed reading EBR block at %u.\n", ba);
     338                        printf(NAME ": Failed reading EBR block at %"
     339                            PRIu32 ".\n", ba);
    336340                        return rc;
    337341                }
     
    339343                sgn = uint16_t_le2host(brb->signature);
    340344                if (sgn != BR_SIGNATURE) {
    341                         printf(NAME ": Invalid boot record signature 0x%04X "
    342                             " in EBR at %u.\n", sgn, ba);
     345                        printf(NAME ": Invalid boot record signature 0x%04"
     346                            PRIX16 " in EBR at %" PRIu32 ".\n", sgn, ba);
    343347                        return EINVAL;
    344348                }
  • uspace/srv/loader/elf_load.c

    r95e6c4f ra9bbe48d  
    342342        seg_ptr = (void *) seg_addr;
    343343
    344         DPRINTF("Load segment at addr 0x%x, size 0x%x\n", seg_addr,
    345                 entry->p_memsz);       
     344        DPRINTF("Load segment at addr %p, size 0x%x\n", seg_addr,
     345                entry->p_memsz);
    346346
    347347        if (entry->p_align > 1) {
     
    370370        mem_sz = entry->p_memsz + (entry->p_vaddr - base);
    371371
    372         DPRINTF("Map to seg_addr=0x%x-0x%x.\n", seg_addr,
     372        DPRINTF("Map to seg_addr=%p-%p.\n", seg_addr,
    373373        entry->p_vaddr + bias + ALIGN_UP(entry->p_memsz, PAGE_SIZE));
    374374
     
    384384        }
    385385
    386         DPRINTF("as_area_create(0x%lx, 0x%x, %d) -> 0x%lx\n",
     386        DPRINTF("as_area_create(%p, 0x%x, %d) -> 0x%lx\n",
    387387                base + bias, mem_sz, flags, (uintptr_t)a);
    388388
     
    461461                elf->info->dynamic =
    462462                    (void *)((uint8_t *)entry->sh_addr + elf->bias);
    463                 DPRINTF("Dynamic section found at 0x%x.\n",
     463                DPRINTF("Dynamic section found at %p.\n",
    464464                        (uintptr_t)elf->info->dynamic);
    465465                break;
  • uspace/srv/loader/main.c

    r95e6c4f ra9bbe48d  
    392392                /* Dynamically linked program */
    393393                DPRINTF("Run ELF interpreter.\n");
    394                 DPRINTF("Entry point: 0x%lx\n", interp_info.entry);
     394                DPRINTF("Entry point: %p\n", interp_info.entry);
    395395               
    396396                ipc_answer_0(rid, EOK);
  • uspace/srv/taskmon/taskmon.c

    r95e6c4f ra9bbe48d  
    3939#include <async.h>
    4040#include <ipc/services.h>
     41#include <sys/typefmt.h>
    4142#include <task.h>
    4243#include <event.h>
     
    6061        thread = IPC_GET_ARG3(*call);
    6162
    62         if (asprintf(&s_taskid, "%lld", taskid) < 0) {
     63        if (asprintf(&s_taskid, "%" PRIuTASKID, taskid) < 0) {
    6364                printf("Memory allocation failed.\n");
    6465                return;
    6566        }
    6667
    67         if (asprintf(&dump_fname, "/scratch/d%lld.txt", taskid) < 0) {
     68        if (asprintf(&dump_fname, "/scratch/d" PRIuTASKID ".txt", taskid) < 0) {
    6869                printf("Memory allocation failed.\n");
    6970                return;
    7071        }
    7172
    72         printf(NAME ": Task %lld fault in thread 0x%lx.\n", taskid, thread);
     73        printf(NAME ": Task %" PRIuTASKID " fault in thread %p.\n", taskid, thread);
    7374
    7475#ifdef CONFIG_VERBOSE_DUMPS
Note: See TracChangeset for help on using the changeset viewer.