diff options
| author | Brian Carlstrom <bdc@google.com> | 2010-04-06 15:31:23 -0700 |
|---|---|---|
| committer | Brian Carlstrom <bdc@google.com> | 2010-04-06 15:31:23 -0700 |
| commit | a68049a8cc3f1eacda1e27b2040af73f6faa42ab (patch) | |
| tree | 31082e1546f81eb8be2380deab97c59ac51914b8 /include | |
| parent | b99a099cad7066274b25de9d603e7ced37d20e19 (diff) | |
| parent | 7c19bbe086b3cd81499829c0a79ed0ed0ae4fb16 (diff) | |
| download | system_core-a68049a8cc3f1eacda1e27b2040af73f6faa42ab.tar.gz system_core-a68049a8cc3f1eacda1e27b2040af73f6faa42ab.tar.bz2 system_core-a68049a8cc3f1eacda1e27b2040af73f6faa42ab.zip | |
Merge remote branch 'goog/froyo' into mm
Diffstat (limited to 'include')
| -rw-r--r-- | include/android/bitmap.h | 79 | ||||
| -rw-r--r-- | include/cutils/iosched_policy.h | 38 | ||||
| -rw-r--r-- | include/cutils/log.h | 100 | ||||
| -rw-r--r-- | include/cutils/logger.h | 1 | ||||
| -rw-r--r-- | include/cutils/logprint.h | 2 | ||||
| -rw-r--r-- | include/diskconfig/diskconfig.h | 129 | ||||
| -rw-r--r-- | include/pixelflinger/format.h | 24 | ||||
| -rw-r--r-- | include/private/android_filesystem_config.h | 16 | ||||
| -rw-r--r-- | include/private/pixelflinger/ggl_context.h | 3 | ||||
| -rw-r--r-- | include/sysutils/FrameworkListener.h | 2 |
10 files changed, 295 insertions, 99 deletions
diff --git a/include/android/bitmap.h b/include/android/bitmap.h deleted file mode 100644 index 5078277b..00000000 --- a/include/android/bitmap.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ANDROID_BITMAP_H -#define ANDROID_BITMAP_H - -#include <stdint.h> -#include <jni.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#define ANDROID_BITMAP_RESUT_SUCCESS 0 -#define ANDROID_BITMAP_RESULT_BAD_PARAMETER -1 -#define ANDROID_BITMAP_RESULT_JNI_EXCEPTION -2 -#define ANDROID_BITMAP_RESULT_ALLOCATION_FAILED -3 - -enum AndroidBitmapFormat { - ANDROID_BITMAP_FORMAT_NONE = 0, - ANDROID_BITMAP_FORMAT_RGBA_8888 = 1, - ANDROID_BITMAP_FORMAT_RGB_565 = 4, - ANDROID_BITMAP_FORMAT_RGBA_4444 = 7, - ANDROID_BITMAP_FORMAT_A_8 = 8, -}; - -typedef struct { - uint32_t width; - uint32_t height; - uint32_t stride; - int32_t format; - uint32_t flags; // 0 for now -} AndroidBitmapInfo; - -/** - * Given a java bitmap object, fill out the AndroidBitmap struct for it. - * If the call fails, the info parameter will be ignored - */ -int AndroidBitmap_getInfo(JNIEnv* env, jobject jbitmap, - AndroidBitmapInfo* info); - -/** - * Given a java bitmap object, attempt to lock the pixel address. - * Locking will ensure that the memory for the pixels will not move - * until the unlockPixels call, and ensure that, if the pixels had been - * previously purged, they will have been restored. - * - * If this call succeeds, it must be balanced by a call to - * AndroidBitmap_unlockPixels, after which time the address of the pixels should - * no longer be used. - * - * If this succeeds, *addrPtr will be set to the pixel address. If the call - * fails, addrPtr will be ignored. - */ -int AndroidBitmap_lockPixels(JNIEnv* env, jobject jbitmap, void** addrPtr); - -/** - * Call this to balanace a successful call to AndroidBitmap_lockPixels - */ -int AndroidBitmap_unlockPixels(JNIEnv* env, jobject jbitmap); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/cutils/iosched_policy.h b/include/cutils/iosched_policy.h new file mode 100644 index 00000000..07c5d1fc --- /dev/null +++ b/include/cutils/iosched_policy.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2007 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CUTILS_IOSCHED_POLICY_H +#define __CUTILS_IOSCHED_POLICY_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + IoSchedClass_NONE, + IoSchedClass_RT, + IoSchedClass_BE, + IoSchedClass_IDLE, +} IoSchedClass; + +extern int android_set_ioprio(int pid, IoSchedClass clazz, int ioprio); +extern int android_get_ioprio(int pid, IoSchedClass *clazz, int *ioprio); + +#ifdef __cplusplus +} +#endif + +#endif /* __CUTILS_IOSCHED_POLICY_H */ diff --git a/include/cutils/log.h b/include/cutils/log.h index ec3cac87..dd47c358 100644 --- a/include/cutils/log.h +++ b/include/cutils/log.h @@ -196,6 +196,91 @@ extern "C" { #define IF_LOGE() IF_LOG(LOG_ERROR, LOG_TAG) #endif + +// --------------------------------------------------------------------- + +/* + * Simplified macro to send a verbose system log message using the current LOG_TAG. + */ +#ifndef SLOGV +#if LOG_NDEBUG +#define SLOGV(...) ((void)0) +#else +#define SLOGV(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) +#endif +#endif + +#define CONDITION(cond) (__builtin_expect((cond)!=0, 0)) + +#ifndef SLOGV_IF +#if LOG_NDEBUG +#define SLOGV_IF(cond, ...) ((void)0) +#else +#define SLOGV_IF(cond, ...) \ + ( (CONDITION(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif +#endif + +/* + * Simplified macro to send a debug system log message using the current LOG_TAG. + */ +#ifndef SLOGD +#define SLOGD(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef SLOGD_IF +#define SLOGD_IF(cond, ...) \ + ( (CONDITION(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send an info system log message using the current LOG_TAG. + */ +#ifndef SLOGI +#define SLOGI(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef SLOGI_IF +#define SLOGI_IF(cond, ...) \ + ( (CONDITION(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send a warning system log message using the current LOG_TAG. + */ +#ifndef SLOGW +#define SLOGW(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef SLOGW_IF +#define SLOGW_IF(cond, ...) \ + ( (CONDITION(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + +/* + * Simplified macro to send an error system log message using the current LOG_TAG. + */ +#ifndef SLOGE +#define SLOGE(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef SLOGE_IF +#define SLOGE_IF(cond, ...) \ + ( (CONDITION(cond)) \ + ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ + : (void)0 ) +#endif + + + // --------------------------------------------------------------------- /* @@ -338,6 +423,21 @@ typedef enum { #define android_logToFile(tag, file) (0) #define android_logToFd(tag, fd) (0) +typedef enum { + LOG_ID_MAIN = 0, + LOG_ID_RADIO = 1, + LOG_ID_EVENTS = 2, + LOG_ID_SYSTEM = 3, + + LOG_ID_MAX +} log_id_t; + +/* + * Send a simple string to the log. + */ +int __android_log_buf_write(int bufID, int prio, const char *tag, const char *text); +int __android_log_buf_print(int bufID, int prio, const char *tag, const char *fmt, ...); + #ifdef __cplusplus } diff --git a/include/cutils/logger.h b/include/cutils/logger.h index 3a08019a..b60f7ad5 100644 --- a/include/cutils/logger.h +++ b/include/cutils/logger.h @@ -25,6 +25,7 @@ struct logger_entry { #define LOGGER_LOG_MAIN "log/main" #define LOGGER_LOG_RADIO "log/radio" #define LOGGER_LOG_EVENTS "log/events" +#define LOGGER_LOG_SYSTEM "log/system" #define LOGGER_ENTRY_MAX_LEN (4*1024) #define LOGGER_ENTRY_MAX_PAYLOAD \ diff --git a/include/cutils/logprint.h b/include/cutils/logprint.h index d6ec480c..769c8a73 100644 --- a/include/cutils/logprint.h +++ b/include/cutils/logprint.h @@ -142,7 +142,7 @@ char *android_log_formatLogLine ( * Assumes single threaded execution * */ -int android_log_filterAndPrintLogLine( +int android_log_printLogLine( AndroidLogFormat *p_format, int fd, const AndroidLogEntry *entry); diff --git a/include/diskconfig/diskconfig.h b/include/diskconfig/diskconfig.h new file mode 100644 index 00000000..d4f468cd --- /dev/null +++ b/include/diskconfig/diskconfig.h @@ -0,0 +1,129 @@ +/* system/core/include/diskconfig/diskconfig.h + * + * Copyright 2008, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __LIBS_DISKCONFIG_H +#define __LIBS_DISKCONFIG_H + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_NAME_LEN 512 +#define MAX_NUM_PARTS 16 + +/* known partition schemes */ +#define PART_SCHEME_MBR 0x1 +#define PART_SCHEME_GPT 0x2 + +/* PC Bios partition status */ +#define PC_PART_ACTIVE 0x80 +#define PC_PART_NORMAL 0x0 + +/* Known (rather, used by us) partition types */ +#define PC_PART_TYPE_LINUX 0x83 +#define PC_PART_TYPE_EXTENDED 0x05 +#define PC_PART_TYPE_FAT32 0x0c + +#define PC_NUM_BOOT_RECORD_PARTS 4 + +#define PC_EBR_LOGICAL_PART 0 +#define PC_EBR_NEXT_PTR_PART 1 + +#define PC_BIOS_BOOT_SIG 0xAA55 + +#define PC_MBR_DISK_OFFSET 0 +#define PC_MBR_SIZE 512 + +#define PART_ACTIVE_FLAG 0x1 + +struct chs { + uint8_t head; + uint8_t sector; + uint8_t cylinder; +} __attribute__((__packed__)); + +/* 16 byte pc partition descriptor that sits in MBR and EPBR. + * Note: multi-byte entities have little-endian layout on disk */ +struct pc_partition { + uint8_t status; /* byte 0 */ + struct chs start; /* bytes 1-3 */ + uint8_t type; /* byte 4 */ + struct chs end; /* bytes 5-7 */ + uint32_t start_lba; /* bytes 8-11 */ + uint32_t len_lba; /* bytes 12-15 */ +} __attribute__((__packed__)); + +struct pc_boot_record { + uint8_t code[440]; /* bytes 0-439 */ + uint32_t disk_sig; /* bytes 440-443 */ + uint16_t pad; /* bytes 444-445 */ + struct pc_partition ptable[PC_NUM_BOOT_RECORD_PARTS]; /* bytes 446-509 */ + uint16_t mbr_sig; /* bytes 510-511 */ +} __attribute__((__packed__)); + +struct part_info { + char *name; + uint8_t flags; + uint8_t type; + uint32_t len_kb; /* in 1K-bytes */ + uint32_t start_lba; /* the LBA where this partition begins */ +}; + +struct disk_info { + char *device; + uint8_t scheme; + int sect_size; /* expected sector size in bytes. MUST BE POWER OF 2 */ + uint32_t skip_lba; /* in sectors (1 unit of LBA) */ + uint32_t num_lba; /* the size of the disk in LBA units */ + struct part_info *part_lst; + int num_parts; +}; + +struct write_list { + struct write_list *next; + loff_t offset; + uint32_t len; + uint8_t data[0]; +}; + + +struct write_list *alloc_wl(uint32_t data_len); +void free_wl(struct write_list *item); +struct write_list *wlist_add(struct write_list **lst, struct write_list *item); +void wlist_free(struct write_list *lst); +int wlist_commit(int fd, struct write_list *lst, int test); + +struct disk_info *load_diskconfig(const char *fn, char *path_override); +int dump_disk_config(struct disk_info *dinfo); +int apply_disk_config(struct disk_info *dinfo, int test); +char *find_part_device(struct disk_info *dinfo, const char *name); +int process_disk_config(struct disk_info *dinfo); +struct part_info *find_part(struct disk_info *dinfo, const char *name); + +int write_raw_image(const char *dst, const char *src, loff_t offset, int test); + +/* For MBR partition schemes */ +struct write_list *config_mbr(struct disk_info *dinfo); +char *find_mbr_part(struct disk_info *dinfo, const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __LIBS_DISKCONFIG_H */ diff --git a/include/pixelflinger/format.h b/include/pixelflinger/format.h index 6b2050c4..82eeca4d 100644 --- a/include/pixelflinger/format.h +++ b/include/pixelflinger/format.h @@ -39,19 +39,25 @@ enum GGLPixelFormat { GGL_PIXEL_FORMAT_LA_88 = 0xA, // 16-bit LA GGL_PIXEL_FORMAT_RGB_332 = 0xB, // 8-bit RGB (non paletted) - // YCbCr formats (SP=semi-planar, P=planar) - GGL_PIXEL_FORMAT_YCbCr_422_SP= 0x10, - GGL_PIXEL_FORMAT_YCbCr_420_SP= 0x11, - GGL_PIXEL_FORMAT_YCbCr_422_P = 0x12, - GGL_PIXEL_FORMAT_YCbCr_420_P = 0x13, - GGL_PIXEL_FORMAT_YCbCr_422_I = 0x14, - GGL_PIXEL_FORMAT_YCbCr_420_I = 0x15, + // reserved range. don't use. + GGL_PIXEL_FORMAT_RESERVED_10 = 0x10, + GGL_PIXEL_FORMAT_RESERVED_11 = 0x11, + GGL_PIXEL_FORMAT_RESERVED_12 = 0x12, + GGL_PIXEL_FORMAT_RESERVED_13 = 0x13, + GGL_PIXEL_FORMAT_RESERVED_14 = 0x14, + GGL_PIXEL_FORMAT_RESERVED_15 = 0x15, + GGL_PIXEL_FORMAT_RESERVED_16 = 0x16, + GGL_PIXEL_FORMAT_RESERVED_17 = 0x17, // reserved/special formats GGL_PIXEL_FORMAT_Z_16 = 0x18, GGL_PIXEL_FORMAT_S_8 = 0x19, GGL_PIXEL_FORMAT_SZ_24 = 0x1A, GGL_PIXEL_FORMAT_SZ_8 = 0x1B, + + // reserved range. don't use. + GGL_PIXEL_FORMAT_RESERVED_20 = 0x20, + GGL_PIXEL_FORMAT_RESERVED_21 = 0x21, }; enum GGLFormatComponents { @@ -62,10 +68,6 @@ enum GGLFormatComponents { GGL_RGBA = 0x1908, GGL_LUMINANCE = 0x1909, GGL_LUMINANCE_ALPHA = 0x190A, - GGL_Y_CB_CR_SP = 0x8000, - GGL_Y_CB_CR = GGL_Y_CB_CR_SP, - GGL_Y_CB_CR_P = 0x8001, - GGL_Y_CB_CR_I = 0x8002, }; enum GGLFormatComponentIndex { diff --git a/include/private/android_filesystem_config.h b/include/private/android_filesystem_config.h index 24b7c819..474cfacb 100644 --- a/include/private/android_filesystem_config.h +++ b/include/private/android_filesystem_config.h @@ -156,9 +156,11 @@ static struct fs_path_config android_files[] = { { 00550, AID_ROOT, AID_SHELL, "system/etc/init.testmenu" }, { 00550, AID_DHCP, AID_SHELL, "system/etc/dhcpcd/dhcpcd-run-hooks" }, { 00440, AID_BLUETOOTH, AID_BLUETOOTH, "system/etc/dbus.conf" }, - { 00440, AID_BLUETOOTH, AID_BLUETOOTH, "system/etc/bluez/main.conf" }, - { 00440, AID_BLUETOOTH, AID_BLUETOOTH, "system/etc/bluez/input.conf" }, - { 00440, AID_BLUETOOTH, AID_BLUETOOTH, "system/etc/bluez/audio.conf" }, + { 00440, AID_BLUETOOTH, AID_BLUETOOTH, "system/etc/bluetooth/main.conf" }, + { 00440, AID_BLUETOOTH, AID_BLUETOOTH, "system/etc/bluetooth/input.conf" }, + { 00440, AID_BLUETOOTH, AID_BLUETOOTH, "system/etc/bluetooth/audio.conf" }, + { 00444, AID_NET_BT, AID_NET_BT, "system/etc/bluetooth/blacklist.conf" }, + { 00640, AID_SYSTEM, AID_SYSTEM, "system/etc/bluetooth/auto_pairing.conf" }, { 00444, AID_RADIO, AID_AUDIO, "system/etc/AudioPara4.csv" }, { 00555, AID_ROOT, AID_ROOT, "system/etc/ppp/*" }, { 00644, AID_SYSTEM, AID_SYSTEM, "data/app/*" }, @@ -167,14 +169,18 @@ static struct fs_path_config android_files[] = { /* the following two files are INTENTIONALLY set-gid and not set-uid. * Do not change. */ { 02755, AID_ROOT, AID_NET_RAW, "system/bin/ping" }, - { 02755, AID_ROOT, AID_INET, "system/bin/netcfg" }, - /* the following four files are INTENTIONALLY set-uid, but they + { 02750, AID_ROOT, AID_INET, "system/bin/netcfg" }, + /* the following five files are INTENTIONALLY set-uid, but they * are NOT included on user builds. */ { 06755, AID_ROOT, AID_ROOT, "system/xbin/su" }, { 06755, AID_ROOT, AID_ROOT, "system/xbin/librank" }, { 06755, AID_ROOT, AID_ROOT, "system/xbin/procrank" }, { 06755, AID_ROOT, AID_ROOT, "system/xbin/procmem" }, { 06755, AID_ROOT, AID_ROOT, "system/xbin/tcpdump" }, + { 04770, AID_ROOT, AID_RADIO, "system/bin/pppd-ril" }, + /* the following file is INTENTIONALLY set-uid, and IS included + * in user builds. */ + { 06750, AID_ROOT, AID_SHELL, "system/bin/run-as" }, { 00755, AID_ROOT, AID_SHELL, "system/bin/*" }, { 00755, AID_ROOT, AID_SHELL, "system/xbin/*" }, { 00750, AID_ROOT, AID_SHELL, "sbin/*" }, diff --git a/include/private/pixelflinger/ggl_context.h b/include/private/pixelflinger/ggl_context.h index 8a36fa9e..2d7fdcf5 100644 --- a/include/private/pixelflinger/ggl_context.h +++ b/include/private/pixelflinger/ggl_context.h @@ -285,8 +285,7 @@ struct clear_state_t { }; struct fog_state_t { - uint8_t color[3]; - uint8_t reserved; + uint8_t color[4]; }; struct logic_op_state_t { diff --git a/include/sysutils/FrameworkListener.h b/include/sysutils/FrameworkListener.h index 4e3d3964..142f50c5 100644 --- a/include/sysutils/FrameworkListener.h +++ b/include/sysutils/FrameworkListener.h @@ -23,7 +23,7 @@ class SocketClient; class FrameworkListener : public SocketListener { public: - static const int CMD_ARGS_MAX = 8; + static const int CMD_ARGS_MAX = 16; private: FrameworkCommandCollection *mCommands; |
