Changeset bd1deed in mainline for kernel/generic/src
- Timestamp:
- 2007-02-11T20:04:08Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c993e45
- Parents:
- ce8aed1
- Location:
- kernel/generic/src
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/lib/memstr.c
rce8aed1 rbd1deed 75 75 } 76 76 77 return (char *) src;77 return (char *) src; 78 78 } 79 79 … … 93 93 uint8_t *p = (uint8_t *) dst; 94 94 95 for (i=0; i<cnt; i++)95 for (i = 0; i < cnt; i++) 96 96 p[i] = x; 97 97 } … … 112 112 uint16_t *p = (uint16_t *) dst; 113 113 114 for (i=0; i<cnt; i++)114 for (i = 0; i < cnt; i++) 115 115 p[i] = x; 116 } 117 118 /** Copy string 119 * 120 * Copy string from src address to dst address. 121 * The copying is done char-by-char until the null 122 * character. The source and destination memory areas 123 * cannot overlap. 124 * 125 * @param src Origin string to copy from. 126 * @param dst Origin string to copy to. 127 * 128 */ 129 char *strcpy(char *dest, const char *src) 130 { 131 char *orig = dest; 132 133 while ((*(dest++) = *(src++))); 134 return orig; 116 135 } 117 136 -
kernel/generic/src/mm/as.c
rce8aed1 rbd1deed 82 82 #endif /* CONFIG_VIRT_IDX_DCACHE */ 83 83 84 #ifndef __OBJC__ 84 85 /** 85 86 * Each architecture decides what functions will be used to carry out … … 87 88 */ 88 89 as_operations_t *as_operations = NULL; 90 #endif 89 91 90 92 /** … … 993 995 pte_t *page_table_create(int flags) 994 996 { 995 ASSERT(as_operations); 996 ASSERT(as_operations->page_table_create); 997 998 return as_operations->page_table_create(flags); 997 #ifdef __OBJC__ 998 return [as_t page_table_create: flags]; 999 #else 1000 ASSERT(as_operations); 1001 ASSERT(as_operations->page_table_create); 1002 1003 return as_operations->page_table_create(flags); 1004 #endif 999 1005 } 1000 1006 … … 1007 1013 void page_table_destroy(pte_t *page_table) 1008 1014 { 1009 ASSERT(as_operations); 1010 ASSERT(as_operations->page_table_destroy); 1011 1012 as_operations->page_table_destroy(page_table); 1015 #ifdef __OBJC__ 1016 return [as_t page_table_destroy: page_table]; 1017 #else 1018 ASSERT(as_operations); 1019 ASSERT(as_operations->page_table_destroy); 1020 1021 as_operations->page_table_destroy(page_table); 1022 #endif 1013 1023 } 1014 1024 … … 1027 1037 void page_table_lock(as_t *as, bool lock) 1028 1038 { 1039 #ifdef __OBJC__ 1040 [as page_table_lock: lock]; 1041 #else 1029 1042 ASSERT(as_operations); 1030 1043 ASSERT(as_operations->page_table_lock); 1031 1044 1032 1045 as_operations->page_table_lock(as, lock); 1046 #endif 1033 1047 } 1034 1048 … … 1040 1054 void page_table_unlock(as_t *as, bool unlock) 1041 1055 { 1056 #ifdef __OBJC__ 1057 [as page_table_unlock: unlock]; 1058 #else 1042 1059 ASSERT(as_operations); 1043 1060 ASSERT(as_operations->page_table_unlock); 1044 1061 1045 1062 as_operations->page_table_unlock(as, unlock); 1063 #endif 1046 1064 } 1047 1065 -
kernel/generic/src/printf/vprintf.c
rce8aed1 rbd1deed 37 37 #include <putchar.h> 38 38 39 int vprintf_write(const char *str, size_t count, void *unused); 39 static int vprintf_write(const char *str, size_t count, void *unused) 40 { 41 size_t i; 42 for (i = 0; i < count; i++) 43 putchar(str[i]); 44 return i; 45 } 40 46 41 int vprintf_write(const char *str, size_t count, void *unused)47 int puts(const char *s) 42 48 { 43 size_t i = 0;44 for ( ; i < count; i++)45 putchar(s tr[i]);49 size_t i; 50 for (i = 0; s[i] != 0; i++) 51 putchar(s[i]); 46 52 return i; 47 53 } … … 49 55 int vprintf(const char *fmt, va_list ap) 50 56 { 51 struct printf_spec ps = {(int(*)(void *, size_t, void *)) vprintf_write, NULL};57 struct printf_spec ps = {(int(*)(void *, size_t, void *)) vprintf_write, NULL}; 52 58 return printf_core(fmt, &ps, ap); 53 59
Note:
See TracChangeset
for help on using the changeset viewer.